aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/traps.c
diff options
context:
space:
mode:
authorShan Haitao <haitao.shan@intel.com>2011-10-13 15:58:55 +0100
committerShan Haitao <haitao.shan@intel.com>2011-10-13 15:58:55 +0100
commit654ef0997984ce77544ddac7dcdb150e1f63e505 (patch)
tree0e3d48422702cd52c46dc21a8a8d94358ad2c49b /xen/arch/x86/traps.c
parente2f608687690c28fba52eb78cede62e516b1d26d (diff)
downloadxen-654ef0997984ce77544ddac7dcdb150e1f63e505.tar.gz
xen-654ef0997984ce77544ddac7dcdb150e1f63e505.tar.bz2
xen-654ef0997984ce77544ddac7dcdb150e1f63e505.zip
x86: Further fixes for xsave leaf in pv_cpuid().
Signed-off-by: Shan Haitao <haitao.shan@intel.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/traps.c')
-rw-r--r--xen/arch/x86/traps.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e22e6d86fc..eecdb4d201 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -768,16 +768,18 @@ static void pv_cpuid(struct cpu_user_regs *regs)
if ( current->domain->domain_id != 0 )
{
+ unsigned int cpuid_leaf = a, sub_leaf = c;
+
if ( !cpuid_hypervisor_leaves(a, c, &a, &b, &c, &d) )
domain_cpuid(current->domain, a, c, &a, &b, &c, &d);
- switch ( a )
+ switch ( cpuid_leaf )
{
case 0xd:
{
- unsigned int sub_leaf, _eax, _ebx, _ecx, _edx;
+ unsigned int _eax, _ebx, _ecx, _edx;
/* EBX value of main leaf 0 depends on enabled xsave features */
- if ( c == 0 && current->arch.xcr0 )
+ if ( sub_leaf == 0 && current->arch.xcr0 )
{
/* reset EBX to default value first */
b = XSTATE_AREA_MIN_SIZE;
@@ -785,8 +787,8 @@ static void pv_cpuid(struct cpu_user_regs *regs)
{
if ( !(current->arch.xcr0 & (1ULL << sub_leaf)) )
continue;
- domain_cpuid(current->domain, a, c, &_eax, &_ebx, &_ecx,
- &_edx);
+ domain_cpuid(current->domain, cpuid_leaf, sub_leaf,
+ &_eax, &_ebx, &_ecx, &_edx);
if ( (_eax + _ebx) > b )
b = _eax + _ebx;
}