diff options
| author | Marc Zyngier <maz@kernel.org> | 2026-02-02 18:43:16 +0000 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-02-05 09:01:38 +0000 |
| commit | 459fc4e77e1ac932e47cb4a6d1a01b3be79fd41c (patch) | |
| tree | 39b1b0bd6f70c873736ee2f4b03fcb1c897b9cbe /arch | |
| parent | bbea27636e660df907ebf0d36e3dfca5c77cfbc0 (diff) | |
KVM: arm64: Allow RES1 bits to be inferred from configuration
So far, when a bit field is tied to an unsupported feature, we set
it as RES0. This is almost correct, but there are a few exceptions
where the bits become RES1.
Add a AS_RES1 qualifier that instruct the RESx computing code to
simply do that.
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260202184329.2724080-8-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm64/kvm/config.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm64/kvm/config.c b/arch/arm64/kvm/config.c index 9ad7eb5f4b98..72c6dd7656ba 100644 --- a/arch/arm64/kvm/config.c +++ b/arch/arm64/kvm/config.c @@ -24,6 +24,7 @@ struct reg_bits_to_feat_map { #define CALL_FUNC BIT(1) /* Needs to evaluate tons of crap */ #define FIXED_VALUE BIT(2) /* RAZ/WI or RAO/WI in KVM */ #define MASKS_POINTER BIT(3) /* Pointer to fgt_masks struct instead of bits */ +#define AS_RES1 BIT(4) /* RES1 when not supported */ unsigned long flags; @@ -1315,8 +1316,12 @@ static struct resx __compute_fixed_bits(struct kvm *kvm, else match = idreg_feat_match(kvm, &map[i]); - if (!match || (map[i].flags & FIXED_VALUE)) - resx.res0 |= reg_feat_map_bits(&map[i]); + if (!match || (map[i].flags & FIXED_VALUE)) { + if (map[i].flags & AS_RES1) + resx.res1 |= reg_feat_map_bits(&map[i]); + else + resx.res0 |= reg_feat_map_bits(&map[i]); + } } return resx; |
