linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the tip tree
@ 2025-11-12  4:42 Stephen Rothwell
  2025-11-12  5:20 ` Mi, Dapeng
  2025-11-12  9:39 ` linux-next: build failure after merge of the tip tree Peter Zijlstra
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Rothwell @ 2025-11-12  4:42 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
  Cc: Dapeng Mi, Kan Liang, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

After merging the tip tree, today's linux-next build (i386 defconfig)
failed like this:

arch/x86/events/intel/ds.c: In function 'intel_pmu_drain_arch_pebs':
arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
      |                        ^
arch/x86/events/intel/ds.c:2983:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
 2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
      |               ^
cc1: all warnings being treated as errors

Caused by commit

  d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")

I have reverted commits

  2093d8cf80fa ("perf/x86/intel: Optimize PEBS extended config")
  02da693f6658 ("perf/x86/intel: Check PEBS dyn_constraints")
  bd24f9beed59 ("perf/x86/intel: Add a check for dynamic constraints")
  bb5f13df3c45 ("perf/x86/intel: Add counter group support for arch-PEBS")
  52448a0a7390 ("perf/x86/intel: Setup PEBS data configuration and enable legacy groups")
  e89c5d1f290e ("perf/x86/intel: Update dyn_constraint base on PEBS event precise level")
  2721e8da2de7 ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR")
  d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")

for today.

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the tip tree
  2025-11-12  4:42 linux-next: build failure after merge of the tip tree Stephen Rothwell
