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 9FBA39413CE for ; Tue, 21 Nov 2023 07:02:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vqCNXIXMjed0lQDUzrFn0taSsCvUHIw4LPv3kfXYmSU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: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=1700550172; v=1; b=BCcEycantYsA/U6DfLhl+T36T0oQQ4qSTBPNubDlQDfQ+yHPOFdXyjnaumXNsLyUU5M9fHbm 0NvEakXzfXqPnTmiRjorwXPZLVv54nMdsP15OBdAX+vDjOc8MvTN9XWRd+DZ9o3Wkijldw6NNbj uiEnxLQudKu/cEBh8pPVJ2Eo= X-Received: by 127.0.0.2 with SMTP id a3d3YY7687511xcVShprbXiH; Mon, 20 Nov 2023 23:02:52 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.30512.1700550170171771930 for ; Mon, 20 Nov 2023 23:02:51 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="390633391" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="390633391" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 23:02:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="795704917" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="795704917" X-Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.28]) by orsmga008.jf.intel.com with ESMTP; 20 Nov 2023 23:02:49 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek , Wu Jiaxin , Tan Dun Subject: [edk2-devel] [PATCH v6 1/6] MdePkg: Add macro definitions for CET feature for NASM files. Date: Tue, 21 Nov 2023 15:02:41 +0800 Message-Id: <20231121070246.505-2-w.sheng@intel.com> In-Reply-To: <20231121070246.505-1-w.sheng@intel.com> References: <20231121070246.505-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: 2Y1gNScqysLFrfPU6PMFcHKlx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=BCcEycan; 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 Signed-off-by: Sheng Wei Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Wu Jiaxin Cc: Tan Dun Reviewed-by: Laszlo Ersek --- MdePkg/Include/Ia32/Cet.inc | 26 ++++++++++++++++++++++++++ MdePkg/Include/X64/Cet.inc | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 MdePkg/Include/Ia32/Cet.inc create mode 100644 MdePkg/Include/X64/Cet.inc diff --git a/MdePkg/Include/Ia32/Cet.inc b/MdePkg/Include/Ia32/Cet.inc new file mode 100644 index 0000000000..41c99988c9 --- /dev/null +++ b/MdePkg/Include/Ia32/Cet.inc @@ -0,0 +1,26 @@ +;-------------------------------------------------------------------------= -----=0D +;=0D +; Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D +; SPDX-License-Identifier: BSD-2-Clause-Patent=0D +;=0D +; Abstract:=0D +;=0D +; This file provides macro definitions for CET feature for NASM files.=0D +;=0D +;-------------------------------------------------------------------------= -----=0D +=0D +%define MSR_IA32_U_CET 0x6A0=0D +%define MSR_IA32_S_CET 0x6A2=0D +%define MSR_IA32_CET_SH_STK_EN (1<<0)=0D +%define MSR_IA32_CET_WR_SHSTK_EN (1<<1)=0D +%define MSR_IA32_CET_ENDBR_EN (1<<2)=0D +%define MSR_IA32_CET_LEG_IW_EN (1<<3)=0D +%define MSR_IA32_CET_NO_TRACK_EN (1<<4)=0D +%define MSR_IA32_CET_SUPPRESS_DIS (1<<5)=0D +%define MSR_IA32_CET_SUPPRESS (1<<10)=0D +%define MSR_IA32_CET_TRACKER (1<<11)=0D +%define MSR_IA32_PL0_SSP 0x6A4=0D +%define MSR_IA32_INTERRUPT_SSP_TABLE_ADDR 0x6A8=0D +=0D +%define CR4_CET_BIT 23=0D +%define CR4_CET (1<=0D +; SPDX-License-Identifier: BSD-2-Clause-Patent=0D +;=0D +; Abstract:=0D +;=0D +; This file provides macro definitions for CET feature for NASM files.=0D +;=0D +;-------------------------------------------------------------------------= -----=0D +=0D +%define MSR_IA32_U_CET 0x6A0=0D +%define MSR_IA32_S_CET 0x6A2=0D +%define MSR_IA32_CET_SH_STK_EN (1<<0)=0D +%define MSR_IA32_CET_WR_SHSTK_EN (1<<1)=0D +%define MSR_IA32_CET_ENDBR_EN (1<<2)=0D +%define MSR_IA32_CET_LEG_IW_EN (1<<3)=0D +%define MSR_IA32_CET_NO_TRACK_EN (1<<4)=0D +%define MSR_IA32_CET_SUPPRESS_DIS (1<<5)=0D +%define MSR_IA32_CET_SUPPRESS (1<<10)=0D +%define MSR_IA32_CET_TRACKER (1<<11)=0D +%define MSR_IA32_PL0_SSP 0x6A4=0D +%define MSR_IA32_INTERRUPT_SSP_TABLE_ADDR 0x6A8=0D +=0D +%define CR4_CET_BIT 23=0D +%define CR4_CET (1<