Skip to contentSkip to conversation

KVM: SVM: Don't set GIF when clearing EFER.SVME

PATCH In review Jim Mattson 2 participants 2 messages Oct 7, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: SVM: Don't set GIF when clearing EFER.SVME

Clearing EFER.SVME is not architected to set GIF. Don't set GIF when emulating a change to EFER that clears EFER.SVME.

This is covered in the discussion at
https://lore.kernel.org/all/[email protected]/.

Fixes c513f484c558 ("KVM: nSVM: leave guest mode when clearing EFER.SVME")
---
 arch/x86/kvm/svm/svm.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/svm/svm.c +0 -1
index 3a9fe0a8b78c..5387851a96da 100644
@@ -223,7 +223,6 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
 	if ((old_efer & EFER_SVME) != (efer & EFER_SVME)) {
 		if (!(efer & EFER_SVME)) {
 			svm_leave_nested(vcpu);
-			svm_set_gif(svm, true);
 			/* #GP intercept is still needed for vmware backdoor */
 			if (!enable_vmware_backdoor)
 				clr_exception_intercept(svm, GP_VECTOR);
Signature · 1 line
2.51.0.710.ga91ca5db03-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jim Mattson

Clearing EFER.SVME is not architected to set GIF. Don't set GIF when emulating a change to EFER that clears EFER.SVME.

This is covered in the discussion at
https://lore.kernel.org/all/[email protected]/.

Fixes c513f484c558 ("KVM: nSVM: leave guest mode when clearing EFER.SVME")
Quoted 19 lines
---
 arch/x86/kvm/svm/svm.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/svm/svm.c +0 -1
index 3a9fe0a8b78c..5387851a96da 100644
@@ -223,7 +223,6 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
 	if ((old_efer & EFER_SVME) != (efer & EFER_SVME)) {
 		if (!(efer & EFER_SVME)) {
 			svm_leave_nested(vcpu);
-			svm_set_gif(svm, true);
 			/* #GP intercept is still needed for vmware backdoor */
 			if (!enable_vmware_backdoor)
 				clr_exception_intercept(svm, GP_VECTOR);
Signature · 1 line
2.51.0.710.ga91ca5db03-goog