uml-general-protection-fault even more kludgy but mergeable
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).
Signature · 18 lines
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 [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 5 lines
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
Signature · 13 lines
-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 [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 9 lines · Gerd Knorr
Quoted 1 line
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 6 lines
Quoted 3 lines
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.
Quoted 2 lines
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.
Quoted 6 lines
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_noto the info, that is read from host byPTRACE_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.
Quoted 2 lines
In SKAS0, UML already has the full info, as it retrieves the info from a sigcontext.
Then skas0 should do fine in theory ;)
Gerd
Signature · 13 lines
-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 [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel