x86/cpuid: Perform max_leaf calculations in guest_cpuid()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 11 Jan 2017 11:59:02 +0000 (11:59 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 11 Jan 2017 11:59:02 +0000 (11:59 +0000)
commit1c0bc709d82afa84f7d67b9995f79c3c4b690735
treefae9a10198493ea3dc9b2402d3d177b43e7a588c
parent9e9e2101cfea47b0392e2034038cbd2284528ab4
x86/cpuid: Perform max_leaf calculations in guest_cpuid()

Clamp the toolstack-providied max_leaf values in recalculate_cpuid_policy(),
causing the per-domain policy to have guest-accurate data.

Have guest_cpuid() exit early if a requested leaf is out of range, rather than
falling into the legacy path.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpuid.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/traps.c
xen/include/asm-x86/cpuid.h