linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] KVM: arm64: pKVM fixes
@ 2025-12-15 11:44 Alexandru Elisei
  2025-12-15 11:44 ` [PATCH v2 1/4] KVM: arm64: Copy FGT traps to unprotected pKVM VCPU on VCPU load Alexandru Elisei
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Alexandru Elisei @ 2025-12-15 11:44 UTC (permalink / raw)
  To: maz, oupton, joey.gouly, suzuki.poulose, yuzenghui, qperret, will,
	tabba, linux-arm-kernel, kvmarm

v1 can be found at [1].

Similar to [2], when trying to run an unprotected VM on FVP with S1PIE enabled
and kvm-arm.mode=protected, writes to PIRE0_EL1 made by the guest in
__cpu_setup() are trapped by KVM and the BUG_ON(!r->access) is hit. That's
because HFGWTR_EL2.nPIRE0_EL1 is an inverse polarity trap and the FGT values for
the unprotected pKVM VCPU weren't being propagated from kvm_arch_vcpu_load().

Couldn't figure out how to run a protected pKVM VM, so that's untested.

New in this iteration is #2 ("KVM: arm64: Print register encoding if there's no
accessor") because I realized that the first thing I did when I hit the
BUG_ON(!r->access) (for this series and for the fix at [2]) was to print the
encoding for the register.  Thought that it might be more useful in the future
to do this by default.

Patch #4 ("KVM: arm64: Remove unused parameter in synchronize_vcpu_pstate()") is
also new - found it by code inspection while debugging something unrelated.

Changelog
=========

v1->v2:
* Rebased on top of v6.19-rc1.
* Added tags to patch #1 ("KVM: arm64: Copy FGT traps to unprotected pKVM
  VCPU on VCPU load") - thanks!
* Removed local variables 'hyp_kvm_vcpu' and 'host_vcpu' in patch #1.
* Patch #2 and #4 are new.
* Patch #3 ("KVM: arm64: Remove extra argument for
  __pvkm_host_{share,unshare}_hyp()") now properly fixes
  __pkvm_host_unshare_hyp().

[1] https://lore.kernel.org/kvmarm/20251210132102.137631-1-alexandru.elisei@arm.com/
[2] https://lore.kernel.org/all/20251112102853.47759-1-alexandru.elisei@arm.com/

Alexandru Elisei (4):
  KVM: arm64: Copy FGT traps to unprotected pKVM VCPU on VCPU load
  KVM: arm64: Print register encoding if there's no accessor
  KVM: arm64: Remove extra argument for __pvkm_host_{share,unshare}_hyp()
  KVM: arm64: Remove unused parameter in synchronize_vcpu_pstate()

 arch/arm64/kvm/hyp/include/hyp/switch.h | 2 +-
 arch/arm64/kvm/hyp/nvhe/hyp-main.c      | 3 +++
 arch/arm64/kvm/hyp/nvhe/pkvm.c          | 1 -
 arch/arm64/kvm/hyp/nvhe/switch.c        | 2 +-
 arch/arm64/kvm/hyp/vhe/switch.c         | 2 +-
 arch/arm64/kvm/mmu.c                    | 4 ++--
 arch/arm64/kvm/sys_regs.c               | 8 +++++++-
 7 files changed, 15 insertions(+), 7 deletions(-)


base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
-- 
2.52.0



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-12-15 15:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-15 11:44 [PATCH v2 0/4] KVM: arm64: pKVM fixes Alexandru Elisei
2025-12-15 11:44 ` [PATCH v2 1/4] KVM: arm64: Copy FGT traps to unprotected pKVM VCPU on VCPU load Alexandru Elisei
2025-12-15 11:44 ` [PATCH v2 2/4] KVM: arm64: Print register encoding if there's no accessor Alexandru Elisei
2025-12-15 13:58   ` Marc Zyngier
2025-12-15 15:17     ` Alexandru Elisei
2025-12-15 15:39       ` Marc Zyngier
2025-12-15 11:44 ` [PATCH v2 3/4] KVM: arm64: Remove extra argument for __pvkm_host_{share,unshare}_hyp() Alexandru Elisei
2025-12-15 13:43   ` Fuad Tabba
2025-12-15 11:44 ` [PATCH v2 4/4] KVM: arm64: Remove unused parameter in synchronize_vcpu_pstate() Alexandru Elisei
2025-12-15 13:42   ` Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).