Skip to content

KVM: arm64: Handle effective RES0 behaviour of undefined registers

Marc Zyngier kvmarm linux-arm-kernel 2 versions – Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 4 repliesApplied
  2. v18 patches 2 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/10KVM: arm64: Remove duplicate FEAT_{SYSREG128,MTE2} descriptionsarch/arm64/kvm/config.c+0 -20 replies
2/10KVM: arm64: Add reg_feat_map_desc to describe full register dependencyarch/arm64/kvm/config.c+72 -90 replies
3/10KVM: arm64: Enforce absence of FEAT_FGT on FGT registersarch/arm64/kvm/config.c+77 -490 replies
4/10KVM: arm64: Enforce absence of FEAT_FGT2 on FGT2 registersarch/arm64/kvm/config.c+37 -300 replies
5/10KVM: arm64: Enforce absence of FEAT_HCX on HCRX_EL2arch/arm64/kvm/config.c+7 -50 replies
6/10KVM: arm64: Convert HCR_EL2 RES0 handling to compute_reg_res0_bits()arch/arm64/kvm/config.c+14 -160 replies
7/10KVM: arm64: Enforce absence of FEAT_SCTLR2 on SCTLR2_EL{1,2}arch/arm64/kvm/config.c+5 -50 replies
8/10KVM: arm64: Enforce absence of FEAT_TCR2 on TCR2_EL2arch/arm64/kvm/config.c+5 -50 replies
9/10KVM: arm64: Convert SCTLR_EL1 RES0 handling to compute_reg_res0_bits()arch/arm64/kvm/config.c+5 -50 replies
10/10KVM: arm64: Convert MDCR_EL2 RES0 handling to compute_reg_res0_bits()arch/arm64/kvm/config.c+5 -42 replies

Reviews trailers per patch

None of the 10 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchOliver Upton
SeriesR-b
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] KVM: arm64: Handle effective RES0 behaviour of undefined registers

[After yesterday's blunder, I'm reposting this, with proper commit
messages, and having taken Oliver's feedback into account.]

When a feature is removed from a guest, we ensure that the trap and control bits for that particular feature are made RES0.

For example, SCTLR2_EL2 contains a large number of bits. For any feature FEAT_FOO that is controlled by a bit FOO in SCTLR2_EL2, we make sure that SCTLR2_EL2.FOO is RES0 if FEAT_FOO is not visible to the guest.

However, nothing makes SCTLR2_EL2 RES0 if FEAT_SCTLR2 is not visible.

This series aims at solving this sort of situations. It is still quite incomplete, but aims at bridging a couple of other series:

- [email protected] which wants to make EL2-related fields writable to allow migration

- [email protected] which wants to align the NV support with the rest of the kernel

Hopefully this helps getting to a point where we everything is sanitised according to the architecture, EL2 on the same footing as EL1, and everything migrating in every possible case.

And winning the lottery.

* From v1:

- Commit messages!

- Simplified declaration macros

- Added helpful comments (or so I hope)

- Changed type names according to Oliver's suggestion

Marc Zyngier (10):
KVM: arm64: Remove duplicate FEAT_{SYSREG128,MTE2} descriptions
KVM: arm64: Add reg_feat_map_desc to describe full register dependency
KVM: arm64: Enforce absence of FEAT_FGT on FGT registers
KVM: arm64: Enforce absence of FEAT_FGT2 on FGT2 registers
KVM: arm64: Enforce absence of FEAT_HCX on HCRX_EL2
KVM: arm64: Convert HCR_EL2 RES0 handling to compute_reg_res0_bits()
KVM: arm64: Enforce absence of FEAT_SCTLR2 on SCTLR2_EL{1,2}
KVM: arm64: Enforce absence of FEAT_TCR2 on TCR2_EL2
KVM: arm64: Convert SCTLR_EL1 RES0 handling to compute_reg_res0_bits()
KVM: arm64: Convert MDCR_EL2 RES0 handling to compute_reg_res0_bits()

 arch/arm64/kvm/config.c | 357 +++++++++++++++++++++++++---------------
 1 file changed, 227 insertions(+), 130 deletions(-)
Signature · 1 line
2.39.2