The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* linux-next: build warnings after merge of the kvm-arm-fixes tree
@ 2026-07-07 12:11 Mark Brown
  2026-07-07 12:58 ` linux-next: Build failure in the final build Mark Brown
  2026-07-07 13:17 ` linux-next: build warnings after merge of the kvm-arm-fixes tree Marc Zyngier
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2026-07-07 12:11 UTC (permalink / raw)
  To: Oliver Upton, Marc Zyngier
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2480 bytes --]

Hi all,

After merging the kvm-arm-fixes tree, today's linux-next build
(arm64 defconfig) started generating warnings:

In file included from /tmp/next/build/include/linux/limits.h:7,
                 from /tmp/next/build/include/linux/overflow.h:6,
                 from /tmp/next/build/include/linux/bits.h:32,
                 from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
                 from /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:11:
/tmp/next/build/arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
/tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
    8 | #define INT_MAX         ((int)(~0U >> 1))
      |                         ^
/tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
  131 | #define TLBI_TTL_UNKNOWN        INT_MAX
      |                                 ^~~~~~~
/tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
 1361 |         s8 level = TLBI_TTL_UNKNOWN;
      |                    ^~~~~~~~~~~~~~~~
In file included from /tmp/next/build/include/linux/limits.h:7,
                 from /tmp/next/build/include/linux/overflow.h:6,
                 from /tmp/next/build/include/linux/bits.h:32,
                 from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
                 from /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:11:
/tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
/tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
    8 | #define INT_MAX         ((int)(~0U >> 1))
      |                         ^
/tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
  131 | #define TLBI_TTL_UNKNOWN        INT_MAX
      |                                 ^~~~~~~
/tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
 1361 |         s8 level = TLBI_TTL_UNKNOWN;
      |                    ^~~~~~~~~~~~~~~~


Caused by commit

   100baf0184896 (KVM: arm64: Ensure level is always initialized when relaxing perms)

I imagine this will cause an allyesconfig build failure when I get to
that due to -Werror.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* linux-next: Build failure in the final build
  2026-07-07 12:11 linux-next: build warnings after merge of the kvm-arm-fixes tree Mark Brown
@ 2026-07-07 12:58 ` Mark Brown
  2026-07-07 13:17 ` linux-next: build warnings after merge of the kvm-arm-fixes tree Marc Zyngier
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-07-07 12:58 UTC (permalink / raw)
  To: Oliver Upton, Marc Zyngier
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2710 bytes --]

On Tue, Jul 07, 2026 at 01:11:55PM +0100, Mark Brown wrote:

> After merging the kvm-arm-fixes tree, today's linux-next build
> (arm64 defconfig) started generating warnings:

> In file included from /tmp/next/build/include/linux/limits.h:7,
>                  from /tmp/next/build/include/linux/overflow.h:6,
>                  from /tmp/next/build/include/linux/bits.h:32,
>                  from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
>                  from /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:11:
> /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
> /tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
>     8 | #define INT_MAX         ((int)(~0U >> 1))
>       |                         ^
> /tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
>   131 | #define TLBI_TTL_UNKNOWN        INT_MAX
>       |                                 ^~~~~~~
> /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
>  1361 |         s8 level = TLBI_TTL_UNKNOWN;
>       |                    ^~~~~~~~~~~~~~~~
> In file included from /tmp/next/build/include/linux/limits.h:7,
>                  from /tmp/next/build/include/linux/overflow.h:6,
>                  from /tmp/next/build/include/linux/bits.h:32,
>                  from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
>                  from /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:11:
> /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
> /tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
>     8 | #define INT_MAX         ((int)(~0U >> 1))
>       |                         ^
> /tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
>   131 | #define TLBI_TTL_UNKNOWN        INT_MAX
>       |                                 ^~~~~~~
> /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
>  1361 |         s8 level = TLBI_TTL_UNKNOWN;
>       |                    ^~~~~~~~~~~~~~~~

> Caused by commit

>    100baf0184896 (KVM: arm64: Ensure level is always initialized when relaxing perms)

> I imagine this will cause an allyesconfig build failure when I get to
> that due to -Werror.

