Skip to contentSkip to conversation

enable SVM EFER bit

PATCH In review Alexander Graf 3 participants 5 messages Jun 3, 2008 – Jun 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enable SVM EFER bit

Due to the recently introduces checks for SVM activation, the SVM instructions currently throw a #UD exception if they are not activated. The activation happens through a write to the EFER which does not support the SVM bit yet.

This patch adds the SVME bit to the EFER MSR write. It makes KVM work for me again.

Alex

op_helper.c +2 -0
Index: target-i386/op_helper.c
===================================================================
@@ -3069,6 +3069,8 @@
                 update_mask |= MSR_EFER_FFXSR;
             if (env->cpuid_ext2_features & CPUID_EXT2_NX)
                 update_mask |= MSR_EFER_NXE;
+            if (env->cpuid_ext3_features & CPUID_EXT3_SVM)
+                update_mask |= MSR_EFER_SVME;
             env->efer = (env->efer & ~update_mask) |
             (val & update_mask);
         }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Alexander Graf

Due to the recently introduces checks for SVM activation, the SVM instructions currently throw a #UD exception if they are not activated. The activation happens through a write to the EFER which does not support the SVM bit yet.

This patch adds the SVME bit to the EFER MSR write. It makes KVM work for me again.

Regards,

Anthony Liguori

Quoted 4 lines

Alex

#2 lore raw
In reply to Alexander Graf
Quoted 3 lines · Alexander Graf

Due to the recently introduces checks for SVM activation, the SVM instructions currently throw a #UD exception if they are not activated. The activation happens through a write to the EFER which does not support the SVM bit yet.

This patch adds the SVME bit to the EFER MSR write. It makes KVM work for me again.

OK for the problem, but the fix is not OK because you don't synchronize the hflags. It is strange that SVM can even work with that... I am working on a better fix.

Fabrice.

#3 lore raw
Quoted 5 lines · Fabrice Bellard
Quoted 2 lines · Alexander Graf

Due to the recently introduces checks for SVM activation, the SVM instructions currently throw a #UD exception if they are not activated. The activation happens through a write to the EFER which does not support the SVM bit yet. This patch adds the SVME bit to the EFER MSR write. It makes KVM work for me again.

OK for the problem, but the fix is not OK because you don't synchronize the hflags. It is strange that SVM can even work with that... I am working on a better fix.

a write to MSR_EFER calls cpu_load_efer() which updates the hflags.

Alex

#4 lore raw
In reply to Fabrice Bellard
Quoted 5 lines · Fabrice Bellard
Quoted 2 lines · Alexander Graf

Due to the recently introduces checks for SVM activation, the SVM instructions currently throw a #UD exception if they are not activated. The activation happens through a write to the EFER which does not support the SVM bit yet. This patch adds the SVME bit to the EFER MSR write. It makes KVM work for me again.

OK for the problem, but the fix is not OK because you don't synchronize the hflags. It is strange that SVM can even work with that... I am working on a better fix.

Wow I should probably not look at your fixed code when replying :-). You're just too fast for me.

Alex