From nobody Thu Nov 14 07:08:56 2024 Delivered-To: importer@patchew.org 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; 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1700663294; cv=none; d=zohomail.com; s=zohoarc; b=lMgV/IFnxYkvBZX7ujvvLftgJIlbtWhJ2Hx/FxtVkjA1Nac9pCKzaSfs2xvrg7jWVVn/z7mUghzHtuH0oIOD6ujLQq3xaOYuY5//p+cjx8yNAy0wjxnKAVI+4RvC/6NasARGXfOMJfYzVrqClLAUMKYG5dV8e6y3jooPPN1xtUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700663294; 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=yjAmfNgNU4Vhys4nbB+GQduMI4kncDdaV4YgjHgUCyY=; b=J82hH4i1napeqIxdsapR/wngHSCdy+QOUevccCLqDUjlHc4NxLSBJj/PMjCDENeV3SPl7uzUe5ay5TbtQEhAYiC6RXcQQPWGXnBVsgl+F5KnqurTdah9/uYkmibVyZd2g/WHhkDupuvaTxDg8haR+gwpTFcBzGSGu1KqFbwixcQ= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1700663294732402.8517939939791; Wed, 22 Nov 2023 06:28:14 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.638782.995685 (Exim 4.92) (envelope-from ) id 1r5oCf-0000iA-9g; Wed, 22 Nov 2023 14:27:45 +0000 Received: by outflank-mailman (output) from mailman id 638782.995685; Wed, 22 Nov 2023 14:27:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5oCf-0000i3-64; Wed, 22 Nov 2023 14:27:45 +0000 Received: by outflank-mailman (input) for mailman id 638782; Wed, 22 Nov 2023 14:27:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5oCd-0000hs-NG for xen-devel@lists.xenproject.org; Wed, 22 Nov 2023 14:27:43 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 48edbeb6-8943-11ee-9b0e-b553b5be7939; Wed, 22 Nov 2023 15:27:41 +0100 (CET) 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: 48edbeb6-8943-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1700663261; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ywvep0L7wFEFiubA9y2BEnjTlV89Gf8x0DSPJfdKTgM=; b=NI2dATF/OIJSNZoNf1Jubuz77lGEulhMrOQmcyqxn+fhspvRtL4e3jDa DsU5SZz+vxQRT5HBE5nlnIYbQd4/g4VzkOYL+TgxX8PmmTEolmm7cl6wn NDTQw0BbuSqpd7oaqrPR4+2hCM2mfGYZjI4kZUD/nyL3LCIz6cUw04V0D I=; X-CSE-ConnectionGUID: FUgGcfvZQFCj8jqu50I/5A== X-CSE-MsgGUID: So+pkNaeR22uRJ7GcsGH5A== Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 128715170 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.159.70 X-Policy: $RELAYED X-ThreatScanner-Verdict: Negative IronPort-Data: A9a23:dWJi1a3azst0+oJrE/bD5Z1xkn2cJEfYwER7XKvMYLTBsI5bp2dRy 2dOXmjVb/feYmP3Ko8lOYXkpBwH6JKDnYAxSwFrpC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliOfQAOK6UbaYUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb9HuDgNyo4GlD5wVkP6gR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfL1xB2 vcWNgI0QDuB1+Cv3e/ja64xr5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGc+KkuYC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TTH5UKxxvB+ TquE2LRORZZLN+5wDe/qCixvM2Qsijgd6JPPejtnhJtqALKnTFCYPEMbnOrrP/8hkOgVtZ3L 00P5jFovaU07FasTNT2Q1u/unHsljw2VsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LQHGz XfQwYmvX2Y29uTIGDTCrt94sA9eJwA7EGAtbiEafzIryNuzopgu00ruCYtKRfvdYsLOJd3g/ 9ybhHFh3+1O3ZRWiPXTwLzRv967SnH0ou8JCub/BDvNAvtRPtLNWmBRwQGzAQx8BIiYVEKdm 3MPhtKT6usDZbnUy3TVHbRUQuz5vq/ZWNE5vbKJN8N5n9hK0yfzFb28HRkkfBs5Wir6UWOBj LDvVfN5u8YIYSrCgV5faIOtEcU6pZUM5vy8Ps04muFmO8ArHCfepXEGWKJl9zy1+KTauf1la MjznAfFJSpyNJmLOxLsHblHieRwlntWKKG6bcmT8ilLGIG2PBa9IYrp+nPXBgzlxMtoeDnoz us= IronPort-HdrOrdr: A9a23:cseX0auhqx3XIcHa8AxtN5RO7skDTtV00zEX/kB9WHVpmszxra 6TdZMgpGbJYVcqKRcdcL+7WJVoLUmxyXcx2/h1AV7AZniAhILLFvAA0WKK+VSJcEeSygce79 YFT0EXMqyJMbEQt6fHCWeDfOrIuOP3kpyVuQ== X-Talos-CUID: =?us-ascii?q?9a23=3AfaLF8mmgz0ru7bxjCyTjKQNgpQnXOVPgw1jbLVG?= =?us-ascii?q?KMEhCSu2XUELNoIIjzuM7zg=3D=3D?= X-Talos-MUID: =?us-ascii?q?9a23=3ApLZs0Q1+3WwvlCVPfCXW4kWWSzUj2KPtEEMrmJg?= =?us-ascii?q?84ZOZDw4vFDyGoxTqa9py?= X-IronPort-AV: E=Sophos;i="6.04,219,1695700800"; d="scan'208";a="128715170" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 1/3] x86/apic: Drop atomic accessors Date: Wed, 22 Nov 2023 14:27:31 +0000 Message-ID: <20231122142733.1818331-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231122142733.1818331-1-andrew.cooper3@citrix.com> References: <20231122142733.1818331-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1700663295449100001 The last users were dropped in commit 413e92e9bf13 ("x86/apic: Drop workarounds for Pentium/82489DX erratum"). Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/include/asm/apic.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/api= c.h index f7ad7b20dd80..288b4933eb38 100644 --- a/xen/arch/x86/include/asm/apic.h +++ b/xen/arch/x86/include/asm/apic.h @@ -54,11 +54,6 @@ static __inline void apic_mem_write(unsigned long reg, u= 32 v) *((volatile u32 *)(APIC_BASE+reg)) =3D v; } =20 -static __inline void apic_mem_write_atomic(unsigned long reg, u32 v) -{ - (void)xchg((volatile u32 *)(APIC_BASE+reg), v); -} - static __inline u32 apic_mem_read(unsigned long reg) { return *((volatile u32 *)(APIC_BASE+reg)); @@ -97,14 +92,6 @@ static __inline void apic_write(unsigned long reg, u32 v) apic_mem_write(reg, v); } =20 -static __inline void apic_write_atomic(unsigned long reg, u32 v) -{ - if ( x2apic_enabled ) - apic_wrmsr(reg, v); - else - apic_mem_write_atomic(reg, v); -} - static __inline u32 apic_read(unsigned long reg) { if ( x2apic_enabled ) --=20 2.30.2 From nobody Thu Nov 14 07:08:56 2024 Delivered-To: importer@patchew.org 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; 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1700663295; cv=none; d=zohomail.com; s=zohoarc; b=XRMaJiLXLWTbA21eXhik7cLDi9SSz9QG6ygQBnxaK1KrhsCPwwmeIK1TUGWvkFY1YwFoaWayMRAKGoYNxs58HJVBjuhgD95/DdJ7ggPivYBhLGdunQwK+KBug01CxuNmNjFyGePbLwladwA0yaaZ6ccZRjBkbSmsV7Rl4dbVz2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700663295; 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=b2F4kgceUVW1vEGnrqDwaYtGCTbgB/G0f6V+IAQHIG0=; b=g3CGG8uOv0NF3p7NTelDi9HgCNp0c9LRfvHZWq8iWXQkgtNt3mpy+uNXDAt25wKQRHIRXlpn/KHSOpjX1pqvxCodFEmH6q4udjEVMCHrv3FVAp3kUWBCcvlmHOQ5ABAnjZpJxShhJkscXZMH4JujMQPJ4eXl0XqgqLUSNgfymQk= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17006632953451003.3267278581968; Wed, 22 Nov 2023 06:28:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.638785.995714 (Exim 4.92) (envelope-from ) id 1r5oCi-0001R3-6N; Wed, 22 Nov 2023 14:27:48 +0000 Received: by outflank-mailman (output) from mailman id 638785.995714; Wed, 22 Nov 2023 14:27:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5oCi-0001Qs-3X; Wed, 22 Nov 2023 14:27:48 +0000 Received: by outflank-mailman (input) for mailman id 638785; Wed, 22 Nov 2023 14:27:46 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5oCg-0000hs-DU for xen-devel@lists.xenproject.org; Wed, 22 Nov 2023 14:27:46 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4d156d13-8943-11ee-9b0e-b553b5be7939; Wed, 22 Nov 2023 15:27:44 +0100 (CET) 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: 4d156d13-8943-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1700663264; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bRZw8HpOnQzzkA1q6rwNIIhXyAnBfhvT+l0gq9/kgVI=; b=IWcb0lVytB+Dd8YW7KdJtRI3F1dfhjs7sK32UmdZNlHt8ATmyBIKZg61 X7TkNhthDJQI0UB1t6a0VQMaBxjTS5Ap/WJe6N8fIg32diQgBQ+tbAHxL m2EMQrRgrvzeQ/8ii90rZJbiGVvzMf3AePCviXDzrDQlBWakoLtCiIfmT g=; X-CSE-ConnectionGUID: RU2enJTNQOWXW12FekJHvg== X-CSE-MsgGUID: rtqloiI4T9mMZ5N9CyigFQ== Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 128141619 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.159.70 X-Policy: $RELAYED X-ThreatScanner-Verd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dSRojVNJ+5nTg= IronPort-HdrOrdr: A9a23:uao38KOTr9egFcBcTvmjsMiBIKoaSvp037Eqv3oedfUzSL3gqy nOpoV86faaslYssR0b9exofZPwJE80lqQFhrX5X43SPzUO0VHAROoJgLcKgQeQfxEWntQtrZ uIGJIeNDSfNzdHZL7BkWuFL+o= X-Talos-CUID: =?us-ascii?q?9a23=3Aycfi7mtAr8rnts+672Mqw/0g6IsfTyfQylXsBXa?= =?us-ascii?q?fNlZWEee7RFyy2L1rxp8=3D?= X-Talos-MUID: =?us-ascii?q?9a23=3Abpd68AxjU5AU4QuG+X/FpzHCxcCaqL6yEUQKkLR?= =?us-ascii?q?ah5iBEB4tHWa2nTW4bLZyfw=3D=3D?= X-IronPort-AV: E=Sophos;i="6.04,219,1695700800"; d="scan'208";a="128141619" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 2/3] x86/apic: Drop the APIC_MSR_BASE constant Date: Wed, 22 Nov 2023 14:27:32 +0000 Message-ID: <20231122142733.1818331-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231122142733.1818331-1-andrew.cooper3@citrix.com> References: <20231122142733.1818331-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1700663297439100003 Use MSR_X2APIC_FIRST from msr-index.h instead. Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu --- xen/arch/x86/include/asm/apic.h | 4 ++-- xen/arch/x86/include/asm/apicdef.h | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/api= c.h index 288b4933eb38..486d689478b2 100644 --- a/xen/arch/x86/include/asm/apic.h +++ b/xen/arch/x86/include/asm/apic.h @@ -69,7 +69,7 @@ static __inline void apic_wrmsr(unsigned long reg, uint64= _t msr_content) reg =3D=3D APIC_LVR) return; =20 - wrmsrl(APIC_MSR_BASE + (reg >> 4), msr_content); + wrmsrl(MSR_X2APIC_FIRST + (reg >> 4), msr_content); } =20 static __inline uint64_t apic_rdmsr(unsigned long reg) @@ -79,7 +79,7 @@ static __inline uint64_t apic_rdmsr(unsigned long reg) if (reg =3D=3D APIC_DFR) return -1u; =20 - rdmsrl(APIC_MSR_BASE + (reg >> 4), msr_content); + rdmsrl(MSR_X2APIC_FIRST + (reg >> 4), msr_content); return msr_content; } =20 diff --git a/xen/arch/x86/include/asm/apicdef.h b/xen/arch/x86/include/asm/= apicdef.h index 8d1b0087d4ef..c4068ccc10f4 100644 --- a/xen/arch/x86/include/asm/apicdef.h +++ b/xen/arch/x86/include/asm/apicdef.h @@ -124,9 +124,6 @@ =20 #define APIC_BASE __fix_to_virt(FIX_APIC_BASE) =20 -/* It's only used in x2APIC mode of an x2APIC unit. */ -#define APIC_MSR_BASE 0x800 - #define MAX_IO_APICS 128 =20 extern bool x2apic_enabled; --=20 2.30.2 From nobody Thu Nov 14 07:08:56 2024 Delivered-To: importer@patchew.org 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; 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; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1700663296; cv=none; d=zohomail.com; s=zohoarc; b=AFP2bsKL+/2eB0rPqzGcOpmwy54K9CCCM3rMr8DtI5Ovsh52qZir5aWjE8oBiGMnD4Ge0KZre75Tijflz1Gu+QIZqBsGV4z6zJeSm07Eg1jlSHBrqyhQCPq6pPtB6f9ZE3rs5YoxGUgL8Gb58xp06f20xtn3AYUjKRpAPZvvE+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700663296; 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=40Edy+GP/IFTdJOMPdo15LQOkIDmDBaCXbztUXWwsxo=; b=FGWYjQjfKlYHqcc2W6RwHPISZAzrP3UHo8IYPjRsuZFvSlxVYPbQyj7A9w/eCbddenTARUQxhcoGg0PY5A2vVlHqPL1ekoXAw4E0xRAdYmCUnwuI2gI3X39IeX7nmtH6BP85NN31uisZfySwM2PE7tJf0tBUkUw+OmyNpWG3fYU= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1700663296294303.32763478333527; Wed, 22 Nov 2023 06:28:16 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.638784.995704 (Exim 4.92) (envelope-from ) id 1r5oCg-0001Bu-VB; Wed, 22 Nov 2023 14:27:46 +0000 Received: by outflank-mailman (output) from mailman id 638784.995704; Wed, 22 Nov 2023 14:27:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5oCg-0001Bn-SW; Wed, 22 Nov 2023 14:27:46 +0000 Received: by outflank-mailman (input) for mailman id 638784; Wed, 22 Nov 2023 14:27:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r5oCf-0000hs-AK for xen-devel@lists.xenproject.org; Wed, 22 Nov 2023 14:27:45 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c53bd41-8943-11ee-9b0e-b553b5be7939; Wed, 22 Nov 2023 15:27:43 +0100 (CET) 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: 4c53bd41-8943-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1700663263; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eWMLgFqdH7Iqx1Wkq82bGSFuLQyTpCILNGF4xDEO1u4=; b=DBWCxsaPC5lJm579Pz5pRGLAfLMzxAxiLwo3TgX2m5tbzxX1TN3z1ScE QW5jTdQIHBc2PWYFxjYdjRoZHwDG3J3jhy8jmsnXu/Bxe6gDccykTWBL+ Ov3iKD8GlVz70J2+PGO80405Xp6M4k9pZ51oi/WwU/21W6nJGO27NOuIQ g=; X-CSE-ConnectionGUID: FUgGcfvZQFCj8jqu50I/5A== X-CSE-MsgGUID: hLgLiIS5RtaW7Gp6T0LDYA== Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 128715171 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.159.70 X-Policy: $RELAYED X-ThreatScanner-Verdict: Negative IronPort-Data: A9a23:6gJkG6J6jIvPL61EFE+R7ZUlxSXFcZb7ZxGr2PjKsXjdYENS32BVx jAXCm3TPvaINGf2KY9zOo/i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5VAR1VWuVN7EYSd7HxM8im1EfJNHLKMQLISZIc sQ4 IronPort-HdrOrdr: A9a23:r8OLvKwBVcJSKZ6qGAXwKrPwFL1zdoMgy1knxilNoRw8SKKlfq eV7Y0mPH7P+VAssR4b+exoVJPtfZqYz+8R3WBzB8bEYOCFghrKEGgK1+KLqFeMJ8S9zJ846U 4JSdkHNDSaNzlHZKjBjzVQa+xQouW6zA== X-Talos-CUID: 9a23:2Q93Tm7BhUCpEmGqxtss2nMbNcsrbE/k4lzSc02hFDsxafrIYArF X-Talos-MUID: 9a23:NwbsOwZTMpX6guBTtxvjoDBDD5pS/62RV28Vz6len+W1HHkl X-IronPort-AV: E=Sophos;i="6.04,219,1695700800"; d="scan'208";a="128715171" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Stefano Stabellini , Roberto Bagnara , Nicola Vetrini , Simone Ballarin Subject: [PATCH 3/3] xen/MISRA: Remove nonstandard inline keywords Date: Wed, 22 Nov 2023 14:27:33 +0000 Message-ID: <20231122142733.1818331-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231122142733.1818331-1-andrew.cooper3@citrix.com> References: <20231122142733.1818331-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1700663297481100005 The differences between inline, __inline and __inline__ keywords are a vestigial remnant of older C standards, and in Xen we use inline almost exclusively. Replace __inline and __inline__ with regular inline, and remove their exceptions from the MISRA configuration. Signed-off-by: Andrew Cooper Reviewed-by: Simone Ballarin Reviewed-by: Stefano Stabellini --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Stefano Stabellini CC: Roberto Bagnara CC: Nicola Vetrini CC: Simone Ballarin I'm entirely guessing at the Eclair configuration. --- .../eclair_analysis/ECLAIR/toolchain.ecl | 6 +++--- docs/misra/C-language-toolchain.rst | 2 +- xen/arch/x86/include/asm/apic.h | 20 +++++++++---------- xen/include/acpi/cpufreq/cpufreq.h | 4 ++-- xen/include/xen/bitops.h | 4 ++-- xen/include/xen/compiler.h | 7 +++---- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/e= clair_analysis/ECLAIR/toolchain.ecl index e6cd289b5e92..71a1e2cce029 100644 --- a/automation/eclair_analysis/ECLAIR/toolchain.ecl +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl @@ -15,7 +15,7 @@ _Static_assert: see Section \"2.1 C Language\" of "GCC_MANUAL". asm, __asm__: see Sections \"6.48 Alternate Keywords\" and \"6.47 How = to Use Inline Assembly Language in C Code\" of "GCC_MANUAL". __volatile__: see Sections \"6.48 Alternate Keywords\" and \"6.47.2.1 = Volatile\" of "GCC_MANUAL". - __const__, __inline__, __inline: see Section \"6.48 Alternate Keywords= \" of "GCC_MANUAL". + __const__ : see Section \"6.48 Alternate Keywords\" of "GCC_MANUAL". typeof, __typeof__: see Section \"6.7 Referring to a Type with typeof\= " of "GCC_MANUAL". __alignof__, __alignof: see Sections \"6.48 Alternate Keywords\" and \= "6.44 Determining the Alignment of Functions, Types or Variables\" of "GCC_= MANUAL". __attribute__: see Section \"6.39 Attribute Syntax\" of "GCC_MANUAL". @@ -23,8 +23,8 @@ __builtin_va_arg: non-documented GCC extension. __builtin_offsetof: see Section \"6.53 Support for offsetof\" of "GCC_= MANUAL". " --config=3DSTD.tokenext,behavior+=3D{c99, GCC_ARM64, "^(_Static_assert|asm|= __asm__|__volatile__|__const__|__inline__|typeof|__typeof__|__alignof__|__a= ttribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof= )$"} --config=3DSTD.tokenext,behavior+=3D{c99, GCC_X86_64, "^(_Static_assert|asm= |__asm__|__volatile__|__const__|__inline__|__inline|typeof|__typeof__|__ali= gnof__|__alignof|__attribute__|__builtin_types_compatible_p|__builtin_va_ar= g|__builtin_offsetof)$"} +-config=3DSTD.tokenext,behavior+=3D{c99, GCC_ARM64, "^(_Static_assert|asm|= __asm__|__volatile__|__const__|typeof|__typeof__|__alignof__|__attribute__|= __builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof)$"} +-config=3DSTD.tokenext,behavior+=3D{c99, GCC_X86_64, "^(_Static_assert|asm= |__asm__|__volatile__|__const__|typeof|__typeof__|__alignof__|__alignof|__a= ttribute__|__builtin_types_compatible_p|__builtin_va_arg|__builtin_offsetof= )$"} -doc_end =20 -doc_begin=3D"Non-documented GCC extension." diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-to= olchain.rst index 2866cb191b1a..b7c2000992ac 100644 --- a/docs/misra/C-language-toolchain.rst +++ b/docs/misra/C-language-toolchain.rst @@ -84,7 +84,7 @@ The table columns are as follows: see Sections "6.48 Alternate Keywords" and "6.47 How to Use Inli= ne Assembly Language in C Code" of GCC_MANUAL. __volatile__: see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" o= f GCC_MANUAL. - __const__, __inline__, __inline: + __const__: see Section "6.48 Alternate Keywords" of GCC_MANUAL. typeof, __typeof__: see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL. diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/api= c.h index 486d689478b2..b20fae7ebc6a 100644 --- a/xen/arch/x86/include/asm/apic.h +++ b/xen/arch/x86/include/asm/apic.h @@ -49,12 +49,12 @@ const struct genapic *apic_x2apic_probe(void); * Basic functions accessing APICs. */ =20 -static __inline void apic_mem_write(unsigned long reg, u32 v) +static inline void apic_mem_write(unsigned long reg, u32 v) { *((volatile u32 *)(APIC_BASE+reg)) =3D v; } =20 -static __inline u32 apic_mem_read(unsigned long reg) +static inline u32 apic_mem_read(unsigned long reg) { return *((volatile u32 *)(APIC_BASE+reg)); } @@ -63,7 +63,7 @@ static __inline u32 apic_mem_read(unsigned long reg) * access the 64-bit ICR register. */ =20 -static __inline void apic_wrmsr(unsigned long reg, uint64_t msr_content) +static inline void apic_wrmsr(unsigned long reg, uint64_t msr_content) { if (reg =3D=3D APIC_DFR || reg =3D=3D APIC_ID || reg =3D=3D APIC_LDR || reg =3D=3D APIC_LVR) @@ -72,7 +72,7 @@ static __inline void apic_wrmsr(unsigned long reg, uint64= _t msr_content) wrmsrl(MSR_X2APIC_FIRST + (reg >> 4), msr_content); } =20 -static __inline uint64_t apic_rdmsr(unsigned long reg) +static inline uint64_t apic_rdmsr(unsigned long reg) { uint64_t msr_content; =20 @@ -83,7 +83,7 @@ static __inline uint64_t apic_rdmsr(unsigned long reg) return msr_content; } =20 -static __inline void apic_write(unsigned long reg, u32 v) +static inline void apic_write(unsigned long reg, u32 v) { =20 if ( x2apic_enabled ) @@ -92,7 +92,7 @@ static __inline void apic_write(unsigned long reg, u32 v) apic_mem_write(reg, v); } =20 -static __inline u32 apic_read(unsigned long reg) +static inline u32 apic_read(unsigned long reg) { if ( x2apic_enabled ) return apic_rdmsr(reg); @@ -100,7 +100,7 @@ static __inline u32 apic_read(unsigned long reg) return apic_mem_read(reg); } =20 -static __inline u64 apic_icr_read(void) +static inline u64 apic_icr_read(void) { u32 lo, hi; =20 @@ -115,7 +115,7 @@ static __inline u64 apic_icr_read(void) return ((u64)lo) | (((u64)hi) << 32); } =20 -static __inline void apic_icr_write(u32 low, u32 dest) +static inline void apic_icr_write(u32 low, u32 dest) { if ( x2apic_enabled ) apic_wrmsr(APIC_ICR, low | ((uint64_t)dest << 32)); @@ -126,13 +126,13 @@ static __inline void apic_icr_write(u32 low, u32 dest) } } =20 -static __inline bool apic_isr_read(uint8_t vector) +static inline bool apic_isr_read(uint8_t vector) { return (apic_read(APIC_ISR + ((vector & ~0x1f) >> 1)) >> (vector & 0x1f)) & 1; } =20 -static __inline u32 get_apic_id(void) /* Get the physical APIC id */ +static inline u32 get_apic_id(void) { u32 id =3D apic_read(APIC_ID); return x2apic_enabled ? id : GET_xAPIC_ID(id); diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/= cpufreq.h index b0c860f0ec21..3456d4c95f98 100644 --- a/xen/include/acpi/cpufreq/cpufreq.h +++ b/xen/include/acpi/cpufreq/cpufreq.h @@ -148,7 +148,7 @@ extern int cpufreq_driver_getavg(unsigned int cpu, unsi= gned int flag); extern int cpufreq_update_turbo(int cpuid, int new_state); extern int cpufreq_get_turbo_status(int cpuid); =20 -static __inline__ int=20 +static inline int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event) { return policy->governor->governor(policy, event); @@ -179,7 +179,7 @@ extern struct cpufreq_driver cpufreq_driver; =20 int cpufreq_register_driver(const struct cpufreq_driver *); =20 -static __inline__ +static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) { diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h index edd6817d5356..a88d45475c40 100644 --- a/xen/include/xen/bitops.h +++ b/xen/include/xen/bitops.h @@ -127,7 +127,7 @@ static inline int generic_fls64(__u64 x) # endif #endif =20 -static __inline__ int get_bitmask_order(unsigned int count) +static inline int get_bitmask_order(unsigned int count) { int order; =20 @@ -135,7 +135,7 @@ static __inline__ int get_bitmask_order(unsigned int co= unt) return order; /* We could be slightly more clever with -1 here... */ } =20 -static __inline__ int get_count_order(unsigned int count) +static inline int get_count_order(unsigned int count) { int order; =20 diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index 04b8bc18df0e..16d554f2a593 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -20,9 +20,8 @@ #define likely(x) __builtin_expect(!!(x),1) #define unlikely(x) __builtin_expect(!!(x),0) =20 -#define inline __inline__ -#define always_inline __inline__ __attribute__ ((__always_inline__)) -#define gnu_inline __inline__ __attribute__ ((__gnu_inline__)) +#define always_inline inline __attribute__((__always_inline__)) +#define gnu_inline inline __attribute__((__gnu_inline__)) #define noinline __attribute__((__noinline__)) =20 #define noreturn __attribute__((__noreturn__)) @@ -83,7 +82,7 @@ * inline functions not expanded inline get placed in .init.text. */ #include -#define __inline__ __inline__ __init +#define inline inline __init #endif =20 #define __attribute_pure__ __attribute__((__pure__)) --=20 2.30.2