Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3279460rwd; Sat, 3 Jun 2023 02:08:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6OZQYqZLCqNLJG6fz0uD4T7g2+BkSViDgla90egvBKZ4SXbkfnmNcfqUMuBhk/W5SU6qzc X-Received: by 2002:aca:1817:0:b0:398:5cf3:b95b with SMTP id h23-20020aca1817000000b003985cf3b95bmr2561339oih.22.1685783319762; Sat, 03 Jun 2023 02:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685783319; cv=none; d=google.com; s=arc-20160816; b=kLHCHn6ANPk3Ql8WWsGr6CZnBc+df5ehxc22Bpy/S71bqro1qzH2acEI2RFnTzvEfa Dma/Hijnisp1d5m8JTTftt8bU1rX2mDDSjaw0nqV0LKW6wzO920VxR+0RLB3SbY9BRhP I6E8VKa+q1RYi3UQKAOMz1jeloY20RYB1tD5nyygeUEC3JuzVavwAMzQBXls3kaA2WPb BUriY8IwK4ml5KG4kUsw1hBiSQtCw/HL7qZhCuqaOD6X0+EQEbWg3grTkSrSbTiXuuUl r8rFAl/ZXsjBMHT/dH2AG/G3kRbC2wFe8hFzI1gJVCMA5r0mPmXnHarnPcq5uQBGevO7 b+iQ== 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=SzR/HRnLdQ4cieT+ZcSUi6b4ymvKvYiNXAgXv+hYzN4=; b=dw91/1E79HQPbcBLqZ25UCp1KyFC4uPWrNia/yQiFKmBqojHwCeNOV7eLR7aLalnuN DNptu80cc3T2gIUCyBlD+xkKW3UshqiiHTcs5Kvoe4VJ0IqNlJBGQ8HzygmhSvgg4Jan F/a0WO800Jmch0TFVA5Uhy5Hr6jUoGAg//pnA7RtLZFwYeOjO6cYQnFGDGvy+qoUQjf1 dbrJn8M8l4toOXll6ovkCCkS9iwb0WFBnswXB8BteMtJD+rCx15GRIWCbtjcMWt+8eGB 7ZpXseyONzr8ctx7lNC6FdarynW0rJiHiQCqWSpwFV6XhoJ0GNijhtWlSthpSM+rtuSd 4F7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mm+X73c1; 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 6-20020a170902ee4600b001afd000029bsi2194201plo.581.2023.06.03.02.08.27; Sat, 03 Jun 2023 02:08:39 -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=Mm+X73c1; 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 S231566AbjFCIZa (ORCPT + 99 others); Sat, 3 Jun 2023 04:25:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbjFCIZ3 (ORCPT ); Sat, 3 Jun 2023 04:25:29 -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 6B8F099 for ; Sat, 3 Jun 2023 01:25:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F2E1D611EC for ; Sat, 3 Jun 2023 08:25:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A3F6C433EF; Sat, 3 Jun 2023 08:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685780727; bh=lrvIs143i3Pxz9r3Gm1Pr/kZAvhZhs6EQjK8HuL5Hq8=; h=From:To:Cc:Subject:Date:From; b=Mm+X73c1lFTTQZd0++r5kHtOj2KwE4AlVFnKwX8vmWlsIJzDA5hkKh9Y2ivj4zen/ PYiwHAHN/62HD51t0JyFvh5KKgHiQlCOrhS5dTqGX6tpJJaCxNbMoaUwwMnffYTPU6 IVC2rUpvVxmb2tthg3IOKu2j1ge+DnJ8FzDgkeE++DJAoQrQ4c4WpIO60WYkUbOXIa 0evwKYuBW0+/ohnoKtDOSqI95j/Cou+V6r7QtMtqI+o6ekFlV2BRA1Rtw6W/BSxhbz OBJuwMk/CtcwfRJYymwq85wN6gnhPkH9AJLtVcDCLd+zu4fGIqJozhMivtBVIaVXxJ 2cxDB4phNc2pg== 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 1q5MZg-002WkT-Vv; Sat, 03 Jun 2023 09:25:25 +0100 From: Marc Zyngier To: linux-kernel@vger.kernel.org Cc: Reiji Watanabe , Peter Zijlstra , Mark Rutland , Will Deacon Subject: [PATCH] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Date: Sat, 3 Jun 2023 09:25:19 +0100 Message-Id: <20230603082519.1088285-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, reijiw@google.com, peterz@infradead.org, mark.rutland@arm.com, 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.6 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. Reported-by: Reiji Watanabe Signed-off-by: Marc Zyngier Cc: Peter Zijlstra Cc: Mark Rutland 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