• Sean Christopherson's avatar
    KVM: x86: Remove defunct setting of XCR0 for guest during vCPU create · e8f65b9b
    Sean Christopherson authored
    Drop code to initialize XCR0 during fx_init(), a.k.a. vCPU creation, as
    XCR0 has been initialized during kvm_vcpu_reset() (for RESET) since
    commit a554d207 ("KVM: X86: Processor States following Reset or INIT").
    
    Back when XCR0 support was added by commit 2acf923e ("KVM: VMX:
    Enable XSAVE/XRSTOR for guest"), KVM didn't differentiate between RESET
    and INIT.  Ignoring the fact that calling fx_init() for INIT is obviously
    wrong, e.g. FPU state after INIT is not the same as after RESET, setting
    XCR0 in fx_init() was correct.
    
    Eventually fx_init() got moved to kvm_arch_vcpu_init(), a.k.a. vCPU
    creation (ignore the terrible name) by commit 0ee6a517 ("x86/fpu,
    kvm: Simplify fx_init()").  Finally, commit 95a0d01e ("KVM: x86: Move
    all vcpu init code into kvm_arch_vcpu_create()") killed off
    kvm_arch_vcpu_init(), leaving behind the oddity of redundant setting of
    guest state during vCPU creation.
    
    No functional change intended.
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Message-Id: <20210921000303.400537-6-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e8f65b9b
x86.c 324 KB