Re: [GIT PULL] KVM: Generic and documentation updates for 7.3
From: Paolo Bonzini
Date: Tue Aug 18 2026 - 07:21:01 EST
On Wed, Aug 12, 2026 at 11:32 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> So the subject is a bit of a lie, as three of the five patches are x86 specific.
> But two are common documentation updates, and the third has a hard dependency on
> a common KVM change that might be questionable.
>
> The potentially controversial change is to add a per-VM bitmap to track which
> vCPU IDs have been "claimed", so that arch code doesn't have to guard against
> duplicate vCPU IDs during kvm_arch_vcpu_create() and kvm_arch_vcpu_destroy().
> The part that's a little less than awesome is that the bitmap is effectively
> wasted memory once the VM has reached steady state. But, AFAICT, it shouldn't
> be a meaningful amount of memory in practice.
At 512 bytes per VM, a single struct kvm_vcpu is (more than) ten times
that... Pulled, thanks.
Paolo
> The alternative solution we came up with was to use another xarray so that the
> tracking entry could be deleted once a vCPU is fully realized. The consensus
> was that the complexity of the xarray approach wasn't justified, even though
> the added complexity is relatively small.
>
> The following changes since commit a204badd8432f93b7e862e7dac6db0fe3d65f370:
>
> Merge branch 'kvm-chainsaw' into HEAD (2026-06-25 11:32:09 +0200)
>
> are available in the Git repository at:
>
> https://github.com/kvm-x86/linux.git tags/kvm-x86-generic-7.3
>
> for you to fetch changes up to b41f2ca6c06011c36b75f5d53aa17c05ed90be21:
>
> KVM: VMX: Fix stale PID-pointer table entry left after vCPU free (2026-07-31 15:13:31 -0700)
>
> ----------------------------------------------------------------
> KVM arch-neutral and documentation changes for 7.3
>
> - Remove kvm_debugfs_dir if kvm_init() fails after creating KVM's debugfs.
>
> - Document some of the "fun" gotchas with the APIC base when creating IRQCHIPs
> on x86.
>
> - Add a per-VM bitmap to track which vCPU IDs have been "claimed" but for
> which the vCPU isn't yet online, and use the bitmap to reject duplicate IDs
> before calling into arch code. This allows arch code to consume vcpu_id
> without having to worry about cross-vCPU clobbering (at least s390 and x86
> have had related bugs).
>
> - Zero a vCPU's entry in VMX's Posted Interrupt Descriptor table used for IPI
> virtualization when the vCPU is freed to fix a use-after-free where hardware
> will write to a freed vCPU's PID.
>
> ----------------------------------------------------------------
> Dmytro Maluka (2):
> KVM: Check for duplicate vcpu_id as early as possible
> KVM: VMX: Fix stale PID-pointer table entry left after vCPU free
>
> Tim Wiederhake (2):
> KVM: x86: Document that KVM_CREATE_IRQCHIP must precede vCPU creation
> KVM: x86: Document APIC base address constraint for in-kernel irqchip
>
> leixiang (1):
> KVM: Remove kvm_debugfs_dir on kvm_init() error paths
>
> Documentation/virt/kvm/api.rst | 15 ++++++++++++++-
> arch/x86/kvm/vmx/vmx.c | 3 +++
> include/linux/kvm_host.h | 1 +
> virt/kvm/kvm_main.c | 10 +++++++++-
> 4 files changed, 27 insertions(+), 2 deletions(-)
>