From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id AAA0674003D for ; Thu, 1 Feb 2024 11:20:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=jc6X1IjqmV6b87k35qU6O/Brq3MP12nDlE+PU9PhnWA=; c=relaxed/simple; d=groups.io; h=From:To:Subject:Date:Message-Id:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20140610; t=1706786407; v=1; b=neHOKvpt0sAfbroDUzAn6+wbSERSA3IHVoniZhN01gtmAZBXSKwgEjYmanXCh8tk0n183QGK fG0rxlcI31ozK16YOFsV33zutcqExL0YfSraRAsvdM/c6VRoJ35n8h03ec9JY7fnaeeA5UYb5N1 vWK2uu+8+VV31fg2xa7mkm3k= X-Received: by 127.0.0.2 with SMTP id VNWyYY7687511xsDpIZb5q3b; Thu, 01 Feb 2024 03:20:07 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.13072.1706786406013912604 for ; Thu, 01 Feb 2024 03:20:06 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="407589405" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="407589405" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 03:20:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="912097596" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="912097596" X-Received: from sh1gapp1009.ccr.corp.intel.com ([10.239.189.219]) by orsmga004.jf.intel.com with ESMTP; 01 Feb 2024 03:20:04 -0800 From: "Wu, Jiaxin" To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v1 0/2] SMM CPU Optimization for SMM Init & SMI Process Date: Thu, 1 Feb 2024 19:19:59 +0800 Message-Id: <20240201112001.14416-1-jiaxin.wu@intel.com> Precedence: Bulk 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,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NIMSLhid6WlEM3NZTYKf6pyex7686176AA= X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=neHOKvpt; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Optimization 1: Existing CheckFeatureSupported function will check CET & XD features on each processor. The CPUIDs for CET & XD features are software visible domain, which means a properly configured platform will have consistent values for these CPUID Leafs/SubLeafs/Fields on each logical processor. So, execute Execute CET and XD check only on BSP. As for MSR_IA32_MISC_ENABLE.BTS, it's core scope according SDM. So, still keep it check on each processor. Optimization 2: UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg This patch is to check BspIndex first before lock cmpxchg operation. It's the optimization to lower the resource contention caused by the atomic compare exchange operation, so as to improve the SMI performance for BSP election. Jiaxin Wu (2): UefiCpuPkg/PiSmmCpuDxeSmm: Execute CET and XD check only on BSP UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 12 +++-- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 6 +-- UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 78 +++++++++++++++++------------- UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h | 6 ++- 4 files changed, 59 insertions(+), 43 deletions(-) -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114942): https://edk2.groups.io/g/devel/message/114942 Mute This Topic: https://groups.io/mt/104094805/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-