From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.2539.1613790934463072726 for ; Fri, 19 Feb 2021 19:15:34 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: w.sheng@intel.com) IronPort-SDR: FqCxlhL/KPod+w1VW7p39uqd5MNEBkXgWeFXOLZRxgQzXbHbcQc29cJVz88MPKxoo6YIHkK01b B+e9rN6fDL0g== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="184082925" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="184082925" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 19:15:34 -0800 IronPort-SDR: /C2healfzFvx5vzB82+dSVldSy3TmC5mzyHQiWDSGN7NTC1Aby3+xIFYJubXasI9EuzLA9NqJr IDK8a0YKhNtQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440520725" Received: from unknown (HELO shwdeSSSDDPDWEI.ccr.corp.intel.com) ([10.239.157.35]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 19:15:32 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao Subject: [PATCH v5 1/2] MdePkg/Include: Add CET instructions to Nasm.inc Date: Sat, 20 Feb 2021 11:15:00 +0800 Message-Id: <20210220031501.24284-2-w.sheng@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20210220031501.24284-1-w.sheng@intel.com> References: <20210220031501.24284-1-w.sheng@intel.com> This is to add instruction SAVEPREVSSP, CLRSSBSY and RSTORSSP_RAX in Nasm. The open CI is using NASM 2.14.02. CET instructions are supported since NASM 2.15.01. DB-encoded CET instructions need to be removed after open CI update to NASM 2.15.01. The BZ ticket is https://bugzilla.tianocore.org/show_bug.cgi?id=3227 . REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3192 Signed-off-by: Sheng Wei Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Jiewen Yao --- MdePkg/Include/Ia32/Nasm.inc | 12 ++++++++++++ MdePkg/Include/X64/Nasm.inc | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/MdePkg/Include/Ia32/Nasm.inc b/MdePkg/Include/Ia32/Nasm.inc index 31ce861f1e..fa42f9d3e9 100644 --- a/MdePkg/Include/Ia32/Nasm.inc +++ b/MdePkg/Include/Ia32/Nasm.inc @@ -9,6 +9,18 @@ ; ;------------------------------------------------------------------------------ +%macro SAVEPREVSSP 0 + DB 0xF3, 0x0F, 0x01, 0xEA +%endmacro + +%macro CLRSSBSY_EAX 0 + DB 0x67, 0xF3, 0x0F, 0xAE, 0x30 +%endmacro + +%macro RSTORSSP_EAX 0 + DB 0x67, 0xF3, 0x0F, 0x01, 0x28 +%endmacro + %macro SETSSBSY 0 DB 0xF3, 0x0F, 0x01, 0xE8 %endmacro diff --git a/MdePkg/Include/X64/Nasm.inc b/MdePkg/Include/X64/Nasm.inc index 42412735ea..e57a803c81 100644 --- a/MdePkg/Include/X64/Nasm.inc +++ b/MdePkg/Include/X64/Nasm.inc @@ -9,6 +9,18 @@ ; ;------------------------------------------------------------------------------ +%macro SAVEPREVSSP 0 + DB 0xF3, 0x0F, 0x01, 0xEA +%endmacro + +%macro CLRSSBSY_RAX 0 + DB 0xF3, 0x0F, 0xAE, 0x30 +%endmacro + +%macro RSTORSSP_RAX 0 + DB 0xF3, 0x0F, 0x01, 0x28 +%endmacro + %macro SETSSBSY 0 DB 0xF3, 0x0F, 0x01, 0xE8 %endmacro -- 2.16.2.windows.1