Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+7 -2
+7 -2
arch/arm64/kvm/config.c
··· 24 24 #define CALL_FUNC BIT(1) /* Needs to evaluate tons of crap */ 25 25 #define FIXED_VALUE BIT(2) /* RAZ/WI or RAO/WI in KVM */ 26 26 #define MASKS_POINTER BIT(3) /* Pointer to fgt_masks struct instead of bits */ 27 + #define AS_RES1 BIT(4) /* RES1 when not supported */ 27 28 28 29 unsigned long flags; 29 30 ··· 1316 1315 else 1317 1316 match = idreg_feat_match(kvm, &map[i]); 1318 1317 1319 - if (!match || (map[i].flags & FIXED_VALUE)) 1320 - resx.res0 |= reg_feat_map_bits(&map[i]); 1318 + if (!match || (map[i].flags & FIXED_VALUE)) { 1319 + if (map[i].flags & AS_RES1) 1320 + resx.res1 |= reg_feat_map_bits(&map[i]); 1321 + else 1322 + resx.res0 |= reg_feat_map_bits(&map[i]); 1323 + } 1321 1324 } 1322 1325 1323 1326 return resx;