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 wf5mr10283595pbc.4.1329154261299; Mon, 13 Feb 2012 09:31:01 -0800 (PST) Path: wr5ni20816pbc.0!nntp.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!gegeweb.org!aioe.org!.POSTED!not-for-mail From: paramucho@hotmail.com (paramucho) Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Mon, 13 Feb 2012 17:30:27 GMT Organization: Aioe.org NNTP Server Message-ID: <4f3b48af.53561008@nntp.aioe.org> 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> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: CmgvwL3sOlojnxUjt8znzA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 1.5/32.451 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Sun, 12 Feb 2012 18:35:31 GMT, paramucho@hotmail.com (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 -Z-- >> Vec=250 SR0=100151 SR1=[20|26] SR2=3110 >> >>Before: R0=100000 SP=740 PC=3110 PS=30017 NZVC >>After: R0=100002 SP=742 PC=3112 PS=30005 -Z-C >> 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. > >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... TEST21:: MFPS I've added a 4-character condition code field, e.g. "NZVC", (and I've edited the earlier examples above). MFPS instruction tests fail because the condition codes pushed by the abort trap have been modified from the original. In the examples ---- is pushed as -Z-- and NZVC is pushed as ---C. The restarted instruction will return the wrong condition codes. This is not good. J11/SimH: Test21: mfps (r0)+ Before: R0=100000 SP=742 PC=6526 PS=30000 ---- After: R0=100001 SP=742 PC=6530 PS=30004 -Z-- Vec=250 SR0=100011 SR1=[0|10] SR2=6526 Before: R0=100000 SP=742 PC=6526 PS=30017 NZVC After: R0=100001 SP=742 PC=6530 PS=30001 ---C Vec=250 SR0=100011 SR1=[0|10] SR2=6526 The changes being applied to the PS are those described for the instruction. In the case of MFPS: N: set if PS <0> = 1; cleared otherwise Z: set if PS <07:00> = 0; cleared otherwise V: cleared C: not affected MTPS does not have a problem. BTW: Perhaps it's time to note the obvious: The J11 and SimH tend to apply the side-affects of an operation as an instruction progresses where E11 tends wait until an instruction has completed before applying side-affects. And it's also clear that the SimH attempts to get as close as possible to the J11's operational behavior, so any deviations from J11 behavior are probably worth reporting. I did a final compare of the J11 and SimH, clearing some details etc. The results are in the source of the utility. Ian