Zachary Amsden
2007-Apr-18 13:02 UTC
[PATCH 0/21] Descriptor table fixes / cleanup for i386
Patches to clean up descriptor access in Linux to make it friendly to virtualization environments. The basic problem is that the GDT must be write protected, which causes spurious overhead when the GDT lies on the same page as other data. This problem exists both for VMware and Xen; Xen actually requires page isolation, so we have implemented the most general and compatible solution. While VMware suffers only from false sharing, Xen suffers from the false-validation problem, which requires the extra space for the GDT page to be zeroed. The GDTs for secondary processors are allocated dynamically to avoid bloating kernel static data with GDTs for not-present processors. Along the way, I discovered two serious but subtle problems; there was no consistent mechanism for converting an EIP to a linear address, which presented a serious challenge for the kprobes code, since the LDT is protected by a semaphore which must be acquired in user context, with interrupts enabled. The second problem was that %fs, and %gs could end up loaded with bad cached values after a PnP or APM BIOS call. Many other small enhancements to readability, compactness, correctness, and overall goodness were discovered along the way. The core piece of these patches is getting the GDT page aligned; I wil rework or deprecate any other pieces of this that are not wanted / unnecessary / (hopefully not) buggy. Testing: 4 way SMP boot-halts, kernel compiles, stress, UML, LDT test suites, insane cross-modifying code for breakpoint testing. Zachary Amsden <zach@vmware.com>
* Zachary Amsden <zach@vmware.com> wrote:> Patches to clean up descriptor access in Linux to make it friendly to > virtualization environments. [...]in general these patches look really nice and are a good step forward making the i386 arch's segment handling code more unified. Needs good -mm exposure first i think. Ingo
* Zachary Amsden (zach@vmware.com) wrote:> The core piece of these patches is getting the GDT page aligned; > I wil rework or deprecate any other pieces of this that are not > wanted / unnecessary / (hopefully not) buggy.Rats, I knew this was brewing. I was about 80% of the way through rebasing the last set to current git, but there's much redundancy and clashing. This set looks a bit nicer than the last one, so I'll rather go through this one carefully. Not until after some sleep though. thanks, -chris