From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.74.201 with SMTP id w9mr12979635pbv.0.1329236467560; Tue, 14 Feb 2012 08:21:07 -0800 (PST) Path: wr5ni24589pbc.0!nntp.google.com!news1.google.com!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:56 GMT Organization: Aioe.org NNTP Server Message-ID: <4f3b881d.14375367@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 Tue, 14 Feb 2012 14:14:33 +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. >>> >>> 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. Clearly we need to have a separate "interrupt" stack for page faults, and the kernel stack is the logical choice for that. Giving up on demand paging for the majority of the system code seems to be a high price to pay (and would take a lot of fun out of the project). My inclination would be to move a lot of the system code to supervisor mode. The kernel would be reserved for non-paging code (drivers etc), or code that made highly-disciplined accesses (the pager itself). Supervisor mode would be used to implement the system api's etc. Ian