diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2020-05-27 10:54:00 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-05-27 19:11:11 +0200 |
commit | 7d2e8748af62b0de7c7bbcb0d62f937e88fd7027 (patch) | |
tree | 0157925ff958df24f3d6f472f1182d54111617f4 /arch/x86/kvm/x86.c | |
parent | KVM: nSVM: leave ASID aside in copy_vmcb_control_area (diff) | |
download | linux-7d2e8748af62b0de7c7bbcb0d62f937e88fd7027.tar.xz linux-7d2e8748af62b0de7c7bbcb0d62f937e88fd7027.zip |
KVM: x86: Initialize tdp_level during vCPU creation
Initialize vcpu->arch.tdp_level during vCPU creation to avoid consuming
garbage if userspace calls KVM_RUN without first calling KVM_SET_CPUID.
Fixes: e93fd3b3e89e9 ("KVM: x86/mmu: Capture TDP level when updating CPUID")
Reported-by: syzbot+904752567107eefb728c@syzkaller.appspotmail.com
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200527085400.23759-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6d13e9d1bb75..329bdd2eb2cf 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -9418,6 +9418,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) fx_init(vcpu); vcpu->arch.maxphyaddr = cpuid_query_maxphyaddr(vcpu); + vcpu->arch.tdp_level = kvm_x86_ops.get_tdp_level(vcpu); vcpu->arch.pat = MSR_IA32_CR_PAT_DEFAULT; |