[PATCH v1 1/2] KVM: arm64: add nPIR{E0}_EL1 to HFG traps

Marc Zyngier maz at kernel.org
Thu Oct 12 08:33:25 PDT 2023


Hi Joey,

Please Cc all the reviewers, not only Oliver and me.

On Thu, 12 Oct 2023 13:34:58 +0100,
Joey Gouly <joey.gouly at arm.com> wrote:
> 
> nPIR_EL1 and nPIREO_EL1 are part of the 'reverse polarity' set of bits, set
> them so that we disable the traps for a guest.

It would have been helpful to indicate where these bits were defined,
as they are not published in the ARM ARM. For the record, they live in
the XML files available at [1]. If we're adding these, we also need to
add the FGT emulation for nested, which doesn't describe these bits:

diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
index 34075185af8e..f564e9b075d5 100644
--- a/arch/arm64/kvm/emulate-nested.c
+++ b/arch/arm64/kvm/emulate-nested.c
@@ -977,6 +977,8 @@ enum fg_filter_id {
 
 static const struct encoding_to_trap_config encoding_to_fgt[] __initconst = {
 	/* HFGRTR_EL2, HFGWTR_EL2 */
+	SR_FGT(SYS_PIR_EL1,		HFGxTR, nPIR_EL1, 0),
+	SR_FGT(SYS_PIRE0_EL1,		HFGxTR, nPIRE0_EL1, 0),
 	SR_FGT(SYS_TPIDR2_EL0,		HFGxTR, nTPIDR2_EL0, 0),
 	SR_FGT(SYS_SMPRI_EL1,		HFGxTR, nSMPRI_EL1, 0),
 	SR_FGT(SYS_ACCDATA_EL1,		HFGxTR, nACCDATA_EL1, 0),

I'll amend the commit message locally and fold this in.

	M.

[1] https://developer.arm.com/downloads/-/exploration-tools

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list