Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2553291rwd; Fri, 16 Jun 2023 05:23:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VBoV5YdCCzePk8vf36DAB4Wqv6AtVZ3olmFYhr1OZjs5VvxR/954/Udei8tbU8cfch+hu X-Received: by 2002:a17:902:f688:b0:1b3:d4d5:beb2 with SMTP id l8-20020a170902f68800b001b3d4d5beb2mr2348850plg.9.1686918236943; Fri, 16 Jun 2023 05:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686918236; cv=none; d=google.com; s=arc-20160816; b=eT2UDn8QROsE0rE9q4S9mNdaEHZouKKD+0nDIwaTPk50TqxxcHWXk4Bo2heDt8P1wO 3BKk2gkYUM1AABBZ+RedAXp7inQBD5cy5DCiUDLC0XwKgCaVUIFOiVoUrVZzFvvWv6mP nHcnXjxJRR9M9qyVnMlBDKL3yrUIyCurbExeiKn2Fy6Gn3JY5YgxeZbTjAK5SRdlOqfe f1ZtHg8m05txaIawiZqE+KXRO0L7ZzK/dS2vzhSw9vhC7ro9fUBdcG+ndhlQX/hncUiT ZbsRzSfGTXJUZIfAkud4LcBtcM0YA9DDvpoKYbIj7CIdGGxlWUL4mXwlDvEQh4MY5+xe Iu8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=00V0x6MMpmc4e3BZsgK+48TKZ7D96FT35BctVRdMApA=; b=PwzDoREWvS5IERdD+WRXKz9aKBMQqsl276DqlAJTGuROUTh2AWjw2ienR3mIFsJWPx jROVKn4SLxtRlvhunbWiuaaQGEFbsXj4S8KhoC/JQPMXzkY43GFT8iyYjB5zVU9cFIyR dTkaGiYIC4grWPCTQiAq0bv0dHfCGoIA6et+ysI7RzUeGAaBEz2uJ6jdXFFp9G5YC3KM bk/C6XF9yXS5sUfNDbsbkL3i7U7xYpjBjoygRA68h4qY3xhqCPR43nMp7oiWU0sx+FSh BTueub+n6HngfTaSvRJoVdknhvEsbNj2IOXFYJahWw7SQBO5f9/murxyi2vGM18BF0/p dTAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jVkRInUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v20-20020a170902d09400b001b51183cef3si3844454plv.214.2023.06.16.05.23.43; Fri, 16 Jun 2023 05:23:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jVkRInUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343977AbjFPLso (ORCPT + 99 others); Fri, 16 Jun 2023 07:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235280AbjFPLsm (ORCPT ); Fri, 16 Jun 2023 07:48:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D49191 for ; Fri, 16 Jun 2023 04:48:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A53D638DA for ; Fri, 16 Jun 2023 11:48:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C068C433C0; Fri, 16 Jun 2023 11:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686916120; bh=q8zXtUv9hy9X0y/wzby7xPIW3uL2bcOG79ydvcjq300=; h=From:To:Cc:Subject:Date:From; b=jVkRInUk+1ehbvKPtYZBjtWIowHXhiHpylM3y/LipyiRPnpY8owiFPU1YF+rGGkrO QtucpA923pIs1OWWNUGmoYcqslT99rx3ZzPpQdM6mO955CxobHN4z0khrWTKQkzw3W SJ2Xbmt9bmEmXY65EUDsV6vGr6AQ7JVBKGciMd75OBJeNYKHKhbXvVqXvP0nS3ZwGc 16Dl7pegI1Gx7V27RE2ADhDyupCcpEcSEXjwN0he8mUhKqMeR/BPz3TpDYeSj9BqcV 4zQyCTUgYNShwbiXt2WeEymP8Maapoh9ok/qwlzIXZxVSNbz9jHGcm9djX2X5YGqn4 raNxThhyXeckA== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qA7wU-005sLm-6V; Fri, 16 Jun 2023 12:48:38 +0100 From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Reiji Watanabe , Mark Rutland , Peter Zijlstra , Will Deacon Subject: [PATCH v2] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Date: Fri, 16 Jun 2023 12:48:31 +0100 Message-Id: <20230616114831.3186980-1-maz@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, reijiw@google.com, mark.rutland@arm.com, peterz@infradead.org, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Tested-by: Reiji Watanabe Acked-by: Mark Rutland Signed-off-by: Marc Zyngier Cc: Peter Zijlstra Cc: Will Deacon --- 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