All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype
@ 2023-06-03  8:25 Marc Zyngier
  2023-06-04 16:08 ` Reiji Watanabe
  2023-06-12 13:16 ` Mark Rutland
  0 siblings, 2 replies; 7+ messages in thread
From: Marc Zyngier @ 2023-06-03  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Reiji Watanabe, Peter Zijlstra, Mark Rutland, 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.

Reported-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>
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] 7+ messages in thread

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-03  8:25 [PATCH] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Marc Zyngier
2023-06-04 16:08 ` Reiji Watanabe
2023-06-12 13:16 ` Mark Rutland
2023-06-12 14:16   ` Marc Zyngier
2023-06-12 14:54   ` Peter Zijlstra
2023-06-12 15:03     ` Marc Zyngier
2023-06-16  9:06       ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.