Confirmed, nothing later in the merge fixed the warning so -Werror
triggered breaking arm64 allyesconfig.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build warnings after merge of the kvm-arm-fixes tree
  2026-07-07 12:11 linux-next: build warnings after merge of the kvm-arm-fixes tree Mark Brown
  2026-07-07 12:58 ` linux-next: Build failure in the final build Mark Brown
@ 2026-07-07 13:17 ` Marc Zyngier
  2026-07-07 15:44   ` Oliver Upton
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2026-07-07 13:17 UTC (permalink / raw)
  To: Mark Brown
  Cc: Oliver Upton, Linux Kernel Mailing List, Linux Next Mailing List

On Tue, 07 Jul 2026 13:11:55 +0100,
Mark Brown <broonie@kernel.org> wrote:
> 
> Hi all,
> 
> After merging the kvm-arm-fixes tree, today's linux-next build
> (arm64 defconfig) started generating warnings:
> 
> In file included from /tmp/next/build/include/linux/limits.h:7,
>                  from /tmp/next/build/include/linux/overflow.h:6,
>                  from /tmp/next/build/include/linux/bits.h:32,
>                  from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
>                  from /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:11:
> /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
> /tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
>     8 | #define INT_MAX         ((int)(~0U >> 1))
>       |                         ^
> /tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
>   131 | #define TLBI_TTL_UNKNOWN        INT_MAX
>       |                                 ^~~~~~~
> /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
>  1361 |         s8 level = TLBI_TTL_UNKNOWN;
>       |                    ^~~~~~~~~~~~~~~~
> In file included from /tmp/next/build/include/linux/limits.h:7,
>                  from /tmp/next/build/include/linux/overflow.h:6,
>                  from /tmp/next/build/include/linux/bits.h:32,
>                  from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
>                  from /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:11:
> /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
> /tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
>     8 | #define INT_MAX         ((int)(~0U >> 1))
>       |                         ^
> /tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
>   131 | #define TLBI_TTL_UNKNOWN        INT_MAX
>       |                                 ^~~~~~~
> /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
>  1361 |         s8 level = TLBI_TTL_UNKNOWN;
>       |                    ^~~~~~~~~~~~~~~~
> 
> 
> Caused by commit
> 
>    100baf0184896 (KVM: arm64: Ensure level is always initialized when relaxing perms)
> 
> I imagine this will cause an allyesconfig build failure when I get to
> that due to -Werror.

Crap, I don't know how I missed that one! And the whole thing is
pretty dodgy anyway:

- level starts as s8
- passed to __kvm_tlb_flush_vmid_ipa_nsh() as int
- passed to __tlbi_level() as u32
- compared to the value 3

The problem is that we are conflating the level of a descriptor and
the TTL, which may or may not be related.

I'm minded to queue something like this on top. Oliver?

Thanks for the heads up,

	M.

diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 8754c99c22f2f..70dceb20dfada 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp/pgtable.c
@@ -1356,7 +1356,7 @@ int kvm_pgtable_stage2_relax_perms(struct kvm_pgtable *pgt, u64 addr,
 				   enum kvm_pgtable_prot prot, enum kvm_pgtable_walk_flags flags)
 {
 	kvm_pte_t xn = 0, set = 0, clr = 0;
-	s8 level = TLBI_TTL_UNKNOWN;
+	s8 level;
 	int ret;
 
 	if (prot & KVM_PTE_LEAF_ATTR_HI_SW)
@@ -1379,7 +1379,8 @@ int kvm_pgtable_stage2_relax_perms(struct kvm_pgtable *pgt, u64 addr,
 
 	ret = stage2_update_leaf_attrs(pgt, addr, 1, set, clr, NULL, &level, flags);
 	if (!ret || ret == -EAGAIN)
-		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, pgt->mmu, addr, level);
+		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, pgt->mmu, addr,
+			     (ret == -EAGAIN) ? TLBI_TTL_UNKNOWN : level);
 	return ret;
 }
 

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: linux-next: build warnings after merge of the kvm-arm-fixes tree
  2026-07-07 13:17 ` linux-next: build warnings after merge of the kvm-arm-fixes tree Marc Zyngier
