x86: further CPUID handling adjustments

In particular for Dom0 we need to make sure to surface Spectre related
feature flags.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Jan Beulich committed 2018-04-18 16:53:40 +02:00
1 parent 9680710bed
commit 62b1879693
3 files changed
+11 -2

No files matched your search

+4
View File
@@ -3497,6 +3497,9 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
*ecx &= hvm_featureset[FEATURESET_7c0];
*edx |= cpufeat_mask(X86_FEATURE_STIBP);
*edx &= hvm_featureset[FEATURESET_7d0];
/* Don't expose HAP-only features to non-hap guests. */
if ( !hap_enabled(d) )
{
@@ -3654,6 +3657,7 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
hvm_cpuid(0x80000001, NULL, NULL, NULL, &_edx);
*eax |= (_edx & cpufeat_mask(X86_FEATURE_LM) ? vaddr_bits : 32) << 8;
*ebx |= cpufeat_mask(X86_FEATURE_IBPB);
*ebx &= hvm_featureset[FEATURESET_e8b];
break;
}
+6 -2
View File
@@ -1089,6 +1089,9 @@ void pv_cpuid(struct cpu_user_regs *regs)
c &= pv_featureset[FEATURESET_7c0];
d |= cpufeat_mask(X86_FEATURE_STIBP);
d &= pv_featureset[FEATURESET_7d0];
if ( !is_pvh_domain(currd) )
{
/*
@@ -1102,8 +1105,8 @@ void pv_cpuid(struct cpu_user_regs *regs)
}
}
else
b = c = 0;
a = d = 0;
b = c = d = 0;
a = 0;
break;
case XSTATE_CPUID:
@@ -1185,6 +1188,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
case 0x80000008:
a = paddr_bits | (vaddr_bits << 8);
b |= cpufeat_mask(X86_FEATURE_IBPB);
b &= pv_featureset[FEATURESET_e8b];
break;
+1
View File
@@ -16,6 +16,7 @@
#define FEATURESET_7c0 6 /* 0x00000007:0.ecx */
#define FEATURESET_e7d 7 /* 0x80000007.edx */
#define FEATURESET_e8b 8 /* 0x80000008.ebx */
#define FEATURESET_7d0 9 /* 0x00000007:0.edx */
#ifndef __ASSEMBLY__
#include <xen/types.h>
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.