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 057DB780091 for ; Mon, 13 Nov 2023 06:22:50 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=l8XW5jkdr07ZhP5IyVG1Jug96PeZOT1N4rj+7NrxhDI=; c=relaxed/simple; d=groups.io; h=From:To:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1699856569; v=1; b=FzQi554Blmw4fRRI5ULnpeX45hGmQGmmPKnUtQp9MiF+nIqRe4Cysa/i+uuzUtsBhK8oxFik 8Cnkf8O0A6huZluvagIqdSWMa6TT1GPm5plzPinYb59sZ6nTwvO6GabApHdEyyYjuMtnlRMY3u5 xsdwdlnHKhFVpacDTerWXTGw= X-Received: by 127.0.0.2 with SMTP id lLbYYY7687511xD0fmOJDsXk; Sun, 12 Nov 2023 22:22:49 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mx.groups.io with SMTP id smtpd.web10.31729.1699856568636155442 for ; Sun, 12 Nov 2023 22:22:48 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10892"; a="9028383" X-IronPort-AV: E=Sophos;i="6.03,298,1694761200"; d="scan'208";a="9028383" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2023 22:22:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10892"; a="887849529" X-IronPort-AV: E=Sophos;i="6.03,298,1694761200"; d="scan'208";a="887849529" X-Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.28]) by orsmga004.jf.intel.com with ESMTP; 12 Nov 2023 22:22:47 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v4 0/5] UefiCpuPkg: Add macro definitions for CET feature for NASM files. Date: Mon, 13 Nov 2023 14:22:40 +0800 Message-Id: <20231113062245.649-1-w.sheng@intel.com> MIME-Version: 1.0 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,w.sheng@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: wFV9ePAfDRAWVtlFbfa6En1Hx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=FzQi554B; 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 Patch V4: Separate the changes to 5 patches. 1) Add macro definitions for CET feature for NASM files. 2) Use macro CR4_CET_BIT to replace hard code value in Cet.nasm. 3) Use CET macro definitions in Cet.inc for SmiEntry.nasm files. 4) Only change CR4.CET bit for enable/disable CET. 5) Backup and Restore MSR IA32_U_CET in SMI handler. Remove some unused code. It is no need to clear MSR IA32_S_CET, because clear CR4.CET bit will disable all CET functions. Since CET is disabled between clear CR4.CET and run 'rsm', it is no need to delay MSR IA32_S_CET restoration. Patch V3: Remove the 3rd patch. mSmmInterruptSspTables is a global variable. It is unnecessary to initializ it to zero manually. Patch V2: No function change with Patch V1. Split the patch to into 3 separate patches. Sheng Wei (5): UefiCpuPkg: Add macro definitions for CET feature for NASM files. UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in Cet.nasm. UefiCpuPkg: Use CET macro definitions in Cet.inc for SmiEntry.nasm files. UefiCpuPkg: Only change CR4.CET bit for enable and disable CET. UefiCpuPkg: Backup and Restore MSR IA32_U_CET in SMI handler. UefiCpuPkg/Include/Cet.inc | 26 +++++++++++++ UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm | 5 ++- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 39 +++++++++++-------- UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm | 5 ++- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 40 +++++++++++--------- 5 files changed, 78 insertions(+), 37 deletions(-) create mode 100644 UefiCpuPkg/Include/Cet.inc -- 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111122): https://edk2.groups.io/g/devel/message/111122 Mute This Topic: https://groups.io/mt/102556832/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-