* [uml-devel] uml-general-protection-fault even more kludgy but mergeable
@ 2005-05-16 22:05 Blaisorblade
2005-05-17 10:03 ` [uml-devel] " Gerd Knorr
0 siblings, 1 reply; 4+ messages in thread
From: Blaisorblade @ 2005-05-16 22:05 UTC (permalink / raw)
To: Gerd Knorr, Jeff Dike; +Cc: user-mode-linux-devel
About 2.6.11-rc4/uml-general-protection-fault:
Ok, today I was looking a bit more to this patch and I even looked in the
Intel manuals.
I effectively verified that, in case of a page fault (do_page_fault) the
kernel only sends a SIGSEGV to the process if (error_code & 4 != 0), as
expected.
So, if (!(error_code & 4)), we cannot be handling a page fault at all.
However, the comment in the patch is a bit misleading (or misleaded) because
error_code has a different format for everything else than protection faults.
(See section 5.13, Error code, of manual "Intel System Programming Guide -
253668 -15.pdf", order number 253668-15).
In that case, in fact, it will be unused (and hence, probably, set to 0) when
the error code references the IDT descriptor, it will be clear when the GDT
is referenced, it will be set when the LDT is referenced (always by the error
code).
So, in practice, it's correct to call bad_segv() as done in the patch, but we
miss some cases. Only this time I've verified this well enough that I feel we
could merge your patch. However, I've not found any possible *realistic*
source of general protection faults. Especially I didn't find what expected
(i.e. I/O errors).
--
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [uml-devel] Re: uml-general-protection-fault even more kludgy but mergeable
2005-05-16 22:05 [uml-devel] uml-general-protection-fault even more kludgy but mergeable Blaisorblade
@ 2005-05-17 10:03 ` Gerd Knorr
2005-05-17 10:24 ` Bodo Stroesser
0 siblings, 1 reply; 4+ messages in thread
From: Gerd Knorr @ 2005-05-17 10:03 UTC (permalink / raw)
To: Blaisorblade; +Cc: Jeff Dike, user-mode-linux-devel
> So, in practice, it's correct to call bad_segv() as done in the patch, but we
> miss some cases. Only this time I've verified this well enough that I feel we
> could merge your patch. However, I've not found any possible *realistic*
> source of general protection faults. Especially I didn't find what expected
> (i.e. I/O errors).
The case I trapped into was an attempt to access I/O ports of a
process running inside the uml. The uml kernel then tried to
handle that as page fault, which didn't work very well ...
Gerd
--
-mm seems unusually stable at present.
-- akpm about 2.6.12-rc3-mm3
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [uml-devel] Re: uml-general-protection-fault even more kludgy but mergeable
2005-05-17 10:03 ` [uml-devel] " Gerd Knorr
@ 2005-05-17 10:24 ` Bodo Stroesser
2005-05-17 10:59 ` Gerd Knorr
0 siblings, 1 reply; 4+ messages in thread
From: Bodo Stroesser @ 2005-05-17 10:24 UTC (permalink / raw)
To: Gerd Knorr; +Cc: Blaisorblade, Jeff Dike, user-mode-linux-devel
Gerd Knorr wrote:
>>So, in practice, it's correct to call bad_segv() as done in the patch, but we
>>miss some cases. Only this time I've verified this well enough that I feel we
>>could merge your patch. However, I've not found any possible *realistic*
>>source of general protection faults. Especially I didn't find what expected
>>(i.e. I/O errors).
>
>
> The case I trapped into was an attempt to access I/O ports of a
> process running inside the uml. The uml kernel then tried to
> handle that as page fault, which didn't work very well ...
>
> Gerd
>
Unfortunately, I can't find the previous mails about this. So, maybe I'm
totally wrong. If so, please discard this mail.
Gerd, did you see the problem in SKAS3 on i386? If so, it would be nice to
see what happens in SKAS0.
I saw similar problems regarding bad LDT-descriptors. Processes using a bad
descriptor loop on page_fault.
The real fix for this is to add trap_no to the info, that is read from host
by PTRACE_FAULTINFO. With this info, UML can distinguish between real page
faults and other SIGSEGVs.
In SKAS0, UML already has the full info, as it retrieves the info from a
sigcontext.
Regards,
Bodo
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [uml-devel] Re: uml-general-protection-fault even more kludgy but mergeable
2005-05-17 10:24 ` Bodo Stroesser
@ 2005-05-17 10:59 ` Gerd Knorr
0 siblings, 0 replies; 4+ messages in thread
From: Gerd Knorr @ 2005-05-17 10:59 UTC (permalink / raw)
To: Bodo Stroesser; +Cc: Blaisorblade, Jeff Dike, user-mode-linux-devel
> >The case I trapped into was an attempt to access I/O ports of a
> >process running inside the uml. The uml kernel then tried to
> >handle that as page fault, which didn't work very well ...
> Unfortunately, I can't find the previous mails about this. So, maybe I'm
> totally wrong. If so, please discard this mail.
Yes, was discussed quite some time ago, more than half a year
IIRC.
> Gerd, did you see the problem in SKAS3 on i386? If so, it would be nice to
> see what happens in SKAS0.
Not tested yet.
> I saw similar problems regarding bad LDT-descriptors. Processes using a bad
> descriptor loop on page_fault.
>
> The real fix for this is to add trap_no to the info, that is read from host
> by PTRACE_FAULTINFO. With this info, UML can distinguish between real page
> faults and other SIGSEGVs.
Yes, that conclusion we came to as well, the real fix would be
pass on trap_no. The patch mentioned in $subject is a band-aid
fix to deal with it a bit better without having the trap number.
> In SKAS0, UML already has the full info, as it retrieves the info from a
> sigcontext.
Then skas0 should do fine in theory ;)
Gerd
--
-mm seems unusually stable at present.
-- akpm about 2.6.12-rc3-mm3
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-17 11:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-16 22:05 [uml-devel] uml-general-protection-fault even more kludgy but mergeable Blaisorblade
2005-05-17 10:03 ` [uml-devel] " Gerd Knorr
2005-05-17 10:24 ` Bodo Stroesser
2005-05-17 10:59 ` Gerd Knorr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.