Skip to contentSkip to conversation

linux-next: build failure after merge of the tip tree

PATCH In review Stephen Rothwell 4 participants 9 messages Nov 12, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Hi all,

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

Quoted 8 lines

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.

arch/x86/events/intel/ds.c +0 -0
index c93bf971d97b..f695de9f7049 100644
@@ -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;

Quoted 18 lines

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.

#2 lore raw

PATCH 1/1 perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use

Quoted 24 lines · Mi, Dapeng
Quoted 5 lines · Stephen Rothwell

Hi all,

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

Quoted 8 lines

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.

arch/x86/events/intel/ds.c +0 -0
index c93bf971d97b..f695de9f7049 100644

arch/x86/events/intel/ds.c static void intel_pmu_drain_arch_pebs(struct pt_regs · line 2984

Quoted 7 lines
arch/x86/events/intel/ds.c +1 -1
@@ -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 <[email protected]>
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")
Cc Kan Liang <[email protected]>
Cc Dapeng Mi <[email protected]>
---
 arch/x86/events/intel/ds.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/events/intel/ds.c +1 -2
index c93bf971d97b..2e170f2093ac 100644
@@ -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;
#3 lore raw

Re: [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use

Quoted 62 lines · Ingo Molnar
Quoted 22 lines · Mi, Dapeng
Quoted 5 lines · Stephen Rothwell

Hi all,

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

Quoted 8 lines

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.

arch/x86/events/intel/ds.c +0 -0
index c93bf971d97b..f695de9f7049 100644

arch/x86/events/intel/ds.c static void intel_pmu_drain_arch_pebs(struct pt_regs · line 2984

Quoted 7 lines
arch/x86/events/intel/ds.c +1 -1
@@ -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 <[email protected]>
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]

Quoted 7 lines

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

Quoted 23 lines
---
 arch/x86/events/intel/ds.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/events/intel/ds.c +1 -2
index c93bf971d97b..2e170f2093ac 100644
@@ -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;
#4 lore raw

Re: [PATCH] perf/x86/intel: Fix and clean up intel_pmu_drain_arch_pebs() type use

Quoted 4 lines · Mi, Dapeng

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

maintainer
#5 lore raw
In reply to Stephen Rothwell
Quoted 14 lines · Stephen Rothwell

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

Quoted 4 lines

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!

#6 lore raw

Hi Peter,

Quoted 2 lines · On Wed, 12 Nov 2025 10:39:28 +0100 Peter Zijlstra <[email protected]> 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 ... ;-)

Quoted 1 line

I'll go fix. Thanks!

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

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#7 lore raw
Quoted 9 lines · Stephen Rothwell

Hi Peter,

Quoted 2 lines · On Wed, 12 Nov 2025 10:39:28 +0100 Peter Zijlstra <[email protected]> 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.

#8 lore raw
Quoted 10 lines · Peter Zijlstra
Quoted 7 lines · Stephen Rothwell

Hi Peter,

Quoted 1 line · On Wed, 12 Nov 2025 10:39:28 +0100 Peter Zijlstra <[email protected]> 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.