Skip to content

Commit 0fd7686

Browse files
jgoulyMarc Zyngier
authored andcommitted
KVM: arm64: Add nPIR{E0}_EL1 to HFG traps
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. Unfortunately, these bits are not yet described in the ARM ARM, but only live in the XML description. Also add them to the NV FGT forwarding infrastructure. Signed-off-by: Joey Gouly <[email protected]> Fixes: e930694 ("KVM: arm64: Restructure FGT register switching") Cc: Oliver Upton <[email protected]> [maz: add entries to the NV FGT array, commit message update] Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 60197a4 commit 0fd7686

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

arch/arm64/include/asm/kvm_arm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,14 @@
344344
*/
345345
#define __HFGRTR_EL2_RES0 (GENMASK(63, 56) | GENMASK(53, 51))
346346
#define __HFGRTR_EL2_MASK GENMASK(49, 0)
347-
#define __HFGRTR_EL2_nMASK (GENMASK(55, 54) | BIT(50))
347+
#define __HFGRTR_EL2_nMASK (GENMASK(58, 57) | GENMASK(55, 54) | BIT(50))
348348

349349
#define __HFGWTR_EL2_RES0 (GENMASK(63, 56) | GENMASK(53, 51) | \
350350
BIT(46) | BIT(42) | BIT(40) | BIT(28) | \
351351
GENMASK(26, 25) | BIT(21) | BIT(18) | \
352352
GENMASK(15, 14) | GENMASK(10, 9) | BIT(2))
353353
#define __HFGWTR_EL2_MASK GENMASK(49, 0)
354-
#define __HFGWTR_EL2_nMASK (GENMASK(55, 54) | BIT(50))
354+
#define __HFGWTR_EL2_nMASK (GENMASK(58, 57) | GENMASK(55, 54) | BIT(50))
355355

356356
#define __HFGITR_EL2_RES0 GENMASK(63, 57)
357357
#define __HFGITR_EL2_MASK GENMASK(54, 0)

arch/arm64/kvm/emulate-nested.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@ enum fg_filter_id {
977977

978978
static const struct encoding_to_trap_config encoding_to_fgt[] __initconst = {
979979
/* HFGRTR_EL2, HFGWTR_EL2 */
980+
SR_FGT(SYS_PIR_EL1, HFGxTR, nPIR_EL1, 0),
981+
SR_FGT(SYS_PIRE0_EL1, HFGxTR, nPIRE0_EL1, 0),
980982
SR_FGT(SYS_TPIDR2_EL0, HFGxTR, nTPIDR2_EL0, 0),
981983
SR_FGT(SYS_SMPRI_EL1, HFGxTR, nSMPRI_EL1, 0),
982984
SR_FGT(SYS_ACCDATA_EL1, HFGxTR, nACCDATA_EL1, 0),

0 commit comments

Comments
 (0)