mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
KVM: SVM: Fix wrong intercept masks on 32 bit
commit061e2fd168upstream. This patch makes KVM on 32 bit SVM working again by correcting the masks used for iret interception. With the wrong masks the upper 32 bits of the intercepts are masked out which leaves vmrun unintercepted. This is not legal on svm and the vmrun fails. Bug was introduced by commits95ba827313and3cfc3092. Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b0051893fd
commit
004ff730b8
@@ -2111,7 +2111,7 @@ static int cpuid_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
|
||||
static int iret_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
|
||||
{
|
||||
++svm->vcpu.stat.nmi_window_exits;
|
||||
svm->vmcb->control.intercept &= ~(1UL << INTERCEPT_IRET);
|
||||
svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_IRET);
|
||||
svm->vcpu.arch.hflags |= HF_IRET_MASK;
|
||||
return 1;
|
||||
}
|
||||
@@ -2506,7 +2506,7 @@ static void svm_inject_nmi(struct kvm_vcpu *vcpu)
|
||||
|
||||
svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI;
|
||||
vcpu->arch.hflags |= HF_NMI_MASK;
|
||||
svm->vmcb->control.intercept |= (1UL << INTERCEPT_IRET);
|
||||
svm->vmcb->control.intercept |= (1ULL << INTERCEPT_IRET);
|
||||
++vcpu->stat.nmi_injections;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user