summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/svm
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-07-13 09:33:14 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-08-02 11:01:57 -0400
commitf39e805ee115a67878c5475f1ef84466d424bb2e (patch)
tree6562d34ce21338007033b99757aa78f878bfebc7 /arch/x86/kvm/svm
parentc5c9f920f7a50ea205c9efec7e589556ebaf85dc (diff)
KVM: x86: Move setting of sregs during vCPU RESET/INIT to common x86
Move the setting of CR0, CR4, EFER, RFLAGS, and RIP from vendor code to common x86. VMX and SVM now have near-identical sequences, the only difference being that VMX updates the exception bitmap. Updating the bitmap on SVM is unnecessary, but benign. Unfortunately it can't be left behind in VMX due to the need to update exception intercepts after the control registers are set. Reviewed-by: Reiji Watanabe <reijiw@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210713163324.627647-37-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm')
-rw-r--r--arch/x86/kvm/svm/svm.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 64563f876fdf..8ebdcd92007d 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -1249,12 +1249,6 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
init_sys_seg(&save->ldtr, SEG_TYPE_LDT);
init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16);
- svm_set_cr0(vcpu, X86_CR0_NW | X86_CR0_CD | X86_CR0_ET);
- svm_set_cr4(vcpu, 0);
- svm_set_efer(vcpu, 0);
- kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);
- vcpu->arch.regs[VCPU_REGS_RIP] = 0x0000fff0;
-
if (npt_enabled) {
/* Setup VMCB for Nested Paging */
control->nested_ctl |= SVM_NESTED_CTL_NP_ENABLE;