From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com []) by mx.groups.io with SMTP id smtpd.web09.4553.1613710085522905002 for ; Thu, 18 Feb 2021 20:48:06 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: w.sheng@intel.com) IronPort-SDR: ScIfriJKHiegzHLaUK+kmyRCNSNpJxTAy4gRcStSoAaAbmSnamMF/MCWWjkXXS/dfpce9ro9Ov /gyaQdnZhu9w== X-IronPort-AV: E=McAfee;i="6000,8403,9899"; a="163517750" X-IronPort-AV: E=Sophos;i="5.81,189,1610438400"; d="scan'208";a="163517750" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2021 20:48:02 -0800 IronPort-SDR: G7TfrTP4U18YQW2ykAftdMtRlaF6gmjPgOMwquard87w5efj17HfyCY5BhnVB2B2ZPPS5CyXT9 J/FAYiwm4ztg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,189,1610438400"; d="scan'208";a="495894856" Received: from unknown (HELO shwdeSSSDDPDWEI.ccr.corp.intel.com) ([10.239.157.35]) by fmsmga001.fm.intel.com with ESMTP; 18 Feb 2021 20:48:01 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao Subject: [PATCH v4 1/2] MdePkg/Include: Add CET instructions to Nasm.inc Date: Fri, 19 Feb 2021 12:47:55 +0800 Message-Id: <20210219044756.2860-2-w.sheng@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20210219044756.2860-1-w.sheng@intel.com> References: <20210219044756.2860-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. 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