From patchwork Tue Jan 30 14:31:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 194183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1260027dyb; Tue, 30 Jan 2024 06:32:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPbOxtOEdI8mPHgM517/2n0Wo4PDrNUfmv5+tOS9eQ7cfWMwhhigRxJzTxr7dE5GIZ+/Mi X-Received: by 2002:a17:906:9ac9:b0:a27:6615:15ed with SMTP id ah9-20020a1709069ac900b00a27661515edmr6021438ejc.42.1706625149360; Tue, 30 Jan 2024 06:32:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706625149; cv=pass; d=google.com; s=arc-20160816; b=Pkh8bE4q038C1GknNS4gKrBx21aZHRF+Srt3xErgHUVUsHzP3ejdBVSS109YaTEYnm QOwaU2H2OWFqFg3n5zaEB0PMTgehTKYZ+i/F7+y/ZrFHnC8B8C2ktUyc7PxzrdQlU/T4 nc6Cx6uBYZqXCkZZy4lWlO5RBUX7drfWRo71SmMx9IKzrg/5ZBzDGLawjHOOFKEahi0W UewErZoSfGYmb3YwHXX093ovy8jYCqDmyJzSQBRf5h08eGU2pgzM0yzS12ZW1qr3Dxyv /5JFnTlDJHTh9NGMa3laPAer8TTiwIUwz27w33XJFBEU3cnR1+UDe+M92Ejb3qTEILnq 4QTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=bLfj0Ef7bPkEXzPsHS3BfIyb1omCK4woZWCjkzcZiqU=; fh=AxOVKou+iNrXlbDBKm0gFt6q1F1R+hVjWcnU63smpho=; b=IMwVvBAj43sr0h1DXr1n54UGPJkBNGmBqu4ErowNUWVWy1gU7PPA2CJ7Q6rTOp5/02 +vhyQzvk6L4LsA2wiuLNXZ0hhGwo6N7+QJ4mGl95AbgyM03tkzBsAHpZqusY9hahjp7K 7jwINKuasR5Ieu7tLr65aghbSaaoa3rVcAq9e+88KMlx+GZkfVev9WV9i0XRHsTQF1yQ RasZO/hxsFevn405l2ABuhxRk8O7B+iMlFbLS17GdaRBKbmdIywer8UCSIThnULGZbJz gL88jLi80dgzJgllniqzTlXMiVFsUGCWtkn5JSVw7dhf92DpEctzHG2kVmY0dtD5C2G0 XyPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P3B9X272; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44751-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p15-20020a170906784f00b00a31846f2263si4331107ejm.793.2024.01.30.06.32.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 06:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44751-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P3B9X272; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44751-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 086211F27A49 for ; Tue, 30 Jan 2024 14:31:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A539D74E1F; Tue, 30 Jan 2024 14:31:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P3B9X272" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACD6254F94 for ; Tue, 30 Jan 2024 14:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706625069; cv=none; b=CQN4QrnSTRoAXVypB5gauu4ljiza7UIIz+apAwARxJe0eDNjS2Ia22vRLPwyINJZ17DLRIqpudyvfpDcewj1mEC+oCLWyIzrMsQYcy+n47Ebkb6lVFy2HS5Kl/RY9ZQZ2WZ5bRMjMcWUdiMl4BzuPZNIIxcUCFDLKP/ENcSEFqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706625069; c=relaxed/simple; bh=goKGDmqmVPKlqXB4S62+LaT1lrjL5vNzL0WYpX6Rlyk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=mrJajfcfp7t86+Xa3LI7lDVpCsZJPUP0dat2Qr1uhOWcmNH5YIZ7zxSQ/kZzDHqWCkp4ZEDeEzEco0igqBB6qBgEYApU7JZnel5T4CqdPXzXftcyZ4DvXh6766z0Ja0REAeiYwprMkciF2WP7mrLkNiBGEg4vq92Jpxna0Ee8e8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P3B9X272; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0976AC433F1; Tue, 30 Jan 2024 14:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706625069; bh=goKGDmqmVPKlqXB4S62+LaT1lrjL5vNzL0WYpX6Rlyk=; h=Date:From:To:Cc:Subject:From; b=P3B9X272OjEYEFanPsmcXo/WM2zzjsXjopvMZTritP85EbbGdewMiVgt3VVFwvDsg HUkIOZhv9GFQ4RlQC04J7pbMKJofJZMdf7NVj/DC8ZpqLUOkV1fX6+xd6PSNLaDfn9 OBOZjSBhF9JbzODRKrPYGldeww4kY2CLNHhlYBx/lZVIsMDinsU5UsV77r6AbdEATd 4s1jFNTv8ws5DxoILclXfHFklb3Q0hfM0ZujR8+XNMravx91rSv+NqyMLGSNXWLdqk F/0mjEjiGHWxtEduCkO1Oi7SAZ+x10zOnWVEA0TBygtfi4lYW/hilwKmWVlIpb263c YvAOa6khUatxw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 4A62440441; Tue, 30 Jan 2024 11:31:06 -0300 (-03) Date: Tue, 30 Jan 2024 11:31:06 -0300 From: Arnaldo Carvalho de Melo To: linux-kernel@vger.kernel.org Cc: Adrian Hunter , Ian Rogers , Ingo Molnar , Jiri Olsa , Masahiro Yamada , Namhyung Kim , Vincent Whitchurch Subject: [PATCH 1/1 fyi] tools headers: Update the copy of x86's mem{cpy,set}_64.S used in 'perf bench' Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789526172412741572 X-GMAIL-MSGID: 1789526172412741572 tldr; Just FYI, I'm carrying this on the perf tools tree. - Arnaldo Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. --- This is to get the changes from: 94ea9c05219518ef ("x86/headers: Replace #include with #include ") 10f4c9b9a33b7df0 ("x86/asm: Fix build of UML with KASAN") That addresses these perf tools build warning: Warning: Kernel ABI header differences: diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S Cc: Adrian Hunter Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Masahiro Yamada Cc: Namhyung Kim Cc: Vincent Whitchurch Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/arch/x86/lib/memcpy_64.S | 4 ++-- tools/arch/x86/lib/memset_64.S | 4 ++-- tools/perf/util/include/linux/linkage.h | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/arch/x86/lib/memcpy_64.S b/tools/arch/x86/lib/memcpy_64.S index d055b82d22ccd083..59cf6f9065aa84d8 100644 --- a/tools/arch/x86/lib/memcpy_64.S +++ b/tools/arch/x86/lib/memcpy_64.S @@ -1,11 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright 2002 Andi Kleen */ +#include #include #include #include #include -#include .section .noinstr.text, "ax" @@ -39,7 +39,7 @@ SYM_TYPED_FUNC_START(__memcpy) SYM_FUNC_END(__memcpy) EXPORT_SYMBOL(__memcpy) -SYM_FUNC_ALIAS(memcpy, __memcpy) +SYM_FUNC_ALIAS_MEMFUNC(memcpy, __memcpy) EXPORT_SYMBOL(memcpy) SYM_FUNC_START_LOCAL(memcpy_orig) diff --git a/tools/arch/x86/lib/memset_64.S b/tools/arch/x86/lib/memset_64.S index 7c59a704c4584bf7..0199d56cb479d88c 100644 --- a/tools/arch/x86/lib/memset_64.S +++ b/tools/arch/x86/lib/memset_64.S @@ -1,10 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright 2002 Andi Kleen, SuSE Labs */ +#include #include #include #include -#include .section .noinstr.text, "ax" @@ -40,7 +40,7 @@ SYM_FUNC_START(__memset) SYM_FUNC_END(__memset) EXPORT_SYMBOL(__memset) -SYM_FUNC_ALIAS(memset, __memset) +SYM_FUNC_ALIAS_MEMFUNC(memset, __memset) EXPORT_SYMBOL(memset) SYM_FUNC_START_LOCAL(memset_orig) diff --git a/tools/perf/util/include/linux/linkage.h b/tools/perf/util/include/linux/linkage.h index 75e2248416f55f67..178b00205fe6a7b2 100644 --- a/tools/perf/util/include/linux/linkage.h +++ b/tools/perf/util/include/linux/linkage.h @@ -115,6 +115,10 @@ SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_WEAK) #endif +#ifndef SYM_FUNC_ALIAS_MEMFUNC +#define SYM_FUNC_ALIAS_MEMFUNC SYM_FUNC_ALIAS +#endif + // In the kernel sources (include/linux/cfi_types.h), this has a different // definition when CONFIG_CFI_CLANG is used, for tools/ just use the !clang // definition: