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.213.68 with SMTP id nq4mr13149329pbc.2.1329241625591; Tue, 14 Feb 2012 09:47:05 -0800 (PST) Path: wr5ni24825pbc.0!nntp.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!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 18:47:03 +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> <4f3a87d9.14307647@nntp.aioe.org> NNTP-Posting-Host: 2620:0:105f:b:462a:60ff:fefb:aad8 Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1329241625 25344 2620:0:105f:b:462a:60ff:fefb:aad8 (14 Feb 2012 17:47:05 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Tue, 14 Feb 2012 17:47:05 +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: <4f3a87d9.14307647@nntp.aioe.org> X-Received-Bytes: 4621 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-02-14 17.20, paramucho wrote: > 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). Huh? I did not get that last part. How does MFPx solve the MTPx problem? Doing a read before every write? >>> 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. No. It can only be 2 or 4 bytes, since the destination is always -(SP), or else you have a totally different problem on your hand, which is not related to this. I think you can problably pattern match the two previous words in the instruction stream to figure out which variant it was. > 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.) That is also a possibility, since we're talking about the kernel anyway, which is a well controlled environment. But I'm not particularly fond of it. > "Operational" solutions are available to the other issues as well. For > example, MFPS will never fail to a general register. Right. However, I think I actually prefer the idea that the kernel checks/knows that the page is accessible before doing any access. Johnny