]> xenbits.xensource.com Git - xen.git/commit
x86/HVM: correct CPUID leaf 80000008 handling
authorJan Beulich <jbeulich@suse.com>
Fri, 28 Mar 2014 12:33:34 +0000 (13:33 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 28 Mar 2014 12:33:34 +0000 (13:33 +0100)
commitef437690af8b75e6758dce77af75a22b63982883
tree3aba0bcc5abea8cfe6e589dc772b9332c752e611
parent8bad6c5626129ffba04dbab3a38115b6f3669596
x86/HVM: correct CPUID leaf 80000008 handling

CPUID[80000008].EAX[23:16] have been given the meaning of the guest
physical address restriction (in case it needs to be smaller than the
host's), hence we need to mirror that into vCPUID[80000008].EAX[7:0].

Enforce a lower limit at the same time, as well as a fixed value for
the virtual address bits, and zero for the guest physical address ones.

In order for the vMTRR code to see these overrides we need to make it
call hvm_cpuid() instead of domain_cpuid(), which in turn requires
special casing (and relaxing) the controlling domain.

This additionally should hide an ordering problem in the tools: Both
xend and xl appear to be restoring a guest from its image before
setting up the CPUID policy in the hypervisor, resulting in
domain_cpuid() returning all zeros and hence the check in
mtrr_var_range_msr_set() failing if the guest previously had more than
the minimum 36 physical address bits.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/mtrr.c