From nobody Fri Nov 22 16:04:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1722263097; cv=pass; d=zohomail.com; s=zohoarc; b=R/UJDYewmRc9jlvEordNLqng9Yu2WhLLcT3J0NGt79eE6LweLxjtfKGc8RoBgpbaXdjYk9sxVpZJhGvj+1+x4fc8reK75CPKXka7l1rO7se8mU1CfbnN/BgNF5L1onKLAgrrvmzkLAtVYEOGs/Ah6ARvRlicDl6mvoi66dwD55c= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722263097; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Qpd/3sEoVyoP99DEMD3O6+ZaTL/UJPyUlDVvloH+sA8=; b=F5z+0uOWUFr8zHW7tCKfdpPyxCbOG+cXyg3Z/Bc95tVfxtbb6BzuzVhqRt9ddFrBVUpUo8z7IWFarwkF5eI/+Rnbd+Z5EkJM75LVN7Rt1iUKKNTMATNHRmNRIaXl37fwhin/il8PWckmK2pVKFMeVSqeSEjYIy/um6MHp0ns0Bk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1722263097669489.1785428978792; Mon, 29 Jul 2024 07:24:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.766792.1177319 (Exim 4.92) (envelope-from ) id 1sYRIo-0002qS-Gy; Mon, 29 Jul 2024 14:24:42 +0000 Received: by outflank-mailman (output) from mailman id 766792.1177319; Mon, 29 Jul 2024 14:24:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sYRIo-0002qL-DW; Mon, 29 Jul 2024 14:24:42 +0000 Received: by outflank-mailman (input) for mailman id 766792; Mon, 29 Jul 2024 14:24:41 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sYRIn-0002bd-JW for xen-devel@lists.xenproject.org; Mon, 29 Jul 2024 14:24:41 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2060b.outbound.protection.outlook.com [2a01:111:f403:2009::60b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4a650f01-4db6-11ef-bc01-fd08da9f4363; Mon, 29 Jul 2024 16:24:41 +0200 (CEST) Received: from DS7PR03CA0109.namprd03.prod.outlook.com (2603:10b6:5:3b7::24) by MW6PR12MB8757.namprd12.prod.outlook.com (2603:10b6:303:239::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Mon, 29 Jul 2024 14:24:36 +0000 Received: from DS3PEPF000099D9.namprd04.prod.outlook.com (2603:10b6:5:3b7:cafe::bb) by DS7PR03CA0109.outlook.office365.com (2603:10b6:5:3b7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Mon, 29 Jul 2024 14:24:36 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D9.mail.protection.outlook.com (10.167.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Mon, 29 Jul 2024 14:24:35 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 29 Jul 2024 09:24:35 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 29 Jul 2024 09:24:34 -0500 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 29 Jul 2024 09:24:34 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4a650f01-4db6-11ef-bc01-fd08da9f4363 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iYfAt38wHfrYbCzKvgvscqLAJGiBQWVjXQHc6BMuJa0bsfhyjBol90pM8IsQCPhwBRvbYS5/d2OH9hTPxngQV2Cm41V64iGqTTUHzbmUKBW8GbTHSS6A1Zo907XKhbJY7qR248DeobidCQJYJaBfnp9SeSlSxuJUFmZFKn2evdYoljxxPG3PeoWlixWQBWKaYqiMSQms0CHNzSzeyXtNcR1vCdaefbsuhOXAMCUMRAgz95EbaNse/woRoXAjhZiyiEVfQ+fin0hXizsG2KQb8+OhUVtsVUM+6AETtoj5YSqClHcNI31NAwfY5MgxhFSUKGlkydEaCGY0U5nJAxYxDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Qpd/3sEoVyoP99DEMD3O6+ZaTL/UJPyUlDVvloH+sA8=; b=zBJTnkO9yDntjlddEsPrXUd3sMIbVp3GJ4lE4sOKse2rBHqf2man61B4+h4dGciO+T4faNrAoU6QJqFyyW6xteXNRtk3L0tmrl9pGtl7gqY+BdXGY47aPlqHEZJWRBgULHU2qHISLfAZrzAW/yvgAP8i/JsEAe6RKaCCYt1nfN+lDKRlnNhrXM5sh5wqXV7bygTx9Um5ovwf92/u6MtKgG6uJuOpZ3OxVFs6XGQeNwU6qJJz/VF1f75vyj0qTB+s9MUVwrPP9qGbRR2jWuJvgLr/H2tttxX080SNFv6AOdWQZx9vwLds11VgsrvCAiPdxcwsfw1Av+Ns5x+DlsQBJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qpd/3sEoVyoP99DEMD3O6+ZaTL/UJPyUlDVvloH+sA8=; b=mLu6WFhG/p97bmM4yr4UIcpWApsJ/luNV4n652aQjL2nWdGYY/L3qlsKQNz1ljNaeT5pEVrIrLqoIjjMxTOaJ0w5MjPsMuOpQD7r70j+77vnIfW90pSTC3hQyTxgbQojLaKMRgabCn3J5XDC/zYcWTuBRZfyBQw8IFXpZE+8XLw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Stewart Hildebrand To: CC: Stewart Hildebrand , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , "Daniel P. Smith" Subject: [PATCH 1/3] xen: add no_instrument_function attributes Date: Mon, 29 Jul 2024 10:24:15 -0400 Message-ID: <20240729142421.137283-2-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729142421.137283-1-stewart.hildebrand@amd.com> References: <20240729142421.137283-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB05.amd.com: stewart.hildebrand@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D9:EE_|MW6PR12MB8757:EE_ X-MS-Office365-Filtering-Correlation-Id: 81cb6bc6-a952-4dc2-b27a-08dcafda2c42 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?OT6s7LNjrd4WTXde1/FTwFntz/jxUPE9GORxkoMI40z+7u3SVpowdOk3gS1n?= =?us-ascii?Q?chUQFVC6fxmSW50yxHwOSkFBQAmuwjU1fzKahsJw2wjQsVD9nF1weUqa5edF?= =?us-ascii?Q?/iNvbzh66IvvgA+C9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?= =?us-ascii?Q?bg2XgdWv0tTvWmoYn+j4yUaj6YZYq/4SwpCtEXMby7NXD5UVBgYlWSQWCIVY?= =?us-ascii?Q?f5AXwffdk1hTI9H2x7vlXFV9D0/m6DYy2KoHU0d95PfTi8/IHjfNgANdlTNj?= =?us-ascii?Q?pN+7wsDidDX1t45g6K+DM/5QTbppOQfeMgxbtiIK7FCPyxp/hEVaHgnlL9bR?= =?us-ascii?Q?KpOI8UX4NmMSQJXnvB49UsByNuC4fv8sJDiVF4eLuS42OYrAHEdlDzkkDrfO?= =?us-ascii?Q?6ds30J8R9mGnyUatI21q/Y1w4QsGgcnt2GLJCnMUltP4A5lG2eVQxZe0uFsj?= =?us-ascii?Q?NQYxKLAXIyGHfhpAtvp+XYucSUQcKer/g0G6vaTG7lHIsTjOAl/wPErk6uRG?= =?us-ascii?Q?CWqn4Xvq5GXtvmj9j/CJ2DzuGm9Kcq9JqwXvJHgFVZus3K5RedN5epWTxMXP?= =?us-ascii?Q?eDsdCIJ2I7AG81XoRH4CpvUEujQmgvhc?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2024 14:24:35.9130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81cb6bc6-a952-4dc2-b27a-08dcafda2c42 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8757 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1722263099471116600 Content-Type: text/plain; charset="utf-8" In preparation for using -finstrument-functions option, we need to tag a few functions that don't work well with such instrumentation. If we don't intervene, we would end up with linker errors such as undefined reference to __bad_cmpxchg. Signed-off-by: Stewart Hildebrand --- xen/arch/arm/include/asm/arm64/cmpxchg.h | 4 ++++ xen/arch/arm/include/asm/arm64/sve.h | 1 + xen/arch/arm/include/asm/atomic.h | 2 ++ xen/arch/arm/include/asm/guest_atomics.h | 1 + xen/include/xsm/dummy.h | 1 + 5 files changed, 9 insertions(+) diff --git a/xen/arch/arm/include/asm/arm64/cmpxchg.h b/xen/arch/arm/includ= e/asm/arm64/cmpxchg.h index f160e8e7bcf9..acabd42ca986 100644 --- a/xen/arch/arm/include/asm/arm64/cmpxchg.h +++ b/xen/arch/arm/include/asm/arm64/cmpxchg.h @@ -5,6 +5,7 @@ =20 extern void __bad_xchg(volatile void *ptr, int size); =20 +__attribute__((no_instrument_function)) static inline unsigned long __xchg(unsigned long x, volatile void *ptr, in= t size) { unsigned long ret, tmp; @@ -102,6 +103,7 @@ __CMPXCHG_CASE(w, h, 2) __CMPXCHG_CASE(w, , 4) __CMPXCHG_CASE( , , 8) =20 +__attribute__((no_instrument_function)) static always_inline bool __int_cmpxchg(volatile void *ptr, unsigned long = *old, unsigned long new, int size, bool timeout, unsigned int max_try) @@ -122,6 +124,7 @@ static always_inline bool __int_cmpxchg(volatile void *= ptr, unsigned long *old, ASSERT_UNREACHABLE(); } =20 +__attribute__((no_instrument_function)) static always_inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, @@ -145,6 +148,7 @@ static always_inline unsigned long __cmpxchg(volatile v= oid *ptr, * The helper will return true when the update has succeeded (i.e no * timeout) and false if the update has failed. */ +__attribute__((no_instrument_function)) static always_inline bool __cmpxchg_timeout(volatile void *ptr, unsigned long *old, unsigned long new, diff --git a/xen/arch/arm/include/asm/arm64/sve.h b/xen/arch/arm/include/as= m/arm64/sve.h index a71d6a295dcc..3090e1cb784b 100644 --- a/xen/arch/arm/include/asm/arm64/sve.h +++ b/xen/arch/arm/include/asm/arm64/sve.h @@ -48,6 +48,7 @@ unsigned int get_sys_vl_len(void); =20 #define opt_dom0_sve 0 =20 +__attribute__((no_instrument_function)) static inline bool is_sve_domain(const struct domain *d) { return false; diff --git a/xen/arch/arm/include/asm/atomic.h b/xen/arch/arm/include/asm/a= tomic.h index 517216d2a846..31c3b3c3745b 100644 --- a/xen/arch/arm/include/asm/atomic.h +++ b/xen/arch/arm/include/asm/atomic.h @@ -74,6 +74,7 @@ build_add_sized(add_u32_sized, "", WORD, uint32_t) void __bad_atomic_read(const volatile void *p, void *res); void __bad_atomic_size(void); =20 +__attribute__((no_instrument_function)) static always_inline void read_atomic_size(const volatile void *p, void *res, unsigned int size) @@ -99,6 +100,7 @@ static always_inline void read_atomic_size(const volatil= e void *p, } } =20 +__attribute__((no_instrument_function)) static always_inline void write_atomic_size(volatile void *p, void *val, unsigned int size) diff --git a/xen/arch/arm/include/asm/guest_atomics.h b/xen/arch/arm/includ= e/asm/guest_atomics.h index 8893eb9a55d7..f5f4ba0df0b1 100644 --- a/xen/arch/arm/include/asm/guest_atomics.h +++ b/xen/arch/arm/include/asm/guest_atomics.h @@ -86,6 +86,7 @@ static inline void guest_clear_mask16(struct domain *d, u= int16_t mask, domain_unpause(d); } =20 +__attribute__((no_instrument_function)) static always_inline unsigned long __guest_cmpxchg(struct domain *d, volatile void *ptr, unsigned long old, diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 00d2cbebf25a..7b42f8faa61c 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -75,6 +75,7 @@ void __xsm_action_mismatch_detected(void); =20 #endif /* CONFIG_XSM */ =20 +__attribute__((no_instrument_function)) static always_inline int xsm_default_action( xsm_default_t action, struct domain *src, struct domain *target) { --=20 2.45.2