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 0A0DBD807AB for ; Wed, 15 Nov 2023 04:12:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Spj9387So/N2kv1FiBD8mQsq6fY8cA+x+DsrX0L7g5M=; 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=1700021548; v=1; b=rZ4r08CwFxO/wNo9wImao4N8AtK0FawopxqPr/i9kiIuVyo8a0BRKZk4gB3ZGEz3uwAGjx2h k1TUxlsGozswzJoOwL+hfwQZ1gWqSZTAhJ6GB48su+Xb4AzNW6e/X6CF7lbnY3B8eVFQuDXPIGo AOjDglR6IYYaIHqHkF1fNwE4= X-Received: by 127.0.0.2 with SMTP id nYhzYY7687511x35I59bD04V; Tue, 14 Nov 2023 20:12:28 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.5844.1700021541097014257 for ; Tue, 14 Nov 2023 20:12:24 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="393666241" X-IronPort-AV: E=Sophos;i="6.03,303,1694761200"; d="scan'208";a="393666241" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2023 20:12:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="882266115" X-IronPort-AV: E=Sophos;i="6.03,303,1694761200"; d="scan'208";a="882266115" X-Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.28]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2023 20:12:22 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek , Wu Jiaxin , Tan Dun Subject: [edk2-devel] [PATCH v5 2/6] UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in Cet.nasm. Date: Wed, 15 Nov 2023 12:12:12 +0800 Message-Id: <20231115041216.2016-3-w.sheng@intel.com> In-Reply-To: <20231115041216.2016-1-w.sheng@intel.com> References: <20231115041216.2016-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: DmHigShU9lsK6al3eWKEyhK4x7686176AA= 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=rZ4r08Cw; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) Signed-off-by: Sheng Wei Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Wu Jiaxin Cc: Tan Dun Reviewed-by: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm | 5 +++-- UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm b/UefiCpuPkg/PiSmmCpuD= xeSmm/Ia32/Cet.nasm index 9d66b9c5da..3d07da1cd4 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm @@ -5,6 +5,7 @@ ;-------------------------------------------------------------------------= ------=0D =0D %include "Nasm.inc"=0D +%include "Cet.inc"=0D =0D SECTION .text=0D =0D @@ -16,7 +17,7 @@ ASM_PFX(DisableCet): incsspd eax=0D =0D mov eax, cr4=0D - btr eax, 23 ; clear CET=0D + btr eax, CR4_CET_BIT ; clear CET=0D mov cr4, eax=0D ret=0D =0D @@ -24,7 +25,7 @@ global ASM_PFX(EnableCet) ASM_PFX(EnableCet):=0D =0D mov eax, cr4=0D - bts eax, 23 ; set CET=0D + bts eax, CR4_CET_BIT ; set CET=0D mov cr4, eax=0D =0D ; use jmp to skip the check for ret=0D diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm b/UefiCpuPkg/PiSmmCpuDx= eSmm/X64/Cet.nasm index 8bbdbb31cc..700aef4703 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm @@ -5,6 +5,7 @@ ;-------------------------------------------------------------------------= ------=0D =0D %include "Nasm.inc"=0D +%include "Cet.inc"=0D =0D DEFAULT REL=0D SECTION .text=0D @@ -17,7 +18,7 @@ ASM_PFX(DisableCet): incsspq rax=0D =0D mov rax, cr4=0D - btr eax, 23 ; clear CET=0D + btr eax, CR4_CET_BIT ; clear CET=0D mov cr4, rax=0D ret=0D =0D @@ -25,7 +26,7 @@ global ASM_PFX(EnableCet) ASM_PFX(EnableCet):=0D =0D mov rax, cr4=0D - bts eax, 23 ; set CET=0D + bts eax, CR4_CET_BIT ; set CET=0D mov cr4, rax=0D =0D ; use jmp to skip the check for ret=0D --=20 2.26.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111236): https://edk2.groups.io/g/devel/message/111236 Mute This Topic: https://groups.io/mt/102599350/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-