x86/ldt: Alter how invalidate_shadow_ldt() deals with TLB flushes
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 2 Oct 2017 14:13:38 +0000 (14:13 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Dec 2017 19:03:26 +0000 (19:03 +0000)
commitbfa83bbc3385bab0bfee3c7f408c164c5584e688
tree97ef3432e8bfb01de12813a1e30d8892124aa04d
parent1a8210c52a50ea518605f244fe235afbd6078122
x86/ldt: Alter how invalidate_shadow_ldt() deals with TLB flushes

Modify invalidate_shadow_ldt() to return a boolean indicating whether mappings
have been dropped, rather than taking a flush parameter.  Tweak the internal
logic to be able to ASSERT() that v->arch.pv_vcpu.shadow_ldt_mapcnt matches
the number of PTEs removed.

This allows MMUEXTOP_SET_LDT to avoid a local TLB flush if no LDT entries had
been faulted in to begin with.

Finally, correct a comment in __get_page_type().  Under no circumstance is it
safe to forgo the TLB shootdown for GDT/LDT pages, as that would allow one
vcpu to gain a writeable mapping to a frame still mapped as a GDT/LDT by
another vcpu.

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