[PATCH v2 4/6] KVM: arm64: Account for RES1 bits in DECLARE_FEAT_MAP() and co
Nathan Chancellor
nathan at kernel.org
Tue Jan 20 13:15:58 PST 2026
Hi Marc,
On Wed, Dec 10, 2025 at 05:30:22PM +0000, Marc Zyngier wrote:
> None of the registers we manage in the feature dependency infrastructure
> so far has any RES1 bit. This is about to change, as VTCR_EL2 has
> its bit 31 being RES1.
>
> In order to not fail the consistency checks by not describing a bit,
> add RES1 bits to the set of immutable bits. This requires some extra
> surgery for the FGT handling, as we now need to track RES1 bits there
> as well.
>
> There are no RES1 FGT bits *yet*. Watch this space.
>
> Signed-off-by: Marc Zyngier <maz at kernel.org>
After this change in -next as commit c259d763e6b0 ("KVM: arm64: Account
for RES1 bits in DECLARE_FEAT_MAP() and co"), I am seeing several
"undefined behavior" errors on my two arm64 boxes.
$ journalctl -k -g '(Linux version|kvm)' --no-hostname -o cat
Linux version 6.19.0-rc4-00014-gc259d763e6b0 (nathan at framework-amd-ryzen-maxplus-395) (aarch64-linux-gcc (GCC) 15.2.0, GNU ld (GNU Binutils) 2.45) #1 SMP PREEMPT_DYNAMIC Tue Jan 20 13:59:52 MST 2026
kvm [1]: nv: 568 coarse grained trap handlers
kvm [1]: Undefined hfgrtr_masks behaviour, bits fff7ffffffffffff
kvm [1]: Undefined hfgwtr_masks behaviour, bits fff7baffe9db39fb
kvm [1]: Undefined hfgitr_masks behaviour, bits dfffffffffffffff
kvm [1]: Undefined hdfgrtr_masks behaviour, bits fffdfb3fffcffeff
kvm [1]: Undefined hdfgwtr_masks behaviour, bits 73f7763bbfbffdbf
kvm [1]: Undefined hafgrtr_masks behaviour, bits 0003fffffffe001f
kvm [1]: Undefined hfgrtr2_masks behaviour, bits 0000000000007fff
kvm [1]: Undefined hfgwtr2_masks behaviour, bits 0000000000007ffd
kvm [1]: Undefined hfgitr2_masks behaviour, bits 0000000000000003
kvm [1]: Undefined hdfgrtr2_masks behaviour, bits 0000000001dfffff
kvm [1]: Undefined hdfgwtr2_masks behaviour, bits 0000000001f9ffbf
kvm [1]: IPA Size Limit: 44 bits
kvm [1]: vgic-v2 at c0e0000
kvm [1]: GICv3 sysreg trapping enabled ([C], reduced performance)
kvm [1]: GIC system register CPU interface enabled
kvm [1]: vgic interrupt IRQ9
kvm [1]: Hyp nVHE mode initialized successfully
At the parent change, there are no warnings:
$ journalctl -k -g '(Linux version|kvm)' --no-hostname -o cat
Linux version 6.19.0-rc4-00013-ga035001dea37 (nathan at framework-amd-ryzen-maxplus-395) (aarch64-linux-gcc (GCC) 15.2.0, GNU ld (GNU Binutils) 2.45) #1 SMP PREEMPT_DYNAMIC Tue Jan 20 14:05:51 MST 2026
kvm [1]: nv: 568 coarse grained trap handlers
kvm [1]: IPA Size Limit: 44 bits
kvm [1]: vgic-v2 at c0e0000
kvm [1]: GICv3 sysreg trapping enabled ([C], reduced performance)
kvm [1]: GIC system register CPU interface enabled
kvm [1]: vgic interrupt IRQ9
kvm [1]: Hyp nVHE mode initialized successfully
Is this expected? If there is any other information I can provide from
this machine, I am more than happy to do so.
Cheers,
Nathan
# bad: [d08c85ac8894995d4b0d8fb48d2f6a3e53cd79ab] Add linux-next specific files for 20260119
# good: [24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7] Linux 6.19-rc6
git bisect start 'd08c85ac8894995d4b0d8fb48d2f6a3e53cd79ab' '24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7'
# good: [6639b8bb674daa8e7781884a599e971b71aa2520] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git
git bisect good 6639b8bb674daa8e7781884a599e971b71aa2520
# good: [28b7eb3c316bddbe6ba570caf68f560ecc06e66a] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git
git bisect good 28b7eb3c316bddbe6ba570caf68f560ecc06e66a
# bad: [7bdf87f63d2577b8eab4f732e33e91d71d3fba4b] Merge branch 'linux-next' of https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
git bisect bad 7bdf87f63d2577b8eab4f732e33e91d71d3fba4b
# good: [27eb76f30bfc3d9f2d3f8f4879fb54f788fdbdb9] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
git bisect good 27eb76f30bfc3d9f2d3f8f4879fb54f788fdbdb9
# good: [79a02a116a52c96311b04be8051030c8bd730bb8] Merge branch into tip/master: 'x86/cpu'
git bisect good 79a02a116a52c96311b04be8051030c8bd730bb8
# bad: [1e0ce70c66b8f7fb248d1c6b74a4139e5ac452bc] Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git
git bisect bad 1e0ce70c66b8f7fb248d1c6b74a4139e5ac452bc
# good: [5d1563869e30923c5a8de291ce63d2fa82e08202] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
git bisect good 5d1563869e30923c5a8de291ce63d2fa82e08202
# bad: [c24170ec742d06021ae7f14df9a1885714ab6095] Merge branch kvm-arm64/selftests-6.20 into kvmarm-master/next
git bisect bad c24170ec742d06021ae7f14df9a1885714ab6095
# bad: [80cbfd7174f31010982f065e8ae73bf337992105] KVM: arm64: Honor UX/PX attributes for EL2 S1 mappings
git bisect bad 80cbfd7174f31010982f065e8ae73bf337992105
# good: [9e27085c33cca7ad26bec0af2c17aab072dd802e] KVM: arm64: nv: Respect stage-2 write permssion when setting stage-1 AF
git bisect good 9e27085c33cca7ad26bec0af2c17aab072dd802e
# good: [f1640174c8a769511641bfd5b7da16c4943e2c64] arm64: Convert ID_AA64MMFR0_EL1.TGRAN{4,16,64}_2 to UnsignedEnum
git bisect good f1640174c8a769511641bfd5b7da16c4943e2c64
# bad: [c259d763e6b09a463c85ff6b1d20ede92da48d24] KVM: arm64: Account for RES1 bits in DECLARE_FEAT_MAP() and co
git bisect bad c259d763e6b09a463c85ff6b1d20ede92da48d24
# good: [a035001dea37b885efb934e25057430ae1193d0a] arm64: Convert VTCR_EL2 to sysreg infratructure
git bisect good a035001dea37b885efb934e25057430ae1193d0a
# first bad commit: [c259d763e6b09a463c85ff6b1d20ede92da48d24] KVM: arm64: Account for RES1 bits in DECLARE_FEAT_MAP() and co
More information about the linux-arm-kernel
mailing list