[Dropping a few emails from the list, as they are very likely to simply bounce]
On Fri, 25 Jul 2025 02:15:28 +0100, Justin Stitt justinstitt@google.com wrote:
A new warning in Clang 22 [1] complains that @clidr passed to get_clidr_el1() is an uninitialized const pointer. get_clidr_el1() doesn't really care since it casts away the const-ness anyways.
Silence the warning by initializing the struct.
This patch won't apply to anything past v6.1 as this code section was reworked in Commit 7af0c2534f4c ("KVM: arm64: Normalize cache configuration").
Cc: stable@vger.kernel.org Fixes: 7c8c5e6a9101e ("arm64: KVM: system register handling")
No, this really doesn't fix anything other than paper over an overzealous warning.
Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441... [1] Signed-off-by: Justin Stitt justinstitt@google.com
arch/arm64/kvm/sys_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index f4a7c5abcbca..d7ebd7387221 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2948,7 +2948,7 @@ int kvm_sys_reg_table_init(void) { bool valid = true; unsigned int i;
- struct sys_reg_desc clidr;
- struct sys_reg_desc clidr = {0};
/* Make sure tables are unique and in order. */ valid &= check_sysreg_table(sys_reg_descs, ARRAY_SIZE(sys_reg_descs), false);
Frankly, this sort of things is the worse you can do, as
- it perpetuates a bad design
- it is completely pointless, as you pointed out
- it is only going to make it harder to backport other patches
The correct fix would be to backport the series described in e8789ab7047a8, which should be easy enough to apply. it would also make 6.1 less of a terrible kernel.
M.