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.73.229 with SMTP id o5mr12957450pbv.7.1329236463831; Tue, 14 Feb 2012 08:21:03 -0800 (PST) Path: wr5ni24592pbc.0!nntp.google.com!news2.google.com!goblin3!goblin2!goblin.stu.neva.ru!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: Tue, 14 Feb 2012 16:20:51 GMT Organization: Aioe.org NNTP Server Message-ID: <4f3a87d9.14307647@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> 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 Tue, 14 Feb 2012 00:18:44 +0100, Johnny Billquist wrote: >> 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. > >Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted. >It's a design error in the PDP-11. Gha, that's ugly. Yes, but only MTPx is affected. MFPx doesn't have the problem (which also means that we can use MFPx in solving the MTPx problem). >> 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. > >I'm willing to bet money that the 11/70 behaves the same way. > >The solution would actually be to make sure the address in userspace you >want to read/write is in memory, so that you don't get page faults. >Using memory mapping registers for this wouldn't be fun. >One more trick that can be used is to only support/use MFPx/MTPx in >kernel in the sequence of a push to the stack followed by this. That >way, you could, as a part of the restart detect this special case, and >back up to the previous instruction to redo the push as well. My thoughts too. The problem is that the "previous instruction" could be 2, 4 or 6 bytes long. Noting that MPTI always clears the V-bit, I would follow the MPTI instruction with BVS, as below, and use the BVS opcode itself as a signature for the special behavior. I seem to recall using this technique to solve 10$: psh mtpi
bvs 10$ (In fact I already use this kind of thing in RUST/XM to handle bus errors (trap to 4) instead of address checking in some cases.) "Operational" solutions are available to the other issues as well. For example, MFPS will never fail to a general register. Ian