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 2C888740048 for ; Wed, 15 Nov 2023 10:33:52 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pe6kemxRTIx9OHRRdRt/fsbECQGNarcHvoem/fVK9Ug=; 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=1700044430; v=1; b=hOMyuWxIKz4QApfRPMQ4/HESNVbl7MhSUXGmeKm5t/lIAjtHhw5IvGJaj9XFfs53TD7D9eSp jJc3zqCG9kum5DTrCowKI8Ij77i2FIC1M14wfUDoDCGyfW3GpLngeQVYqV1OPrWCsfm9iN62W8Q 5OhgB6HExjQPQwFRvBo7EAzs= X-Received: by 127.0.0.2 with SMTP id zNsaYY7687511xnAcJymlXqh; Wed, 15 Nov 2023 02:33:50 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.10318.1700044430218894642 for ; Wed, 15 Nov 2023 02:33:50 -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-618-fIg5eyRXPoO5NNNpnmZC8g-1; Wed, 15 Nov 2023 05:33:46 -0500 X-MC-Unique: fIg5eyRXPoO5NNNpnmZC8g-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 DFD7C810FC4; Wed, 15 Nov 2023 10:33:45 +0000 (UTC) X-Received: from [10.39.192.211] (unknown [10.39.192.211]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC96F1C060B0; Wed, 15 Nov 2023 10:33:44 +0000 (UTC) Message-ID: Date: Wed, 15 Nov 2023 11:33:43 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v4 1/5] UefiCpuPkg: Add macro definitions for CET feature for NASM files. To: "Ni, Ray" , "Sheng, W" , "devel@edk2.groups.io" Cc: "Dong, Eric" , "Wu, Jiaxin" , "Tan, Dun" References: <20231113062245.649-1-w.sheng@intel.com> <20231113062245.649-2-w.sheng@intel.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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: ervul326lKBNvIq8sgugg941x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=hOMyuWxI; 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 03:02, Ni, Ray wrote: > If only CpuSmm driver consumes these macros, can we move the macro > definitions into CpuSmm driver folder? Sounds like a good idea. I'm unsure how we can put "UefiCpuPkg/PiSmmCpuDxeSmm/" on the include path though, for assembly files located in UefiCpuPkg/PiSmmCpuDxeSmm/Ia32 and UefiCpuPkg/PiSmmCpuDxeSmm/X64: (1) "UefiCpuPkg.dec" says [Includes] Include (2) "BaseTools/Conf/build_rule.template" seems to use NASM_INC as a placeholder / macro for NASM-specific include directory (3) From commit 073a76e66293 ("BaseTools: Add $(INC)-like support when compiling .nasm files", 2018-12-19), "BaseTools/Source/Python/AutoGen/GenMake.py" seems to replace NASM_INC with a list of -I dir/ -I dir/ -I dir/ ... options for NASM, where "dir" iterates through the elements of point (1). ... If we place the "Cet.inc" file under "UefiCpuPkg/PiSmmCpuDxeSmm/", can we include it with %include "../Cet.inc" (note the "../" prefix), in the files UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm? Will that work on Windows too? Laszlo > ------------------------------------------------------------------------ > *From:* Sheng, W > *Sent:* Monday, November 13, 2023 2:22 PM > *To:* devel@edk2.groups.io > *Cc:* Dong, Eric ; Ni, Ray ; > Laszlo Ersek ; Wu, Jiaxin ; Tan, > Dun > *Subject:* [PATCH v4 1/5] UefiCpuPkg: Add macro definitions for CET > feature for NASM files. >   > Signed-off-by: Sheng Wei > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Wu Jiaxin > Cc: Tan Dun > --- >  UefiCpuPkg/Include/Cet.inc | 26 ++++++++++++++++++++++++++ >  1 file changed, 26 insertions(+) >  create mode 100644 UefiCpuPkg/Include/Cet.inc > > diff --git a/UefiCpuPkg/Include/Cet.inc b/UefiCpuPkg/Include/Cet.inc > new file mode 100644 > index 0000000000..a4038a0682 > --- /dev/null > +++ b/UefiCpuPkg/Include/Cet.inc > @@ -0,0 +1,26 @@ > +;------------------------------------------------------------------------------ > > +; > > +; Copyright (c) 2023, Intel Corporation. All rights reserved.
> > +; SPDX-License-Identifier: BSD-2-Clause-Patent > > +; > > +; Abstract: > > +; > > +;   This file provides macro definitions for CET feature for NASM files. > > +; > > +;------------------------------------------------------------------------------ > > + > > +%define MSR_IA32_U_CET                     0x6A0 > > +%define MSR_IA32_S_CET                     0x6A2 > > +%define MSR_IA32_CET_SH_STK_EN             0x1 > > +%define MSR_IA32_CET_WR_SHSTK_EN           0x2 > > +%define MSR_IA32_CET_ENDBR_EN              0x4 > > +%define MSR_IA32_CET_LEG_IW_EN             0x8 > > +%define MSR_IA32_CET_NO_TRACK_EN           0x10 > > +%define MSR_IA32_CET_SUPPRESS_DIS          0x20 > > +%define MSR_IA32_CET_SUPPRESS              0x400 > > +%define MSR_IA32_CET_TRACKER               0x800 > > +%define MSR_IA32_PL0_SSP                   0x6A4 > > +%define MSR_IA32_INTERRUPT_SSP_TABLE_ADDR  0x6A8 > > + > > +%define CR4_CET_BIT                        23 > > +%define CR4_CET                            0x800000 > > -- > 2.26.2.windows.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111250): https://edk2.groups.io/g/devel/message/111250 Mute This Topic: https://groups.io/mt/102556833/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-