]> www.infradead.org Git - users/hch/misc.git/commit
KVM: arm64: Create each pKVM hyp vcpu after its corresponding host vcpu
authorFuad Tabba <tabba@google.com>
Fri, 14 Mar 2025 11:18:32 +0000 (11:18 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Fri, 14 Mar 2025 23:06:03 +0000 (16:06 -0700)
commit1eab115486c5c721e57bc72f8241d20cfed08f16
treef334110fd925d4be5f11fbff125091198af4fce4
parent8b21fb47c7788779f571499cde4ce573c53ed218
KVM: arm64: Create each pKVM hyp vcpu after its corresponding host vcpu

Instead of creating and initializing _all_ hyp vcpus in pKVM when
the first host vcpu runs for the first time, initialize _each_
hyp vcpu in conjunction with its corresponding host vcpu.

Some of the host vcpu state (e.g., system registers and traps
values) is not initialized until the first time the host vcpu is
run. Therefore, initializing a hyp vcpu before its corresponding
host vcpu has run for the first time might not view the complete
host state of these vcpus.

Additionally, this behavior is inline with non-protected modes.

Acked-by: Will Deacon <will@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20250314111832.4137161-5-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_pkvm.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/include/nvhe/pkvm.h
arch/arm64/kvm/hyp/nvhe/pkvm.c
arch/arm64/kvm/pkvm.c