@ 2026-07-07 15:44   ` Oliver Upton
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Upton @ 2026-07-07 15:44 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Mark Brown, Linux Kernel Mailing List, Linux Next Mailing List

On Tue, Jul 07, 2026 at 02:17:20PM +0100, Marc Zyngier wrote:
> On Tue, 07 Jul 2026 13:11:55 +0100,
> Mark Brown <broonie@kernel.org> wrote:
> > 
> > Hi all,
> > 
> > After merging the kvm-arm-fixes tree, today's linux-next build
> > (arm64 defconfig) started generating warnings:
> > 
> > In file included from /tmp/next/build/include/linux/limits.h:7,
> >                  from /tmp/next/build/include/linux/overflow.h:6,
> >                  from /tmp/next/build/include/linux/bits.h:32,
> >                  from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
> >                  from /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:11:
> > /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
> > /tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
> >     8 | #define INT_MAX         ((int)(~0U >> 1))
> >       |                         ^
> > /tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
> >   131 | #define TLBI_TTL_UNKNOWN        INT_MAX
> >       |                                 ^~~~~~~
> > /tmp/next/build/arch/arm64/kvm/hyp/pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
> >  1361 |         s8 level = TLBI_TTL_UNKNOWN;
> >       |                    ^~~~~~~~~~~~~~~~
> > In file included from /tmp/next/build/include/linux/limits.h:7,
> >                  from /tmp/next/build/include/linux/overflow.h:6,
> >                  from /tmp/next/build/include/linux/bits.h:32,
> >                  from /tmp/next/build/arch/arm64/include/asm/kvm_pgtable.h:10,
> >                  from /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:11:
> > /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c: In function 'kvm_pgtable_stage2_relax_perms':
> > /tmp/next/build/include/vdso/limits.h:8:25: warning: overflow in conversion from 'int' to 's8' {aka 'signed char'} changes value from '2147483647' to '-1' [-Woverflow]
> >     8 | #define INT_MAX         ((int)(~0U >> 1))
> >       |                         ^
> > /tmp/next/build/arch/arm64/include/asm/tlbflush.h:131:33: note: in expansion of macro 'INT_MAX'
> >   131 | #define TLBI_TTL_UNKNOWN        INT_MAX
> >       |                                 ^~~~~~~
> > /tmp/next/build/arch/arm64/kvm/hyp/nvhe/../pgtable.c:1361:20: note: in expansion of macro 'TLBI_TTL_UNKNOWN'
> >  1361 |         s8 level = TLBI_TTL_UNKNOWN;
> >       |                    ^~~~~~~~~~~~~~~~
> > 
> > 
> > Caused by commit
> > 
> >    100baf0184896 (KVM: arm64: Ensure level is always initialized when relaxing perms)
> > 
> > I imagine this will cause an allyesconfig build failure when I get to
> > that due to -Werror.
> 
> Crap, I don't know how I missed that one! And the whole thing is
> pretty dodgy anyway:
> 
> - level starts as s8
> - passed to __kvm_tlb_flush_vmid_ipa_nsh() as int
> - passed to __tlbi_level() as u32
> - compared to the value 3
> 
> The problem is that we are conflating the level of a descriptor and
> the TTL, which may or may not be related.
> 
> I'm minded to queue something like this on top. Oliver?
> 
> Thanks for the heads up,
> 
> 	M.
> 
> diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
> index 8754c99c22f2f..70dceb20dfada 100644
> --- a/arch/arm64/kvm/hyp/pgtable.c
> +++ b/arch/arm64/kvm/hyp/pgtable.c
> @@ -1356,7 +1356,7 @@ int kvm_pgtable_stage2_relax_perms(struct kvm_pgtable *pgt, u64 addr,
>  				   enum kvm_pgtable_prot prot, enum kvm_pgtable_walk_flags flags)
>  {
>  	kvm_pte_t xn = 0, set = 0, clr = 0;
> -	s8 level = TLBI_TTL_UNKNOWN;
> +	s8 level;
>  	int ret;
>  
>  	if (prot & KVM_PTE_LEAF_ATTR_HI_SW)
> @@ -1379,7 +1379,8 @@ int kvm_pgtable_stage2_relax_perms(struct kvm_pgtable *pgt, u64 addr,
>  
>  	ret = stage2_update_leaf_attrs(pgt, addr, 1, set, clr, NULL, &level, flags);
>  	if (!ret || ret == -EAGAIN)
> -		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, pgt->mmu, addr, level);
> +		kvm_call_hyp(__kvm_tlb_flush_vmid_ipa_nsh, pgt->mmu, addr,
> +			     (ret == -EAGAIN) ? TLBI_TTL_UNKNOWN : level);

Looks good, sorry for the mess.

Reviewed-by: Oliver Upton <oupton@kernel.org>

Thanks,
Oliver

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-07 15:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 12:11 linux-next: build warnings after merge of the kvm-arm-fixes tree Mark Brown
2026-07-07 12:58 ` linux-next: Build failure in the final build Mark Brown
2026-07-07 13:17 ` linux-next: build warnings after merge of the kvm-arm-fixes tree Marc Zyngier
2026-07-07 15:44   ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox