This round attempts to conclude all of the LDT related cleanup with some finally nice looking LDT code, fixes for the UML build, a bugfix for really rather nasty kprobes problems, and the basic framework for an LDT test suite. It is really rather unfortunate that this code is so difficult to test, even with DOSemu and Wine, there are still very nasty corner cases here - anyone want an iret to 16-bit stack test?. I was going to attempt to clean up the math-emu code to make it use the nice new segment and descriptor table accessors, but it quickly became apparent that this would be a long, tedious, error prone process that would eventually result in the death of a large section of my brain. In addition, it is not very fun to test this on the actual hardware it is designed to run on (although I did manage to track down a 386 with detachable i387 coprocessor, the owner is not sure it still boots). Someday it would be nice to have an audit of this code; it appears to be riddled with bugs relating to segmentation, for example it assumes LDT segments on overrides, does not use the mm->context semaphore to protect LDT access, and generally looks scarily out of date in both function and appearance. I also have a makeover for the pgtable.h code. Splitting operations that write hardware page tables into the sub-arch layer was very ugly, hopefully this is a much cleaner approach. There really must be a way for a paravirtualized hypervisor to hook the page table updates, and this appears to be the cleanest solution so far. This patch set is based on 2.6.13-rc6 -mm1 broken out series. It applies and builds i386, x86_64, and um-i386 on 2.6.13-rc5. I've tested PAE and non-PAE SMP kernels and am working on an LDT test suite. Depends on the i386 cleanups, sub-arch movement, and LDT cleanups I've already sent out. -- Zachary Amsden <zach@vmware.com> Whee! Actually deliver the signal.
On Mon, Aug 15, 2005 at 03:58:09PM -0700, zach@vmware.com wrote:> I was going to attempt to clean up the math-emu code to make it use the > nice new segment and descriptor table accessors, but it quickly became > apparent that this would be a long, tedious, error prone process that > would eventually result in the death of a large section of my brain. > In addition, it is not very fun to test this on the actual hardware it > is designed to run on (although I did manage to track down a 386 with > detachable i387 coprocessor, the owner is not sure it still boots). > Someday it would be nice to have an audit of this code; it appears to > be riddled with bugs relating to segmentation, for example it assumes > LDT segments on overrides, does not use the mm->context semaphore to > protect LDT access, and generally looks scarily out of date in both > function and appearance.Perhaps the best would be to just remove it. Near all 386s should be far beyond their MTBF by now. Mark it CONFIG_BROKEN and if nobody complains for one or two releases remove it completely. The ugly verify_area 386 bugfix workaround code could go at the same time. -Andi
zach@vmware.com wrote:> This round attempts to conclude all of the LDT related cleanup with some > finally nice looking LDT code, fixes for the UML build, a bugfix for > really rather nasty kprobes problems, and the basic framework for an LDT > test suite. It is really rather unfortunate that this code is so > difficult to test, even with DOSemu and Wine, there are still very nasty > corner cases here - anyone want an iret to 16-bit stack test?. > > I was going to attempt to clean up the math-emu code to make it use the > nice new segment and descriptor table accessors, but it quickly became > apparent that this would be a long, tedious, error prone process that > would eventually result in the death of a large section of my brain. > In addition, it is not very fun to test this on the actual hardware it > is designed to run on (although I did manage to track down a 386 with > detachable i387 coprocessor, the owner is not sure it still boots). > Someday it would be nice to have an audit of this code; it appears to > be riddled with bugs relating to segmentation, for example it assumes > LDT segments on overrides, does not use the mm->context semaphore to > protect LDT access, and generally looks scarily out of date in both > function and appearance.If you really want to test the math emu code, you can hack check_x87 in head.S to always leave the fpu disabled. Then you can test it on any cpu, not just a 386. -- Brian Gerst
* zach@vmware.com (zach@vmware.com) wrote:> This patch set is based on 2.6.13-rc6 -mm1 broken out series. It applies > and builds i386, x86_64, and um-i386 on 2.6.13-rc5. I've tested PAE and > non-PAE SMP kernels and am working on an LDT test suite. Depends on > the i386 cleanups, sub-arch movement, and LDT cleanups I've already sent > out.I put these in the virt-2.6 git tree, with the one minor wrprotect macro change I mentioned. thanks, -chris