x86/vmx: make apic_access_mfn type-safe
authorPaul Durrant <pdurrant@amazon.com>
Fri, 24 Jan 2020 15:30:57 +0000 (15:30 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 25 Jan 2020 18:43:32 +0000 (18:43 +0000)
commit55eb0187a65a16acfa52917d924caf76cdfd07f3
treebe4a8956713b5e38babadd9671c73b4c9031ef9f
parent1e9bc407cf0732654916ca4311ca1972495d5cbe
x86/vmx: make apic_access_mfn type-safe

Use mfn_t rather than unsigned long.  Fix vmx_free_vlapic_mapping() to be
fully idempotent by avoiding a double free, but the sentinal needs to remain
as _mfn(0) to be safe even in the case that vmx_alloc_vlapic_mapping() hasn't
been called.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/mtrr.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vmx/vmcs.h