linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] KVM: arm64: Fix initializing HCRX_EL2 and other traps in pKVM
@ 2025-02-14 15:02 Fuad Tabba
  2025-02-14 15:02 ` [PATCH v1 1/3] KVM: arm64: Initialize HCRX_EL2 " Fuad Tabba
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Fuad Tabba @ 2025-02-14 15:02 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel
  Cc: maz, oliver.upton, mark.rutland, will, joey.gouly, suzuki.poulose,
	yuzenghui, catalin.marinas, broonie, qperret, vdonnefort, tabba

Since the introduction of initializing and setting HCRX_EL2 traps
in KVM, we haven't updated the pKVM code upstream do the same for
the hyp view.

Additionally, the current behavior of pKVM is to initialize the
hyp view of the vm and of _all_ its vcpus when the _first_ vcpu
is run. However, with the introduction of kvm_calculate_traps()
[*], some of the host trap values are not calculated until the
corresponding vcpu is run for the first time. This causes pKVM to
get the wrong view of some of the system registers, e.g.,
HCRX_EL2, for vcpus other than the first run vcpu, since it uses
the host's version as a starting point --- particularly for
non-protected vms. Because of these issues, it's might not be
possible to run a non-protected VM when certain features (e.g.,
MOPS) are supported by the system.

This series initializes HCRX_EL2 for VMs in protected mode. It
also initializes the hyp view of each vcpu after its
corresponding host vcpu has been fully initialized, i.e., run for
the first time.

This series is based on Linux 6.14-rc2.

Cheers,
/fuad

[*] Commit f1ff3fc5209a ("KVM: arm64: unify code to prepare traps")

Fuad Tabba (3):
  KVM: arm64: Initialize HCRX_EL2 traps in pKVM
  KVM: arm64: Factor out pkvm hyp vcpu creation to separate function
  KVM: arm64: Create each pKVM hyp vcpu after its corresponding host
    vcpu

 arch/arm64/include/asm/kvm_host.h      |   2 +
 arch/arm64/include/asm/kvm_pkvm.h      |   1 +
 arch/arm64/kvm/arm.c                   |   4 +
 arch/arm64/kvm/hyp/include/nvhe/pkvm.h |   6 --
 arch/arm64/kvm/hyp/nvhe/pkvm.c         | 100 +++++++++++++++++++------
 arch/arm64/kvm/pkvm.c                  |  70 +++++++++--------
 6 files changed, 118 insertions(+), 65 deletions(-)


base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
-- 
2.48.1.601.g30ceb7b040-goog



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

end of thread, other threads:[~2025-02-26 19:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 15:02 [PATCH v1 0/3] KVM: arm64: Fix initializing HCRX_EL2 and other traps in pKVM Fuad Tabba
2025-02-14 15:02 ` [PATCH v1 1/3] KVM: arm64: Initialize HCRX_EL2 " Fuad Tabba
2025-02-26 10:07   ` Oliver Upton
2025-02-26 10:45     ` Marc Zyngier
2025-02-26 12:44       ` Fuad Tabba
2025-02-26 15:28         ` Marc Zyngier
2025-02-26 18:53           ` Oliver Upton
2025-02-26 18:54             ` Fuad Tabba
2025-02-26 12:36     ` Fuad Tabba
2025-02-14 15:02 ` [PATCH v1 2/3] KVM: arm64: Factor out pkvm hyp vcpu creation to separate function Fuad Tabba
2025-02-14 15:02 ` [PATCH v1 3/3] KVM: arm64: Create each pKVM hyp vcpu after its corresponding host vcpu Fuad Tabba
2025-02-17 15:30   ` Will Deacon
2025-02-17 15:41     ` Fuad Tabba
2025-02-17 15:56       ` Fuad Tabba
2025-02-18  9:27         ` Will Deacon

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).