From mboxrd@z Thu Jan 1 00:00:00 1970 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.web12.11481.1613753828699870120 for ; Fri, 19 Feb 2021 08:57:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S8Y/C8tG; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613753827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GdJrW+hHrbTaPna/adL7PkvsuZ4w2SbuQ5s3vRc/1PY=; b=S8Y/C8tGrP9RMrJEafKAm87fHq//+ycib7hsjDSRWLzIMqw6olOw86fePSTRssbn8S2PoX W85UQkYnaoWXzO/aL4hYjdf5z6dm52Ac2NPz8c50zxOOtyGan9kiMeFYM6uhdQA6kH0v2d q+C8wNi5RU++xXyQnxpS9rt0QFacXhk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-10-z360jF7MNDOqKb1S_vhNIw-1; Fri, 19 Feb 2021 11:57:04 -0500 X-MC-Unique: z360jF7MNDOqKb1S_vhNIw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D13A8107ACE8; Fri, 19 Feb 2021 16:57:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-87.ams2.redhat.com [10.36.113.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4735F5C1BB; Fri, 19 Feb 2021 16:57:01 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 1/2] MdePkg/Include: Add CET instructions to Nasm.inc To: devel@edk2.groups.io, w.sheng@intel.com Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao References: <20210219044756.2860-1-w.sheng@intel.com> <20210219044756.2860-2-w.sheng@intel.com> From: "Laszlo Ersek" Message-ID: Date: Fri, 19 Feb 2021 17:57:00 +0100 MIME-Version: 1.0 In-Reply-To: <20210219044756.2860-2-w.sheng@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Sheng, On 02/19/21 05:47, Sheng Wei wrote: > 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 Under your v1 patch, I wrote the following: msgid <48aa5d2c-372d-31e5-0a69-8ae0a2234372@redhat.com> https://edk2.groups.io/g/devel/message/71366 I'll let others review this patch. I'm OK to add macros to the nasm.inc files under MdePkg, as wrappers for the DB-encoded CET instructions, as long as you also file a reminder BZ to replace the DBs with the actual instructions, once a CET-supporting NASM becomes available in CI. Can you please file a reminder BZ *now*, for removing the DB-encoded instructions, and can you also please reference that BZ ticket in the commit message of this patch? (To slightly correct my above quote, the new BZ should be addressed when the edk2-native BaseTools requirements are advanced to NASM 2.15.01 as well.) Thanks Laszlo > + > +%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 >