]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: SVM: Move AVIC Physical ID table allocation to vcpu_precreate()
authorNaveen N Rao <naveen@kernel.org>
Thu, 4 Sep 2025 18:33:05 +0000 (00:03 +0530)
committerSean Christopherson <seanjc@google.com>
Fri, 17 Oct 2025 22:23:24 +0000 (15:23 -0700)
commit54ffe74cc4ab2e7c6dd0a37a2298fffb642acba7
tree75e5bcce058e342c083d3eccaefeeef1da2bbe08
parentca11d9d35e958d2b4020d1a360ddc277be3ee86c
KVM: SVM: Move AVIC Physical ID table allocation to vcpu_precreate()

With support for 4k vCPUs in x2AVIC, the size of the AVIC Physical ID
table is expanded from a single 4k page to a maximum of 8 contiguous 4k
pages. The actual number of pages allocated depends on the maximum
possible APIC ID in the guest, which is only known by the time the first
vCPU is created. In preparation for supporting a dynamic AVIC Physical
ID table size, move its allocation to vcpu_precreate().

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Naveen N Rao (AMD) <naveen@kernel.org>
Link: https://lore.kernel.org/r/7dc764e0af7f01440bbac3d9215ed174027c2384.1757009416.git.naveen@kernel.org
[sean: drop enable_apicv check from svm_vcpu_precreate()]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/svm/svm.h