x86/vvmx: Simplify per-CPU memory allocations
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 27 Mar 2019 18:50:46 +0000 (18:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 13 May 2019 09:35:38 +0000 (10:35 +0100)
commite9986b0dd66608af54d03b1dc9facc80b162dbaa
tree852c240f0f5dc650d3b5b940f3f40c197654ef1e
parent5c8c0ae7c45ef45acde29638fa342c2d721ae70a
x86/vvmx: Simplify per-CPU memory allocations

 * Use XFREE() instead of opencoding it in nvmx_cpu_dead()
 * Avoid redundant evaluations of per_cpu()
 * Don't allocate vvmcs_buf at all if it isn't going to be used.  It is never
   touched on hardware lacking the VMCS Shadowing feature.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vvmx.c