Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Johnny Billquist <bqt@softjar.se>
Subject: Re: PDP11 Values from MFPT
Date: Tue, 14 Feb 2012 20:54:51 +0100	[thread overview]
Message-ID: <jhee6a$r2r$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <4f3ca414.21534066@nntp.aioe.org>

On 2012-02-14 19:17, paramucho wrote:
>>> On Tue, 14 Feb 2012 00:18:44 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip>
>>>
>>>>> 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?
>
> "in solving" as in "implementing a workaround."
>
> We get a page fault and we want to see if the instruction causing the
> fault was MTPx? So, how do we look at that instruction? With MFPx.

Well, this is only a problem when this happens in kernel mode. And you 
can just check the failed instruction by checking where the MMR2 
register points to see what instruction was executed.

>>>>> 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 was thinking of a generalised way of handling (SP)+-related faults
> in kernel mode.

But this whole problem is a thing when you have something POP something 
from the stack. Looking at the previous instruction thought was just for 
the MTPx instruction, as that pops the value to write off the stack, and 
to restart in kernel mode you then need to re-push the value again.
The idea was simply to restrict the page fault handler to be able to 
deal with just a specific sequence, namely PUSH, immediately followed by 
MTPx, so that the restart can actually back up and redo the PUSH as well.
But it was just one possible solution to a specific scenario.

In general, I think that doing page-faulting in the kernel is a bad idea.

>>> "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.
>
> It would have to know that the page remained accessible not just
> before the access, but across the access, and that would mean locking
> the page. That could get kind of expensive.

You already need to be able to lock pages in memory anyway, as well as 
have code to check that memory is paged in, and then do the locking. 
This is required for things like DMA, so it's not that you need much more.

And as for "across the access", I'm not really fond of the Unix way of 
having user processed get bogged down in the kernel and being preempted 
and suspended in kernel mode. I prefer having all the service by the 
kernel be finished immediately, and get back out to userland, and wait 
there. So you need to be sure that what you are going to access is 
available in the beginning, and after that, it will stay around until 
your piece of service is finished. No additional checks.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


  reply	other threads:[~2012-02-14 19:54 UTC|newest]

