* [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot()
@ 2025-11-25 17:59 Nathan Chancellor
2025-11-25 19:42 ` Marc Zyngier
2025-11-25 21:25 ` Oliver Upton
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2025-11-25 17:59 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, Joey Gouly, Suzuki K Poulose,
Zenghui Yu
Cc: linux-arm-kernel, kvmarm, llvm, patches, Nathan Chancellor
Clang warns (or errors with CONFIG_WERROR=y / W=e):
arch/arm64/kvm/hyp/pgtable.c:757:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
757 | }
| ^
With older versions of clang (15 and older) and GCC (at least the minimum
supported, 8.1), this is an unconditional hard error:
arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_pte_prot':
arch/arm64/kvm/hyp/pgtable.c:756:2: error: label at end of compound statement
default:
^~~~~~~
arch/arm64/kvm/hyp/pgtable.c:756:10: error: label at end of compound statement: expected statement
default:
^
;
Add a break statement to this default case to clear up the error/warning.
Fixes: 2608563b466b ("KVM: arm64: Add support for FEAT_XNX stage-2 permissions")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
arch/arm64/kvm/hyp/pgtable.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 57e13a5d0405..947ac1a951a5 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp/pgtable.c
@@ -754,6 +754,7 @@ enum kvm_pgtable_prot kvm_pgtable_stage2_pte_prot(kvm_pte_t pte)
prot |= KVM_PGTABLE_PROT_PX;
break;
default:
+ break;
}
return prot;
---
base-commit: b5e3afe91cfa420076851bbd833f11ecd3fab74d
change-id: 20251125-arm64-kvm-hyp-pgtable-fix-c23-ext-warn-851b6b5e76fe
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot()
2025-11-25 17:59 [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot() Nathan Chancellor
@ 2025-11-25 19:42 ` Marc Zyngier
2025-11-25 21:25 ` Oliver Upton
2025-11-25 21:25 ` Oliver Upton
1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2025-11-25 19:42 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Oliver Upton, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
linux-arm-kernel, kvmarm, llvm, patches
On Tue, 25 Nov 2025 17:59:15 +0000,
Nathan Chancellor <nathan@kernel.org> wrote:
>
> Clang warns (or errors with CONFIG_WERROR=y / W=e):
>
> arch/arm64/kvm/hyp/pgtable.c:757:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
> 757 | }
> | ^
>
> With older versions of clang (15 and older) and GCC (at least the minimum
> supported, 8.1), this is an unconditional hard error:
>
> arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_pte_prot':
> arch/arm64/kvm/hyp/pgtable.c:756:2: error: label at end of compound statement
> default:
> ^~~~~~~
>
> arch/arm64/kvm/hyp/pgtable.c:756:10: error: label at end of compound statement: expected statement
> default:
> ^
> ;
>
> Add a break statement to this default case to clear up the error/warning.
>
> Fixes: 2608563b466b ("KVM: arm64: Add support for FEAT_XNX stage-2 permissions")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Marc Zyngier <maz@kernel.org>
M.
--
Jazz isn't dead. It just smells funny.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot()
2025-11-25 19:42 ` Marc Zyngier
@ 2025-11-25 21:25 ` Oliver Upton
0 siblings, 0 replies; 4+ messages in thread
From: Oliver Upton @ 2025-11-25 21:25 UTC (permalink / raw)
To: Marc Zyngier
Cc: Nathan Chancellor, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
linux-arm-kernel, kvmarm, llvm, patches
On Tue, Nov 25, 2025 at 07:42:48PM +0000, Marc Zyngier wrote:
> On Tue, 25 Nov 2025 17:59:15 +0000,
> Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > Clang warns (or errors with CONFIG_WERROR=y / W=e):
> >
> > arch/arm64/kvm/hyp/pgtable.c:757:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
> > 757 | }
> > | ^
> >
> > With older versions of clang (15 and older) and GCC (at least the minimum
> > supported, 8.1), this is an unconditional hard error:
> >
> > arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_pte_prot':
> > arch/arm64/kvm/hyp/pgtable.c:756:2: error: label at end of compound statement
> > default:
> > ^~~~~~~
> >
> > arch/arm64/kvm/hyp/pgtable.c:756:10: error: label at end of compound statement: expected statement
> > default:
> > ^
> > ;
> >
> > Add a break statement to this default case to clear up the error/warning.
> >
> > Fixes: 2608563b466b ("KVM: arm64: Add support for FEAT_XNX stage-2 permissions")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> Acked-by: Marc Zyngier <maz@kernel.org>
Thank you both for addressing the pile-up of issues I managed to
introduce :) Online now, will apply in just a moment.
Thanks,
Oliver
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot()
2025-11-25 17:59 [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot() Nathan Chancellor
2025-11-25 19:42 ` Marc Zyngier
@ 2025-11-25 21:25 ` Oliver Upton
1 sibling, 0 replies; 4+ messages in thread
From: Oliver Upton @ 2025-11-25 21:25 UTC (permalink / raw)
To: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
Nathan Chancellor
Cc: Oliver Upton, linux-arm-kernel, kvmarm, llvm, patches
On Tue, 25 Nov 2025 10:59:15 -0700, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y / W=e):
>
> arch/arm64/kvm/hyp/pgtable.c:757:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
> 757 | }
> | ^
>
> With older versions of clang (15 and older) and GCC (at least the minimum
> supported, 8.1), this is an unconditional hard error:
>
> [...]
Applied to next, thanks!
[1/1] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot()
https://git.kernel.org/kvmarm/kvmarm/c/621e0a641f64
--
Best,
Oliver
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-25 21:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 17:59 [PATCH] KVM: arm64: Add break to default case in kvm_pgtable_stage2_pte_prot() Nathan Chancellor
2025-11-25 19:42 ` Marc Zyngier
2025-11-25 21:25 ` Oliver Upton
2025-11-25 21:25 ` Oliver Upton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).