]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commit
x86/viridian: flush remote tlbs by hypercall
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 26 Nov 2015 14:48:41 +0000 (15:48 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Nov 2015 14:48:41 +0000 (15:48 +0100)
commitb38d426ad09b3e142f474c1dadfd6d6903664a48
treedc85f0afcabb4063a504e235f3a9bf08e52369cc
parent713b7e4ef2aa4ec3ae697cde9c81d5a57548f9b1
x86/viridian: flush remote tlbs by hypercall

The Microsoft Hypervisor Top Level Functional Spec. (section 3.4) defines
two bits in CPUID leaf 0x40000004:EAX for the hypervisor to recommend
whether or not to issue a hypercall for local or remote TLB flush.

Whilst it's doubtful whether using a hypercall for local TLB flush would
be any more efficient than a specific INVLPG VMEXIT, a remote TLB flush
may well be more efficiently done. This is because the alternative
mechanism is to IPI all the vCPUs in question which (in the absence of
APIC virtualisation) will require emulation and scheduling of the vCPUs
only to have them immediately VMEXIT for local TLB flush.

This patch therefore adds a viridian option which, if selected, enables
the hypercall for remote TLB flush and implements it using ASID
invalidation for targetted vCPUs followed by an IPI only to the set of
CPUs that happened to be running a targetted vCPU (which may be the empty
set). The flush may be more severe than requested since the hypercall can
request flush only for a specific address space (CR3) but Xen neither
keeps a mapping of ASID to guest CR3 nor allows invalidation of a specific
ASID, but on a host with contended CPUs performance is still likely to
be better than a more specific flush using IPIs.

The implementation of the patch introduces per-vCPU viridian_init() and
viridian_deinit() functions to allow a scratch cpumask to be allocated.
This avoids needing to put this potentially large data structure on stack
during hypercall processing. It also modifies the hypercall input and
output bit-fields to allow a check for the 'fast' calling convention,
and a white-space fix in the definition of HVMPV_feature_mask (to remove
hard tabs).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
docs/man/xl.cfg.pod.5
tools/libxl/libxl_dom.c
tools/libxl/libxl_types.idl
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/viridian.c
xen/include/asm-x86/hvm/viridian.h
xen/include/asm-x86/perfc_defn.h
xen/include/public/hvm/params.h