Thread overview: 222+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18  6:03 ` paramucho
2012-01-18 11:28   ` Johnny Billquist
2012-01-18 13:05     ` glen herrmannsfeldt
2012-01-18 13:26       ` Johnny Billquist
2012-01-26  3:24         ` Jerome H. Fine
2012-01-26 13:38           ` Johnny Billquist
2012-01-29  1:32             ` Jerome H. Fine
2012-01-29  1:43               ` Johnny Billquist
2012-01-26  3:23       ` Jerome H. Fine
2012-01-18 16:02     ` paramucho
2012-01-18 18:12       ` Johnny Billquist
2012-01-19 14:30         ` paramucho
2012-01-19 16:42           ` Johnny Billquist
2012-01-19 20:32             ` glen herrmannsfeldt
2012-01-20 13:32               ` paramucho
2012-01-20 13:29             ` paramucho
2012-01-20 16:48               ` Johnny Billquist
2012-01-21 12:25                 ` paramucho
2012-01-21 20:15                   ` Johnny Billquist
2012-01-26  3:25               ` Jerome H. Fine
2012-01-26  6:09                 ` paramucho
2012-01-26  6:30                   ` paramucho
2012-01-26 13:50                     ` Johnny Billquist
2012-01-29  1:52                       ` Jerome H. Fine
2012-01-29  2:08                         ` Johnny Billquist
2012-01-26 13:48                   ` Johnny Billquist
2012-01-26 13:46                 ` Johnny Billquist
2012-01-29  1:35                   ` Jerome H. Fine
2012-01-18 12:41   ` glen herrmannsfeldt
2012-01-18 13:18     ` Johnny Billquist
2012-01-18 14:28       ` glen herrmannsfeldt
2012-01-18 15:14         ` Johnny Billquist
2012-01-18 21:54           ` glen herrmannsfeldt
2012-01-18 22:32             ` Al Kossow
2012-01-19  0:22             ` Johnny Billquist
2012-01-19  1:30               ` glen herrmannsfeldt
2012-01-19 14:32             ` Bob Koehler
2012-01-19 16:45               ` Johnny Billquist
2012-01-20 17:55                 ` Bob Koehler
2012-01-20 18:38                   ` Bill Gunshannon
2012-01-18 16:25       ` paramucho
2012-01-18 18:00         ` Johnny Billquist
2012-01-19 14:25           ` paramucho
2012-01-19 16:50             ` Johnny Billquist
2012-01-20 13:32               ` paramucho
2012-01-20 16:54                 ` Johnny Billquist
2012-01-21 13:16                   ` paramucho
2012-01-21 13:58                     ` Bob Eager
2012-01-21 20:02                     ` Johnny Billquist
2012-01-22 11:59                     ` Johnny Billquist
2012-01-22 14:03                       ` paramucho
2012-01-22 16:15                         ` Johnny Billquist
2012-01-23  4:14                           ` paramucho
2012-01-18 13:20     ` Bob Eager
2012-01-19 14:29       ` Bob Koehler
2012-01-21 12:44   ` Tim Shoppa
2012-01-21 13:50     ` paramucho
2012-01-22 16:56       ` Tim Shoppa
2012-01-22 18:11         ` glen herrmannsfeldt
2012-01-23  3:52         ` paramucho
2012-01-21 14:25     ` glen herrmannsfeldt
2012-01-21 16:46       ` Bob Eager
2012-01-25 22:12       ` Tim Shoppa
2012-01-26  3:22   ` Jerome H. Fine
2012-01-26 13:46     ` paramucho
2012-01-29  1:34       ` Jerome H. Fine
2012-01-29 15:46         ` paramucho
2012-02-01  3:53           ` Jerome H. Fine
2012-02-01 11:22             ` paramucho
2012-02-01 11:48               ` Johnny Billquist
2012-02-01 13:48                 ` paramucho
2012-02-01 14:43                   ` stan
2012-02-01 16:37                     ` paramucho
2012-02-01 18:05                       ` stan
2012-02-02  2:24                       ` Jerome H. Fine
2012-02-02  0:14                   ` Johnny Billquist
2012-02-02  2:25                     ` Jerome H. Fine
2012-02-02  9:29                       ` Johnny Billquist
2012-02-02 18:52                         ` glen herrmannsfeldt
2012-02-03  0:12                           ` Johnny Billquist
2012-02-03  4:07                           ` Jerome H. Fine
2012-02-03 14:15                             ` Johnny Billquist
2012-02-03 15:00                         ` paramucho
2012-02-02 13:31                     ` paramucho
2012-02-02 19:07                       ` glen herrmannsfeldt
2012-02-03  0:16                         ` Johnny Billquist
2012-02-03  4:23                           ` glen herrmannsfeldt
2012-02-03 12:01                             ` Johnny Billquist
2012-02-03 15:36                           ` Joe Oswald
2012-02-07 10:46                             ` Johnny Billquist
2012-02-03  4:29                         ` Jerome H. Fine
2012-02-03 12:50                           ` Bill Gunshannon
2012-02-04  8:42                             ` Charles Richmond
2012-02-04 13:38                               ` paramucho
2012-02-04 16:03                                 ` Bill Gunshannon
2012-02-04 16:39                                   ` paramucho
2012-02-03 10:48                         ` paramucho
2012-02-03 11:24                       ` Johnny Billquist
2012-02-04 17:06                         ` paramucho
2012-02-04 18:22                           ` paramucho
2012-02-04 18:55                             ` Johnny Billquist
2012-02-04 19:13                               ` Bill Gunshannon
2012-02-05 13:28                                 ` Johnny Billquist
2012-02-05 18:15                                   ` glen herrmannsfeldt
2012-02-04 18:51                           ` Johnny Billquist
2012-02-04 23:09                             ` glen herrmannsfeldt
2012-02-05 14:01                               ` paramucho
2012-02-05 15:31                                 ` Johnny Billquist
2012-02-06 13:50                                   ` paramucho
2012-02-06 14:45                                     ` Johnny Billquist
2012-02-06 14:58                                       ` paramucho
2012-02-06 16:25                                         ` Johnny Billquist
2012-02-05 14:27                               ` Johnny Billquist
2012-02-05 13:57                             ` paramucho
2012-02-05 15:44                               ` Johnny Billquist
2012-02-06 13:51                                 ` paramucho
2012-02-06 14:56                                   ` Johnny Billquist
2012-02-06 16:40                                     ` Johnny Billquist
2012-02-07 14:50                                       ` paramucho
2012-02-07 16:20                                         ` Johnny Billquist
2012-02-08 13:34                                           ` paramucho
2012-02-08 16:03                                             ` Johnny Billquist
2012-02-08 16:58                                               ` paramucho
2012-02-08 22:29                                                 ` Johnny Billquist
2012-02-10 13:12                                                   ` paramucho
2012-02-10 19:20                                                     ` glen herrmannsfeldt
2012-02-11 13:12                                                       ` paramucho
2012-02-11 20:06                                                         ` glen herrmannsfeldt
2012-02-11 20:23                                                         ` Johnny Billquist
2012-02-10 19:29                                                     ` Johnny Billquist
2012-02-11 13:15                                                       ` paramucho
2012-02-11 21:09                                                         ` Johnny Billquist
2012-02-12 17:23                                                           ` paramucho
2012-02-12 18:35                                                             ` paramucho
2012-02-13 17:30                                                               ` paramucho
2012-02-14 13:14                                                               ` Johnny Billquist
2012-02-14 16:20                                                                 ` paramucho
2012-02-14 17:30                                                                   ` Johnny Billquist
2012-02-13 23:18                                                             ` Johnny Billquist
2012-02-14 16:20                                                               ` paramucho
2012-02-14 17:47                                                                 ` Johnny Billquist
2012-02-14 18:17                                                                   ` paramucho
2012-02-14 19:54                                                                     ` Johnny Billquist [this message]
2012-02-15 12:58                                                                       ` paramucho
2012-02-15 17:12                                                                         ` Johnny Billquist
2012-02-16 13:54                                                                           ` paramucho
2012-02-16 20:15                                                                             ` Johnny Billquist
2012-02-17 12:41                                                                               ` paramucho
2012-02-17 17:13                                                                                 ` Johnny Billquist
2012-02-18 11:24                                                                                   ` Johnny Billquist
2012-02-18 14:28                                                                                     ` paramucho
2012-02-18 20:07                                                                                       ` Johnny Billquist
2012-02-18 11:55                                                                                   ` paramucho
2012-02-18 20:58                                                                                     ` Johnny Billquist
2012-02-20  2:29                                                                                       ` Jerome H. Fine
2012-02-20  5:54                                                                                         ` paramucho
2012-02-20 17:14                                                                                           ` Jerome H. Fine
2012-02-20 18:05                                                                                             ` Johnny Billquist
2012-02-21  6:16                                                                                               ` paramucho
2012-02-21 17:38                                                                                               ` Jerome H. Fine
2012-02-21 19:31                                                                                                 ` Johnny Billquist
2012-02-20  5:53                                                                                       ` paramucho
2012-02-20 10:28                                                                                         ` Johnny Billquist
2012-02-21  3:33                                                                                           ` Jerome H. Fine
2012-02-21  6:17                                                                                           ` paramucho
2012-02-21 10:23                                                                                             ` Johnny Billquist
2012-02-21 11:37                                                                                               ` paramucho
2012-02-21 14:16                                                                                                 ` Johnny Billquist
2012-02-21 16:42                                                                                                   ` paramucho
2012-02-21 19:43                                                                                                     ` Johnny Billquist
2012-02-22 12:21                                                                                                       ` paramucho
2012-02-22 14:12                                                                                                         ` paramucho
2012-02-22 15:26                                                                                                         ` Johnny Billquist
2012-02-22 14:33                                                                                                       ` paramucho
2012-02-22 15:53                                                                                                         ` Johnny Billquist
2012-02-22 16:48                                                                                                           ` paramucho
2012-02-22 21:17                                                                                                             ` Johnny Billquist
2012-02-23 12:42                                                                                                               ` paramucho
2012-02-23 13:51                                                                                                                 ` paramucho
2012-02-23 15:17                                                                                                                 ` Johnny Billquist
2012-02-20  2:22                                                                                   ` Jerome H. Fine
2012-02-20  6:07                                                                                     ` paramucho
2012-02-21  3:29                                                                                       ` Jerome H. Fine
2012-02-21  8:06                                                                                         ` paramucho
2012-02-21 10:38                                                                                           ` Johnny Billquist
2012-02-21 11:54                                                                                             ` paramucho
2012-02-21 14:20                                                                                               ` Johnny Billquist
2012-02-21 15:13                                                                                                 ` paramucho
2012-02-21 15:20                                                                                                   ` Johnny Billquist
2012-02-22  2:51                                                                                           ` Jerome H. Fine
2012-02-22  6:37                                                                                             ` paramucho
2012-01-18 11:20 ` Johnny Billquist
2012-01-26  3:21   ` Jerome H. Fine
2012-01-26 14:12     ` Johnny Billquist
2012-01-26 15:26       ` paramucho
2012-01-29  1:41         ` Jerome H. Fine
2012-01-29  2:04           ` Johnny Billquist
2012-01-29  2:31             ` Johnny Billquist
2012-01-29  1:39       ` Jerome H. Fine
2012-01-29  1:45         ` Johnny Billquist
2012-01-30  2:21 ` Bob Supnik
2012-01-31  7:14   ` paramucho
2012-01-31  9:42     ` Johnny Billquist
2012-01-31 14:24       ` Bill Gunshannon
2012-01-31 20:17         ` Johnny Billquist
2012-01-31 21:39           ` Bill Gunshannon
2012-01-31 23:43             ` glen herrmannsfeldt
2012-02-01  3:56             ` Jerome H. Fine
2012-02-01 11:53               ` Johnny Billquist
2012-02-01 13:48                 ` paramucho
2012-02-02  0:20                   ` Johnny Billquist
2012-02-02  2:22                 ` Jerome H. Fine
2012-02-01 12:14             ` Johnny Billquist
2012-02-01 16:27               ` glen herrmannsfeldt
2012-02-01  5:28         ` Charles Richmond
2012-02-01 11:54           ` Johnny Billquist
2012-02-01  3:55       ` Jerome H. Fine
2012-02-01 11:22       ` paramucho
2012-02-01 12:03         ` Johnny Billquist
2012-02-01  3:54   ` Jerome H. Fine
2012-02-01 12:09     ` Johnny Billquist
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox