public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype
@ 2023-06-16 11:48 Marc Zyngier
  2023-06-16 11:57 ` Marc Zyngier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marc Zyngier @ 2023-06-16 11:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Reiji Watanabe, Mark Rutland, Peter Zijlstra, Will Deacon

Reiji reports that the arm64 implementation of arch_perf_update_userpage()
is now ignored and replaced by the dummy stub in core code.
This seems to happen since the PMUv3 driver was moved to driver/perf.

As it turns out, dropping the __weak attribute from the *prototype*
of the function solves the problem. You're right, this doesn't seem
to make much sense. And yet... It appears that both symbols get
flagged as weak, and that the first one to appear in the link order
wins:

$ nm drivers/perf/arm_pmuv3.o|grep arch_perf_update_userpage
0000000000001db0 W arch_perf_update_userpage

Dropping the attribute from the prototype restores the expected
behaviour, and arm64 is able to enjoy arch_perf_update_userpage()
again.

Fixes: 7755cec63ade ("arm64: perf: Move PMUv3 driver to drivers/perf")
Fixes: f1ec3a517b43 ("kernel/events: Add a missing prototype for arch_perf_update_userpage()")
Reported-by: Reiji Watanabe <reijiw@google.com>
Tested-by: Reiji Watanabe <reijiw@google.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
---
 include/linux/perf_event.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index d5628a7b5eaa..c8dcfdbda1f4 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1845,9 +1845,9 @@ int perf_event_exit_cpu(unsigned int cpu);
 #define perf_event_exit_cpu	NULL
 #endif
 
-extern void __weak arch_perf_update_userpage(struct perf_event *event,
-					     struct perf_event_mmap_page *userpg,
-					     u64 now);
+extern void arch_perf_update_userpage(struct perf_event *event,
+				      struct perf_event_mmap_page *userpg,
+				      u64 now);
 
 #ifdef CONFIG_MMU
 extern __weak u64 arch_perf_get_page_size(struct mm_struct *mm, unsigned long addr);
-- 
2.34.1


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

* Re: [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype
  2023-06-16 11:48 [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Marc Zyngier
@ 2023-06-16 11:57 ` Marc Zyngier
  2023-06-16 12:52 ` Peter Zijlstra
  2023-06-16 15:08 ` [tip: perf/urgent] " tip-bot2 for Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2023-06-16 11:57 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Reiji Watanabe, Mark Rutland, Peter Zijlstra, Will Deacon

On 2023-06-16 12:48, Marc Zyngier wrote:
> Reiji reports that the arm64 implementation of 
> arch_perf_update_userpage()
> is now ignored and replaced by the dummy stub in core code.
> This seems to happen since the PMUv3 driver was moved to driver/perf.
> 
> As it turns out, dropping the __weak attribute from the *prototype*
> of the function solves the problem. You're right, this doesn't seem
> to make much sense. And yet... It appears that both symbols get
> flagged as weak, and that the first one to appear in the link order
> wins:
> 
> $ nm drivers/perf/arm_pmuv3.o|grep arch_perf_update_userpage
> 0000000000001db0 W arch_perf_update_userpage
> 
> Dropping the attribute from the prototype restores the expected
> behaviour, and arm64 is able to enjoy arch_perf_update_userpage()
> again.
> 
> Fixes: 7755cec63ade ("arm64: perf: Move PMUv3 driver to drivers/perf")
> Fixes: f1ec3a517b43 ("kernel/events: Add a missing prototype for
> arch_perf_update_userpage()")
> Reported-by: Reiji Watanabe <reijiw@google.com>
> Tested-by: Reiji Watanabe <reijiw@google.com>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Will Deacon <will@kernel.org>

And of course I forgot to pass --notes to git-send-email...

     v2: Added fixes tags, both for the commit that introduce the 
breakage
         on arm64, and for the commit introducing the offending 
prototype.
         I did not Cc stable on purpose, as nothing appears to be broken
         in other architectures.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype
  2023-06-16 11:48 [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Marc Zyngier
  2023-06-16 11:57 ` Marc Zyngier
@ 2023-06-16 12:52 ` Peter Zijlstra
  2023-06-16 15:08 ` [tip: perf/urgent] " tip-bot2 for Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2023-06-16 12:52 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-kernel, linux-arm-kernel, Reiji Watanabe, Mark Rutland,
	Will Deacon

On Fri, Jun 16, 2023 at 12:48:31PM +0100, Marc Zyngier wrote:
> Reiji reports that the arm64 implementation of arch_perf_update_userpage()
> is now ignored and replaced by the dummy stub in core code.
> This seems to happen since the PMUv3 driver was moved to driver/perf.
> 
> As it turns out, dropping the __weak attribute from the *prototype*
> of the function solves the problem. You're right, this doesn't seem
> to make much sense. And yet... It appears that both symbols get
> flagged as weak, and that the first one to appear in the link order
> wins:
> 
> $ nm drivers/perf/arm_pmuv3.o|grep arch_perf_update_userpage
> 0000000000001db0 W arch_perf_update_userpage
> 
> Dropping the attribute from the prototype restores the expected
> behaviour, and arm64 is able to enjoy arch_perf_update_userpage()
> again.
> 
> Fixes: 7755cec63ade ("arm64: perf: Move PMUv3 driver to drivers/perf")
> Fixes: f1ec3a517b43 ("kernel/events: Add a missing prototype for arch_perf_update_userpage()")
> Reported-by: Reiji Watanabe <reijiw@google.com>
> Tested-by: Reiji Watanabe <reijiw@google.com>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Will Deacon <will@kernel.org>

Thanks! in perf/urgent it goes

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

* [tip: perf/urgent] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype
  2023-06-16 11:48 [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Marc Zyngier
  2023-06-16 11:57 ` Marc Zyngier
  2023-06-16 12:52 ` Peter Zijlstra
@ 2023-06-16 15:08 ` tip-bot2 for Marc Zyngier
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Marc Zyngier @ 2023-06-16 15:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Reiji Watanabe, Marc Zyngier, Peter Zijlstra (Intel),
	Mark Rutland, x86, linux-kernel

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     b50f26a44887f3f71ff5457135ee1d5f1d542d7d
Gitweb:        https://git.kernel.org/tip/b50f26a44887f3f71ff5457135ee1d5f1d542d7d
Author:        Marc Zyngier <maz@kernel.org>
AuthorDate:    Fri, 16 Jun 2023 12:48:31 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 16 Jun 2023 16:46:33 +02:00

perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype

Reiji reports that the arm64 implementation of arch_perf_update_userpage()
is now ignored and replaced by the dummy stub in core code.
This seems to happen since the PMUv3 driver was moved to driver/perf.

As it turns out, dropping the __weak attribute from the *prototype*
of the function solves the problem. You're right, this doesn't seem
to make much sense. And yet... It appears that both symbols get
flagged as weak, and that the first one to appear in the link order
wins:

$ nm drivers/perf/arm_pmuv3.o|grep arch_perf_update_userpage
0000000000001db0 W arch_perf_update_userpage

Dropping the attribute from the prototype restores the expected
behaviour, and arm64 is able to enjoy arch_perf_update_userpage()
again.

Fixes: 7755cec63ade ("arm64: perf: Move PMUv3 driver to drivers/perf")
Fixes: f1ec3a517b43 ("kernel/events: Add a missing prototype for arch_perf_update_userpage()")
Reported-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Reiji Watanabe <reijiw@google.com>
Link: https://lkml.kernel.org/r/20230616114831.3186980-1-maz@kernel.org
---
 include/linux/perf_event.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index d5628a7..c8dcfdb 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1845,9 +1845,9 @@ int perf_event_exit_cpu(unsigned int cpu);
 #define perf_event_exit_cpu	NULL
 #endif
 
-extern void __weak arch_perf_update_userpage(struct perf_event *event,
-					     struct perf_event_mmap_page *userpg,
-					     u64 now);
+extern void arch_perf_update_userpage(struct perf_event *event,
+				      struct perf_event_mmap_page *userpg,
+				      u64 now);
 
 #ifdef CONFIG_MMU
 extern __weak u64 arch_perf_get_page_size(struct mm_struct *mm, unsigned long addr);

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

end of thread, other threads:[~2023-06-16 15:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 11:48 [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Marc Zyngier
2023-06-16 11:57 ` Marc Zyngier
2023-06-16 12:52 ` Peter Zijlstra
2023-06-16 15:08 ` [tip: perf/urgent] " tip-bot2 for Marc Zyngier

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