x86/pv: Break handle_ldt_mapping_fault() out of handle_gdt_ldt_mapping_fault()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Oct 2017 15:21:46 +0000 (16:21 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 19 Jan 2018 18:16:14 +0000 (18:16 +0000)
commit3fa1b35d785eb80103d185a59d50f238515d2427
treeb23240d15018061ecc80b333c68a3da19c5d5862
parent634afe43ac703fb04d398f1b90839c7503fabcb4
x86/pv: Break handle_ldt_mapping_fault() out of handle_gdt_ldt_mapping_fault()

Adjust handle_ldt_mapping_fault() exclude the use of this fixup path for
non-PV guests.  Well-formed code shouldn't reference the LDT while in HVM vcpu
context, but currently on a context switch from PV to HVM context, there may
be a stale LDT selector loaded, over an unmapped region.

By explicitly excluding HVM context at this point, we avoid erroneous
hypervisor execution resulting in a cascade failure, by falling into
pv_map_ldt_shadow_page().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/traps.c