From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.10652.1612880197811148740 for ; Tue, 09 Feb 2021 06:16:38 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: ray.ni@intel.com) IronPort-SDR: Y+0LemOmH1o1ttWoZAPNXXi2QxnofQNE9YewT2f8naGUlZWuZXx/mYVhF6lrcN11RMe+fylp3/ 2xm+ZyTFz6AA== X-IronPort-AV: E=McAfee;i="6000,8403,9889"; a="200959137" X-IronPort-AV: E=Sophos;i="5.81,165,1610438400"; d="scan'208";a="200959137" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 06:16:37 -0800 IronPort-SDR: 3l1QWzpvTxWNJgb38eptgRyIaLpFR0RW9LFbt4O7cFYkRNErZ/dS/gRtM/dvgi1N/PW3exr4jr ZkjiZxBYyfGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,165,1610438400"; d="scan'208";a="374969169" Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by orsmga002.jf.intel.com with ESMTP; 09 Feb 2021 06:16:36 -0800 From: "Ni, Ray" To: devel@edk2.groups.io Subject: [PATCH v3 0/4] Use XADD to avoid lock acquire/release Date: Tue, 9 Feb 2021 22:16:30 +0800 Message-Id: <20210209141634.1999-1-ray.ni@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Patch #1 follows Mike's suggestion to use XADD to avoid lock acquire/release. Patch #2 follows Laszlo's suggestion to add global NASM macros for NASM struc usage. Patch #3 simply remves all hardcode offset in NASM without changing any logic. Patch #4 removes the dead code. The final code is the same as that of V2. Ray Ni (4): UefiCpuPkg/MpInitLib: Use XADD to avoid lock acquire/release MdePkg/Nasm.inc: add macros for C types used in structure definition UefiCpuPkg/MpInitLib: Use NASM struc to avoid hardcode offset UefiCpuPkg/MpInitLib: Remove unused Lock from MP_CPU_EXCHANGE_INFO MdePkg/Include/Ia32/Nasm.inc | 38 ++++++ MdePkg/Include/X64/Nasm.inc | 38 ++++++ UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 5 +- UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc | 43 ------- .../Library/MpInitLib/Ia32/MpFuncs.nasm | 98 +++++++--------- UefiCpuPkg/Library/MpInitLib/MpEqu.inc | 99 ++++++++++++++++ UefiCpuPkg/Library/MpInitLib/MpLib.c | 1 - UefiCpuPkg/Library/MpInitLib/MpLib.h | 3 +- UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 5 +- UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc | 45 -------- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 108 ++++++++---------- 11 files changed, 272 insertions(+), 211 deletions(-) delete mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc create mode 100644 UefiCpuPkg/Library/MpInitLib/MpEqu.inc delete mode 100644 UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc -- 2.27.0.windows.1