aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorPaolo Bonzini <[email protected]>2025-07-28 15:14:40 +0000
committerPaolo Bonzini <[email protected]>2025-07-29 12:36:43 +0000
commitd7f4aac280ccbc8a9d1a1905da2fae860bdad491 (patch)
treec0b5f19a6a8a7da0ba7b7efa986febac9dd6ed61 /arch/x86/kvm/x86.c
parentMerge tag 'kvm-x86-misc-6.17' of https://github.com/kvm-x86/linux into HEAD (diff)
parentKVM: x86/mmu: Defer allocation of shadow MMU's hashed page list (diff)
downloadkernel-d7f4aac280ccbc8a9d1a1905da2fae860bdad491.tar.gz
kernel-d7f4aac280ccbc8a9d1a1905da2fae860bdad491.zip
Merge tag 'kvm-x86-mmu-6.17' of https://github.com/kvm-x86/linux into HEAD
KVM x86 MMU changes for 6.17 - Exempt nested EPT from the the !USER + CR0.WP logic, as EPT doesn't interact with CR0.WP. - Move the TDX hardware setup code to tdx.c to better co-locate TDX code and eliminate a few global symbols. - Dynamically allocation the shadow MMU's hashed page list, and defer allocating the hashed list until it's actually needed (the TDP MMU doesn't use the list).
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9ea2e54e7565..ba269385a9fa 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -12699,7 +12699,9 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
if (ret)
goto out;
- kvm_mmu_init_vm(kvm);
+ ret = kvm_mmu_init_vm(kvm);
+ if (ret)
+ goto out_cleanup_page_track;
ret = kvm_x86_call(vm_init)(kvm);
if (ret)
@@ -12745,6 +12747,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
out_uninit_mmu:
kvm_mmu_uninit_vm(kvm);
+out_cleanup_page_track:
kvm_page_track_cleanup(kvm);
out:
return ret;