@ 2025-11-12  5:20 ` Mi, Dapeng
  2025-11-12 10:09   ` [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use Ingo Molnar
  2025-11-12  9:39 ` linux-next: build failure after merge of the tip tree Peter Zijlstra
  1 sibling, 1 reply; 9+ messages in thread
From: Mi, Dapeng @ 2025-11-12  5:20 UTC (permalink / raw)
  To: Stephen Rothwell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Peter Zijlstra
  Cc: Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List


On 11/12/2025 12:42 PM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the tip tree, today's linux-next build (i386 defconfig)
> failed like this:
>
> arch/x86/events/intel/ds.c: In function 'intel_pmu_drain_arch_pebs':
> arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
>       |                        ^
> arch/x86/events/intel/ds.c:2983:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
>       |               ^
> cc1: all warnings being treated as errors

Thanks for reporting the issue. I suppose the below patch would fix the
building error. I would post it as an independent patch later.

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index c93bf971d97b..f695de9f7049 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -2979,7 +2979,7 @@ static void intel_pmu_drain_arch_pebs(struct pt_regs
*iregs,
        }

        base = cpuc->pebs_vaddr;
-       top = (void *)((u64)cpuc->pebs_vaddr +
+       top = (void *)((unsigned long)cpuc->pebs_vaddr +
                       (index.wr << ARCH_PEBS_INDEX_WR_SHIFT));

        index.wr = 0;


>
> Caused by commit
>
>   d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")
>
> I have reverted commits
>
>   2093d8cf80fa ("perf/x86/intel: Optimize PEBS extended config")
>   02da693f6658 ("perf/x86/intel: Check PEBS dyn_constraints")
>   bd24f9beed59 ("perf/x86/intel: Add a check for dynamic constraints")
>   bb5f13df3c45 ("perf/x86/intel: Add counter group support for arch-PEBS")
>   52448a0a7390 ("perf/x86/intel: Setup PEBS data configuration and enable legacy groups")
>   e89c5d1f290e ("perf/x86/intel: Update dyn_constraint base on PEBS event precise level")
>   2721e8da2de7 ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR")
>   d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")
>
> for today.
>

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

* Re: linux-next: build failure after merge of the tip tree
  2025-11-12  4:42 linux-next: build failure after merge of the tip tree Stephen Rothwell
  2025-11-12  5:20 ` Mi, Dapeng
@ 2025-11-12  9:39 ` Peter Zijlstra
  2025-11-12 10:45   ` Stephen Rothwell
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2025-11-12  9:39 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Dapeng Mi,
	Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Nov 12, 2025 at 03:42:00PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the tip tree, today's linux-next build (i386 defconfig)
> failed like this:
> 
> arch/x86/events/intel/ds.c: In function 'intel_pmu_drain_arch_pebs':
> arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
>       |                        ^
> arch/x86/events/intel/ds.c:2983:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
>       |               ^
> cc1: all warnings being treated as errors
> 
> Caused by commit
> 
>   d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")
> 

It appears you're way faster than the build robots :/

I'll go fix. Thanks!

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

* [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use
  2025-11-12  5:20 ` Mi, Dapeng
@ 2025-11-12 10:09   ` Ingo Molnar
  2025-11-12 10:36     ` Mi, Dapeng
  0 siblings, 1 reply; 9+ messages in thread
From: Ingo Molnar @ 2025-11-12 10:09 UTC (permalink / raw)
  To: Mi, Dapeng
  Cc: Stephen Rothwell, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List


* Mi, Dapeng <dapeng1.mi@linux.intel.com> wrote:

> 
> On 11/12/2025 12:42 PM, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the tip tree, today's linux-next build (i386 defconfig)
> > failed like this:
> >
> > arch/x86/events/intel/ds.c: In function 'intel_pmu_drain_arch_pebs':
> > arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> >  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
> >       |                        ^
> > arch/x86/events/intel/ds.c:2983:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> >  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
> >       |               ^
> > cc1: all warnings being treated as errors
> 
> Thanks for reporting the issue. I suppose the below patch would fix the
> building error. I would post it as an independent patch later.
> 
> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> index c93bf971d97b..f695de9f7049 100644
> --- a/arch/x86/events/intel/ds.c
> +++ b/arch/x86/events/intel/ds.c
> @@ -2979,7 +2979,7 @@ static void intel_pmu_drain_arch_pebs(struct pt_regs
> *iregs,
>         }
> 
>         base = cpuc->pebs_vaddr;
> -       top = (void *)((u64)cpuc->pebs_vaddr +
> +       top = (void *)((unsigned long)cpuc->pebs_vaddr +
>                        (index.wr << ARCH_PEBS_INDEX_WR_SHIFT));

This doesn't really address the core issue: ugly, fragile code due to 
type confusion. The proper fix is:

	top = cpuc->pebs_vaddr + (index.wr << ARCH_PEBS_INDEX_WR_SHIFT);

which is also much cleaner, see:

	60f9f1d43720 ("perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use")

(also attached below.)

All this should be resolved in the latest -tip tree.

Thanks,

	Ingo

=====================>
From 60f9f1d437201f6c457fc8a56f9df6d8a6d0bea6 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@kernel.org>
Date: Wed, 12 Nov 2025 10:40:26 +0100
Subject: [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use

The following commit introduced a build failure on x86-32:

  2721e8da2de7 ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR")

  ...

  arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

The forced type conversion to 'u64' and 'void *' are not 32-bit clean,
but they are also entirely unnecessary: ->pebs_vaddr is 'void *' already,
and integer-compatible pointer arithmetics will work just fine on it.

Fix & simplify the code.

Fixes: 2721e8da2de7 ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://patch.msgid.link/20251029102136.61364-10-dapeng1.mi@linux.intel.com
---
 arch/x86/events/intel/ds.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index c93bf971d97b..2e170f2093ac 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -2979,8 +2979,7 @@ static void intel_pmu_drain_arch_pebs(struct pt_regs *iregs,
 	}
 
 	base = cpuc->pebs_vaddr;
-	top = (void *)((u64)cpuc->pebs_vaddr +
-		       (index.wr << ARCH_PEBS_INDEX_WR_SHIFT));
+	top = cpuc->pebs_vaddr + (index.wr << ARCH_PEBS_INDEX_WR_SHIFT);
 
 	index.wr = 0;
 	index.full = 0;

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

* Re: [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use
  2025-11-12 10:09   ` [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use Ingo Molnar
@ 2025-11-12 10:36     ` Mi, Dapeng
  2025-11-12 11:14       ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: Mi, Dapeng @ 2025-11-12 10:36 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Stephen Rothwell, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List


On 11/12/2025 6:09 PM, Ingo Molnar wrote:
> * Mi, Dapeng <dapeng1.mi@linux.intel.com> wrote:
>
>> On 11/12/2025 12:42 PM, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> After merging the tip tree, today's linux-next build (i386 defconfig)
>>> failed like this:
>>>
>>> arch/x86/events/intel/ds.c: In function 'intel_pmu_drain_arch_pebs':
>>> arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>>>  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
>>>       |                        ^
>>> arch/x86/events/intel/ds.c:2983:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>>  2983 |         top = (void *)((u64)cpuc->pebs_vaddr +
>>>       |               ^
>>> cc1: all warnings being treated as errors
>> Thanks for reporting the issue. I suppose the below patch would fix the
>> building error. I would post it as an independent patch later.
>>
>> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
>> index c93bf971d97b..f695de9f7049 100644
>> --- a/arch/x86/events/intel/ds.c
>> +++ b/arch/x86/events/intel/ds.c
>> @@ -2979,7 +2979,7 @@ static void intel_pmu_drain_arch_pebs(struct pt_regs
>> *iregs,
>>         }
>>
>>         base = cpuc->pebs_vaddr;
>> -       top = (void *)((u64)cpuc->pebs_vaddr +
>> +       top = (void *)((unsigned long)cpuc->pebs_vaddr +
>>                        (index.wr << ARCH_PEBS_INDEX_WR_SHIFT));
> This doesn't really address the core issue: ugly, fragile code due to 
> type confusion. The proper fix is:
>
> 	top = cpuc->pebs_vaddr + (index.wr << ARCH_PEBS_INDEX_WR_SHIFT);
>
> which is also much cleaner, see:
>
> 	60f9f1d43720 ("perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use")
>
> (also attached below.)
>
> All this should be resolved in the latest -tip tree.
>
> Thanks,
>
> 	Ingo
>
> =====================>
> From 60f9f1d437201f6c457fc8a56f9df6d8a6d0bea6 Mon Sep 17 00:00:00 2001
> From: Ingo Molnar <mingo@kernel.org>
> Date: Wed, 12 Nov 2025 10:40:26 +0100
> Subject: [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use
>
> The following commit introduced a build failure on x86-32:
>
>   2721e8da2de7 ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR")
>
>   ...
>
>   arch/x86/events/intel/ds.c:2983:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>
> The forced type conversion to 'u64' and 'void *' are not 32-bit clean,
> but they are also entirely unnecessary: ->pebs_vaddr is 'void *' already,
> and integer-compatible pointer arithmetics will work just fine on it.
>
> Fix & simplify the code.
>
> Fixes: 2721e8da2de7 ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR")

Hi Ingo,

Thanks a lot for fixing this issue.

BTW, the offensive commit should be the below one instead of '2721e8da2de7
("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR") '.

d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")

- Dapeng Mi

> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
> Link: https://patch.msgid.link/20251029102136.61364-10-dapeng1.mi@linux.intel.com
> ---
>  arch/x86/events/intel/ds.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
> index c93bf971d97b..2e170f2093ac 100644
> --- a/arch/x86/events/intel/ds.c
> +++ b/arch/x86/events/intel/ds.c
> @@ -2979,8 +2979,7 @@ static void intel_pmu_drain_arch_pebs(struct pt_regs *iregs,
>  	}
>  
>  	base = cpuc->pebs_vaddr;
> -	top = (void *)((u64)cpuc->pebs_vaddr +
> -		       (index.wr << ARCH_PEBS_INDEX_WR_SHIFT));
> +	top = cpuc->pebs_vaddr + (index.wr << ARCH_PEBS_INDEX_WR_SHIFT);
>  
>  	index.wr = 0;
>  	index.full = 0;

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

* Re: linux-next: build failure after merge of the tip tree
  2025-11-12  9:39 ` linux-next: build failure after merge of the tip tree Peter Zijlstra
@ 2025-11-12 10:45   ` Stephen Rothwell
  2025-11-12 10:48     ` Peter Zijlstra
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2025-11-12 10:45 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Dapeng Mi,
	Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List

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

Hi Peter,

On Wed, 12 Nov 2025 10:39:28 +0100 Peter Zijlstra <peterz@infradead.org> wrote:
> 
> It appears you're way faster than the build robots :/

I was hoping people would put their code through the robots (or some
local unit testing) before publishing it in their linux-next included
branches ... ;-)

> I'll go fix. Thanks!

Thanks.  (there was a patch sent in case you missed it)

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the tip tree
  2025-11-12 10:45   ` Stephen Rothwell
@ 2025-11-12 10:48     ` Peter Zijlstra
  2025-11-12 12:31       ` Mi, Dapeng
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Zijlstra @ 2025-11-12 10:48 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Dapeng Mi,
	Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Nov 12, 2025 at 09:45:15PM +1100, Stephen Rothwell wrote:
> Hi Peter,
> 
> On Wed, 12 Nov 2025 10:39:28 +0100 Peter Zijlstra <peterz@infradead.org> wrote:
> > 
> > It appears you're way faster than the build robots :/
> 
> I was hoping people would put their code through the robots (or some
> local unit testing) before publishing it in their linux-next included
> branches ... ;-)

I do, but sometimes they just take forever :/ And clearly I don't do
i386 builds myself.

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

* Re: [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use
  2025-11-12 10:36     ` Mi, Dapeng
@ 2025-11-12 11:14       ` Ingo Molnar
  0 siblings, 0 replies; 9+ messages in thread
From: Ingo Molnar @ 2025-11-12 11:14 UTC (permalink / raw)
  To: Mi, Dapeng
  Cc: Stephen Rothwell, Thomas Gleixner, H. Peter Anvin, Peter Zijlstra,
	Kan Liang, Linux Kernel Mailing List, Linux Next Mailing List


* Mi, Dapeng <dapeng1.mi@linux.intel.com> wrote:

> BTW, the offensive commit should be the below one instead of '2721e8da2de7
> ("perf/x86/intel: Allocate arch-PEBS buffer and initialize PEBS_BASE MSR") '.
> 
> d21954c8a0ff ("perf/x86/intel: Process arch-PEBS records or record fragments")

Indeed, this is the one that introduced it - I fixed 
the changelog and updated the tags.

Thanks,

	Ingo

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

* Re: linux-next: build failure after merge of the tip tree
  2025-11-12 10:48     ` Peter Zijlstra
@ 2025-11-12 12:31       ` Mi, Dapeng
  0 siblings, 0 replies; 9+ messages in thread
From: Mi, Dapeng @ 2025-11-12 12:31 UTC (permalink / raw)
  To: Peter Zijlstra, Stephen Rothwell
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Kan Liang,
	Linux Kernel Mailing List, Linux Next Mailing List


On 11/12/2025 6:48 PM, Peter Zijlstra wrote:
> On Wed, Nov 12, 2025 at 09:45:15PM +1100, Stephen Rothwell wrote:
>> Hi Peter,
>>
>> On Wed, 12 Nov 2025 10:39:28 +0100 Peter Zijlstra <peterz@infradead.org> wrote:
>>> It appears you're way faster than the build robots :/
>> I was hoping people would put their code through the robots (or some
>> local unit testing) before publishing it in their linux-next included
>> branches ... ;-)
> I do, but sometimes they just take forever :/ And clearly I don't do
> i386 builds myself.

This issue educates me. I would add i386 arch building into my BAT test list. 



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

end of thread, other threads:[~2025-11-12 12:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12  4:42 linux-next: build failure after merge of the tip tree Stephen Rothwell
2025-11-12  5:20 ` Mi, Dapeng
2025-11-12 10:09   ` [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use Ingo Molnar
2025-11-12 10:36     ` Mi, Dapeng
2025-11-12 11:14       ` Ingo Molnar
2025-11-12  9:39 ` linux-next: build failure after merge of the tip tree Peter Zijlstra
2025-11-12 10:45   ` Stephen Rothwell
2025-11-12 10:48     ` Peter Zijlstra
2025-11-12 12:31       ` Mi, Dapeng

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).