|
@@ -511,8 +511,10 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
|
|
{
|
|
{
|
|
struct vcpu_svm *svm = to_svm(vcpu);
|
|
struct vcpu_svm *svm = to_svm(vcpu);
|
|
|
|
|
|
- if (svm->vmcb->control.next_rip != 0)
|
|
|
|
|
|
+ if (svm->vmcb->control.next_rip != 0) {
|
|
|
|
+ WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS));
|
|
svm->next_rip = svm->vmcb->control.next_rip;
|
|
svm->next_rip = svm->vmcb->control.next_rip;
|
|
|
|
+ }
|
|
|
|
|
|
if (!svm->next_rip) {
|
|
if (!svm->next_rip) {
|
|
if (emulate_instruction(vcpu, EMULTYPE_SKIP) !=
|
|
if (emulate_instruction(vcpu, EMULTYPE_SKIP) !=
|
|
@@ -4329,7 +4331,9 @@ static int svm_check_intercept(struct kvm_vcpu *vcpu,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- vmcb->control.next_rip = info->next_rip;
|
|
|
|
|
|
+ /* TODO: Advertise NRIPS to guest hypervisor unconditionally */
|
|
|
|
+ if (static_cpu_has(X86_FEATURE_NRIPS))
|
|
|
|
+ vmcb->control.next_rip = info->next_rip;
|
|
vmcb->control.exit_code = icpt_info.exit_code;
|
|
vmcb->control.exit_code = icpt_info.exit_code;
|
|
vmexit = nested_svm_exit_handled(svm);
|
|
vmexit = nested_svm_exit_handled(svm);
|
|
|
|
|