From nobody Wed May 8 16:57:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97247+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97247+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1670830251; cv=none; d=zohomail.com; s=zohoarc; b=N+RYLb7dIpDkyJhsbcA219Eepeke5ugwPdtEhUEWncAO5DlLuhKYfdFP9DST8sEQ41mA/DhwelLu0VKRa+70BQqwJ6IYcX/7KQAdug4Q69sq8oLh6Sg565xjbZ+RjzL3kEJHiJcfFbR2K9sGzGXGZSEWh2CWBmOWvnwDCoeQois= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670830251; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=36Bnrrx1X8nH/JZACZWziPWWnTwv4lzQiLleOQ1e7DY=; b=MucyInN4TO796jYC7U68pGNmTEXvtijPJGphLZkzrQ2sgW92nlWVQT2kPP7MDwWUcIzo0x+xhTY0cADHArcvXKcDAmZ4f01ypd7frIy48IHP2peM9OCCE9i9dNUnBLz8qmGZJA2PZONeTTbdxeAhGXXhb/TsWyh6YfL+YuxbWag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97247+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1670830251421797.5373626218185; Sun, 11 Dec 2022 23:30:51 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id uef8YY1788612x2eQkmiivLA; Sun, 11 Dec 2022 23:30:50 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.37543.1670830249610120698 for ; Sun, 11 Dec 2022 23:30:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="379997783" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="379997783" X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2022 23:30:46 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="648066767" X-IronPort-AV: E=Sophos;i="5.96,237,1665471600"; d="scan'208";a="648066767" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2022 23:30:45 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Michael D Kinney , Liming Gao , Ray Ni Subject: [edk2-devel] [PATCH v2] MdePkg/BaseCpuLib: Remove assembly for CpuFlushTlb Date: Mon, 12 Dec 2022 15:30:22 +0800 Message-Id: <20221212073022.232-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhiguang.liu@intel.com X-Gm-Message-State: sT8nvkvbl8MZTD4zPz7pjt6rx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1670830250; bh=3NrFb2RyOX+S5on1ZNIvK5+MyTYPlnxw7KJNUirjqgs=; h=Cc:Date:From:Reply-To:Subject:To; b=RlWJutC4WPBWn7t0DxzNXbhTPowBXdOHmDo1ITsduNrBaLJOlKXkWNakDrfr0sqYjhT fHsO488o4x6Qp9Au/Koac/RE4P4kLqRT8LzsMokK9yetuqSVNSKDNFPOAt7MHOkpIRyDt ln/bcqhLHGxZnyc9OdZNOn1swg3BxgbCWJE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1670830253433100003 Content-Type: text/plain; charset="utf-8" For different compilers, both IA32 and X64 can use Ia32/CpuFlushTlbGcc.c, which is C code (no inline assembly code). To simplify, remove other assemly file for CpuFlushTlb, and rename Ia32/CpuFlushTlbGcc.c to X86CpuFlushTlb.c. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Ray Ni Signed-off-by: Zhiguang Liu Reviewed-by: Michael D Kinney --- MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 10 ++---- MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c | 25 --------------- .../Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm | 31 ------------------ .../Library/BaseCpuLib/X64/CpuFlushTlb.nasm | 32 ------------------- .../CpuFlushTlbGcc.c =3D> X86CpuFlushTlb.c} | 4 +-- 5 files changed, 5 insertions(+), 97 deletions(-) delete mode 100644 MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c delete mode 100644 MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm delete mode 100644 MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm rename MdePkg/Library/BaseCpuLib/{Ia32/CpuFlushTlbGcc.c =3D> X86CpuFlushTl= b.c} (75%) diff --git a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf b/MdePkg/Library/Base= CpuLib/BaseCpuLib.inf index 6b230f6e6d..5b18343c59 100644 --- a/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf +++ b/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf @@ -4,7 +4,7 @@ # CPU Library implemented using ASM functions for IA32, X64, ARM, AARCH64, # PAL CALLs for IPF, and empty functions for EBC. # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
@@ -31,16 +31,12 @@ =20 [Sources.IA32] Ia32/CpuSleep.c | MSFT - Ia32/CpuFlushTlb.c | MSFT - Ia32/CpuSleep.nasm| INTEL - Ia32/CpuFlushTlb.nasm| INTEL - Ia32/CpuSleepGcc.c | GCC - Ia32/CpuFlushTlbGcc.c | GCC + X86CpuFlushTlb.c =20 [Sources.X64] - X64/CpuFlushTlb.nasm + X86CpuFlushTlb.c X64/CpuSleep.nasm =20 =20 diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c b/MdePkg/Library/= BaseCpuLib/Ia32/CpuFlushTlb.c deleted file mode 100644 index 549f4eb8a0..0000000000 --- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c +++ /dev/null @@ -1,25 +0,0 @@ -/** @file - CpuFlushTlb function. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -/** - Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU. - - Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU. - -**/ -VOID -EFIAPI -CpuFlushTlb ( - VOID - ) -{ - _asm { - mov eax, cr3 - mov cr3, eax - } -} diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm b/MdePkg/Libra= ry/BaseCpuLib/Ia32/CpuFlushTlb.nasm deleted file mode 100644 index bc3b68e3f2..0000000000 --- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm +++ /dev/null @@ -1,31 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Module Name: -; -; CpuFlushTlb.Asm -; -; Abstract: -; -; CpuFlushTlb function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - SECTION .text - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuFlushTlb ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(CpuFlushTlb) -ASM_PFX(CpuFlushTlb): - mov eax, cr3 - mov cr3, eax ; moving to CR3 flushes TLB - ret - diff --git a/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm b/MdePkg/Librar= y/BaseCpuLib/X64/CpuFlushTlb.nasm deleted file mode 100644 index 8ddf7a2864..0000000000 --- a/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm +++ /dev/null @@ -1,32 +0,0 @@ -;-------------------------------------------------------------------------= ----- ; -; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Module Name: -; -; CpuFlushTlb.Asm -; -; Abstract: -; -; CpuFlushTlb function -; -; Notes: -; -;-------------------------------------------------------------------------= ----- - - DEFAULT REL - SECTION .text - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; CpuFlushTlb ( -; VOID -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(CpuFlushTlb) -ASM_PFX(CpuFlushTlb): - mov rax, cr3 - mov cr3, rax - ret - diff --git a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c b/MdePkg/Libra= ry/BaseCpuLib/X86CpuFlushTlb.c similarity index 75% rename from MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c rename to MdePkg/Library/BaseCpuLib/X86CpuFlushTlb.c index ee44f2ea6e..17a351d054 100644 --- a/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c +++ b/MdePkg/Library/BaseCpuLib/X86CpuFlushTlb.c @@ -1,7 +1,7 @@ /** @file - CpuFlushTlb function for Ia32/X64 GCC. + CpuFlushTlb function for Ia32/X64. =20 - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97247): https://edk2.groups.io/g/devel/message/97247 Mute This Topic: https://groups.io/mt/95616803/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-