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 083C274004D for ; Wed, 15 Nov 2023 10:37:28 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=iNrVf9Ju8YAA9HljrNyvaVhccN0/QIZLu3eNjJKFfgU=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1700044647; v=1; b=Gt2KhkZHX86fDMxSWfxbwqixPvTAxwfmLy03d3+PBbK1GaJP0SeWXudofvVtOp49batNRCmo jAM1nozRZ7F9c8VKl01lRXoKBy1GGI8H3/vgWFs2F8wLyrO6EdH++qpU2PytvYe6aJXRrx2HsSX voY5KQj8NdGZILfdjSjgxpm4= X-Received: by 127.0.0.2 with SMTP id CVXfYY7687511x4kyrp57HAc; Wed, 15 Nov 2023 02:37:27 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.10296.1700044647098206943 for ; Wed, 15 Nov 2023 02:37:27 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-08ipWB3CMkK-Xidn1-aPjA-1; Wed, 15 Nov 2023 05:37:24 -0500 X-MC-Unique: 08ipWB3CMkK-Xidn1-aPjA-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7939B101AA6D; Wed, 15 Nov 2023 10:37:24 +0000 (UTC) X-Received: from [10.39.192.211] (unknown [10.39.192.211]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78007C27E80; Wed, 15 Nov 2023 10:37:23 +0000 (UTC) Message-ID: Date: Wed, 15 Nov 2023 11:37:22 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v5 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value. To: devel@edk2.groups.io, w.sheng@intel.com Cc: Eric Dong , Ray Ni , Wu Jiaxin , Tan Dun References: <20231115041216.2016-1-w.sheng@intel.com> <20231115041216.2016-7-w.sheng@intel.com> From: "Laszlo Ersek" In-Reply-To: <20231115041216.2016-7-w.sheng@intel.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 37qbXRQUlJ2YX8BaAoO18OLXx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=Gt2KhkZH; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.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 On 11/15/23 05:12, Sheng Wei wrote: > The macro is used in file LongJump.nasm and SetJump.nasm. >=20 > Signed-off-by: Sheng Wei > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Wu Jiaxin > Cc: Tan Dun > --- > MdePkg/Library/BaseLib/Ia32/LongJump.nasm | 3 ++- > MdePkg/Library/BaseLib/Ia32/SetJump.nasm | 3 ++- > MdePkg/Library/BaseLib/X64/LongJump.nasm | 3 ++- > MdePkg/Library/BaseLib/X64/SetJump.nasm | 3 ++- > 4 files changed, 8 insertions(+), 4 deletions(-) >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm b/MdePkg/Library/B= aseLib/Ia32/LongJump.nasm > index 6c13dfe307..df1bf9749e 100644 > --- a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- > =20 > %include "Nasm.inc" > +%include "Cet.inc" > =20 > SECTION .text > =20 > @@ -34,7 +35,7 @@ ASM_PFX(InternalLongJump): > test eax, eax > jz CetDone > mov eax, cr4 > - bt eax, 23 ; check if CET is enabled > + bt eax, CR4_CET_BIT ; check if CET is enabled > jnc CetDone > =20 > mov edx, [esp + 4] ; edx =3D JumpBuffer > diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm b/MdePkg/Library/Ba= seLib/Ia32/SetJump.nasm > index 2577373241..0c484f6852 100644 > --- a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- > =20 > %include "Nasm.inc" > +%include "Cet.inc" > =20 > SECTION .text > =20 > @@ -42,7 +43,7 @@ ASM_PFX(SetJump): > test eax, eax > jz CetDone > mov eax, cr4 > - bt eax, 23 ; check if CET is enabled > + bt eax, CR4_CET_BIT ; check if CET is enabled > jnc CetDone > =20 > mov eax, 1 > diff --git a/MdePkg/Library/BaseLib/X64/LongJump.nasm b/MdePkg/Library/Ba= seLib/X64/LongJump.nasm > index 2002f65cba..021b49e855 100644 > --- a/MdePkg/Library/BaseLib/X64/LongJump.nasm > +++ b/MdePkg/Library/BaseLib/X64/LongJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- > =20 > %include "Nasm.inc" > +%include "Cet.inc" > =20 > DEFAULT REL > SECTION .text > @@ -35,7 +36,7 @@ ASM_PFX(InternalLongJump): > test eax, eax > jz CetDone > mov rax, cr4 > - bt eax, 23 ; check if CET is enabled > + bt eax, CR4_CET_BIT ; check if CET is enabled > jnc CetDone > =20 > push rdx ; save rdx > diff --git a/MdePkg/Library/BaseLib/X64/SetJump.nasm b/MdePkg/Library/Bas= eLib/X64/SetJump.nasm > index 5943a5ebe5..d2c0991e66 100644 > --- a/MdePkg/Library/BaseLib/X64/SetJump.nasm > +++ b/MdePkg/Library/BaseLib/X64/SetJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- > =20 > %include "Nasm.inc" > +%include "Cet.inc" > =20 > DEFAULT REL > SECTION .text > @@ -44,7 +45,7 @@ ASM_PFX(SetJump): > test eax, eax > jz CetDone > mov rax, cr4 > - bt eax, 23 ; check if CET is enabled > + bt eax, CR4_CET_BIT ; check if CET is enabled > jnc CetDone > =20 > mov rax, 1 Reviewed-by: Laszlo Ersek -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111251): https://edk2.groups.io/g/devel/message/111251 Mute This Topic: https://groups.io/mt/102599356/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-