KVM: x86: Add a return value to kvm_emulate_cpuid
Once skipping the emulated instruction can potentially trigger an exit to userspace (via KVM_GUESTDBG_SINGLESTEP) kvm_emulate_cpuid will need to propagate a return value. Signed-off-by: Kyle Huey <khuey@kylehuey.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:

zatwierdzone przez
Paolo Bonzini

rodzic
57d1da871b
commit
6a908b628c
@@ -879,7 +879,7 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_cpuid);
|
||||
|
||||
void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
|
||||
int kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
u32 eax, ebx, ecx, edx;
|
||||
|
||||
@@ -891,5 +891,6 @@ void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
|
||||
kvm_register_write(vcpu, VCPU_REGS_RCX, ecx);
|
||||
kvm_register_write(vcpu, VCPU_REGS_RDX, edx);
|
||||
kvm_x86_ops->skip_emulated_instruction(vcpu);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_emulate_cpuid);
|
||||
|
@@ -3239,8 +3239,7 @@ static int task_switch_interception(struct vcpu_svm *svm)
|
||||
static int cpuid_interception(struct vcpu_svm *svm)
|
||||
{
|
||||
svm->next_rip = kvm_rip_read(&svm->vcpu) + 2;
|
||||
kvm_emulate_cpuid(&svm->vcpu);
|
||||
return 1;
|
||||
return kvm_emulate_cpuid(&svm->vcpu);
|
||||
}
|
||||
|
||||
static int iret_interception(struct vcpu_svm *svm)
|
||||
|
@@ -5837,8 +5837,7 @@ static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val)
|
||||
|
||||
static int handle_cpuid(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
kvm_emulate_cpuid(vcpu);
|
||||
return 1;
|
||||
return kvm_emulate_cpuid(vcpu);
|
||||
}
|
||||
|
||||
static int handle_rdmsr(struct kvm_vcpu *vcpu)
|
||||
|
Reference in New Issue
Block a user