Drop the completely asinine and *extremely* confusing VMLOAD and VMSAVE usage around VMRUN, as loading and saving _just_ guest state is both unnecessary and dangerous. E.g. GS.base, which KUT uses for per-CPU data, is handled by VMLOAD/VMSAVE, and so loading guest state before VMRUN without loading host state after #VMEXIT is wildly broken. The only reason the code "works" is because all relevant host state is copied verbatim into the guest's save area, i.e. the host and guest use the same state. Double-down on sharing state between host and guest as a proper fix is much more involved and delicate, e.g. would require ensuring GS.base is loaded with the host's value prior to swapping GPRs (which are per-CPU). Signed-off-by: Sean Christopherson --- x86/svm.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x86/svm.h b/x86/svm.h index 4e7e9e7a..21b3ac99 100644 --- a/x86/svm.h +++ b/x86/svm.h @@ -435,7 +435,6 @@ static inline void clgi(void) } #define ASM_PRE_VMRUN_CMD \ - "vmload %%rax\n\t" \ "mov " GUEST_REG(rflags) ", %%r15\n\t" \ "mov %%r15, 0x170(%%rax)\n\t" \ "mov " GUEST_REG(rax) ", %%r15\n\t" \ @@ -448,9 +447,6 @@ static inline void clgi(void) "mov %%r15, " GUEST_REG(rflags) "\n\t" \ "mov 0x1f8(%%rax), %%r15\n\t" \ "mov %%r15, " GUEST_REG(rax)"\n\t" \ - "vmsave %%rax\n\t" \ - - #define SVM_BARE_VMRUN \ asm volatile ( \ -- 2.54.0.563.g4f69b47b94-goog