mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/vpmu: Add a cpuid function
Add a new function - do_cpuid - to the vpmu struct arch_vpmu_ops. This permits the vpmu to set specific bits in the cpuid for the hvm guest. Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Committed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
a13b23fffe
commit
3db3601531
4 files changed
+24
No files matched your search
@@ -1613,6 +1613,8 @@ static void vmx_cpuid_intercept(
|
||||
break;
|
||||
}
|
||||
|
||||
vpmu_do_cpuid(input, eax, ebx, ecx, edx);
|
||||
|
||||
HVMTRACE_5D (CPUID, input, *eax, *ebx, *ecx, *edx);
|
||||
}
|
||||
|
||||
|
||||
@@ -547,6 +547,12 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void core2_vpmu_do_cpuid(unsigned int input,
|
||||
unsigned int *eax, unsigned int *ebx,
|
||||
unsigned int *ecx, unsigned int *edx)
|
||||
{
|
||||
}
|
||||
|
||||
static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
|
||||
{
|
||||
struct vcpu *v = current;
|
||||
@@ -608,6 +614,7 @@ struct arch_vpmu_ops core2_vpmu_ops = {
|
||||
.do_wrmsr = core2_vpmu_do_wrmsr,
|
||||
.do_rdmsr = core2_vpmu_do_rdmsr,
|
||||
.do_interrupt = core2_vpmu_do_interrupt,
|
||||
.do_cpuid = core2_vpmu_do_cpuid,
|
||||
.arch_vpmu_destroy = core2_vpmu_destroy,
|
||||
.arch_vpmu_save = core2_vpmu_save,
|
||||
.arch_vpmu_load = core2_vpmu_load
|
||||
|
||||
@@ -62,6 +62,16 @@ int vpmu_do_interrupt(struct cpu_user_regs *regs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vpmu_do_cpuid(unsigned int input,
|
||||
unsigned int *eax, unsigned int *ebx,
|
||||
unsigned int *ecx, unsigned int *edx)
|
||||
{
|
||||
struct vpmu_struct *vpmu = vcpu_vpmu(current);
|
||||
|
||||
if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_cpuid )
|
||||
vpmu->arch_vpmu_ops->do_cpuid(input, eax, ebx, ecx, edx);
|
||||
}
|
||||
|
||||
void vpmu_save(struct vcpu *v)
|
||||
{
|
||||
struct vpmu_struct *vpmu = vcpu_vpmu(v);
|
||||
|
||||
@@ -40,6 +40,9 @@ struct arch_vpmu_ops {
|
||||
int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
|
||||
int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
|
||||
int (*do_interrupt)(struct cpu_user_regs *regs);
|
||||
void (*do_cpuid)(unsigned int input,
|
||||
unsigned int *eax, unsigned int *ebx,
|
||||
unsigned int *ecx, unsigned int *edx);
|
||||
void (*arch_vpmu_destroy)(struct vcpu *v);
|
||||
void (*arch_vpmu_save)(struct vcpu *v);
|
||||
void (*arch_vpmu_load)(struct vcpu *v);
|
||||
@@ -67,6 +70,8 @@ struct vpmu_struct {
|
||||
int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content);
|
||||
int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
|
||||
int vpmu_do_interrupt(struct cpu_user_regs *regs);
|
||||
void vpmu_do_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
|
||||
unsigned int *ecx, unsigned int *edx);
|
||||
void vpmu_initialise(struct vcpu *v);
|
||||
void vpmu_destroy(struct vcpu *v);
|
||||
void vpmu_save(struct vcpu *v);
|
||||
|
||||