From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: ffc31,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidf4c4f7386e,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.37 with SMTP id wf5mr12563075pbc.4.1329225273730; Tue, 14 Feb 2012 05:14:33 -0800 (PST) Path: wr5ni24072pbc.0!nntp.google.com!news2.google.com!news.glorb.com!eternal-september.org!feeder.eternal-september.org!newsfeed.Update.UU.SE!news.Update.UU.SE!not-for-mail From: Johnny Billquist Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Tue, 14 Feb 2012 14:14:33 +0100 Organization: Update Computer Club Message-ID: References: <4f313229.43518694@nntp.aioe.org> <4f37717c.29259157@nntp.aioe.org> <4f339e98.40806741@nntp.aioe.org> <4f360d68.39000374@nntp.aioe.org> <4f396a03.27713593@nntp.aioe.org> <4f37ec05.63303162@nntp.aioe.org> <4f38003f.338958@nntp.aioe.org> NNTP-Posting-Host: 2620:0:105f:b:462a:60ff:fefb:aad8 Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1329225273 20264 2620:0:105f:b:462a:60ff:fefb:aad8 (14 Feb 2012 13:14:33 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Tue, 14 Feb 2012 13:14:33 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: <4f38003f.338958@nntp.aioe.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-02-12 19.35, paramucho wrote: > On Sun, 12 Feb 2012 17:23:32 GMT, paramucho@hotmail.com (paramucho) > wrote: > >> >>> >> As noted above, I've implemented the condition code tests (and I'm >> running a bit late with the promised code because of that). The test >> below shows the PS to be 30000 BEFORE the test. AFTER the test it is >> 30004. I repeat the test with an initial PS of 30017 (all condition >> codes set). The AFTER state is 30005. I only show the repeated test if >> there is a difference between its PS BEFORE and AFTER state. >> >> J11: >> SimH: >> Test03: mtpi *(r0)+ >> Before: R0=100000 SP=740 PC=3110 PS=30000 >> After: R0=100002 SP=742 PC=3112 PS=30004 >> Vec=250 SR0=100151 SR1=[20|26] SR2=3110 >> >> Before: R0=100000 SP=740 PC=3110 PS=30017 >> After: R0=100002 SP=742 PC=3112 PS=30005 >> Vec=250 SR0=100151 SR1=[20|26] SR2=3110 >> > > >> E11 doesn't have the condition code problem, but you may recall that >> this is one of two tests we marked as a BUG because the AFTER state >> has SP+2 but there's no recovery information. >> >> E11: >> Test03: mtpi *(r0)+ >> Before: R0=100000 SP=740 PC=3110 PS=30000 >> After: R0=100000 SP=742 PC=3112 PS=30000 >> Vec=250 SR0=100151 SR1=[0|0] SR2=3110 >> >> What I realized tonight however is that the E11 bug distracted me from >> noticing a bigger problem: The J11 and SimH might give us the backout >> information for the stack ([20|26]), but it's of no use because the >> MTPI stack operand will have already been overwritten by the MMU trap. >> The value we wanted to write to user space (for example) can't be >> recovered. >> >> Basically, if we want to implement demand paging, we're screwed. MFPx >> and MTPx are the basic tools used in the kernel to copy information to >> and from user space. The workarounds are horrible (i.e. converting the >> virtual address to a par/offset pair and mapping via a window). I'll >> be very interested to know if the 11/70 has the problem. > > It occurred to me later that this problem was generic for any kernel > instruction which popped the stack before the fault, e.g. mov > (sp)+,(r0)+ where R0 was an invalid pointer. In fact a quick test > showed identical results as per MTPI above. Ah, yes. Good point. > Clearly, you can't demand-page on the same stack that you take page > faults on. Thus, if demand paging is only supported in user and > supervisor mode perhaps the idea is to move "paged" system code to > supervisor space. Either that or not to page system code at all and > use address checks and page locks for every kernel access to > user/supervisor mode... Right. I suspect the right thing to do in the kernel is to not expect to do demand paging for access from kernel space. The kernel should check in advance (and it can) that all memory references will work. Any memory errors in kernel space should probably be treated as fatal. Johnny