From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, w.sheng@intel.com
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Zhiguang Liu <zhiguang.liu@intel.com>,
Jiewen Yao <jiewen.yao@intel.com>
Subject: Re: [edk2-devel] [PATCH v4 1/2] MdePkg/Include: Add CET instructions to Nasm.inc
Date: Fri, 19 Feb 2021 17:57:00 +0100 [thread overview]
Message-ID: <c74dfe26-a4b1-3bb2-0404-d1d11056e279@redhat.com> (raw)
In-Reply-To: <20210219044756.2860-2-w.sheng@intel.com>
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 <w.sheng@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> ---
> 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
>
next prev parent reply other threads:[~2021-02-19 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 4:47 [PATCH v4 0/2] Fix CET shadow stack token busy bit clear issue Sheng Wei
2021-02-19 4:47 ` [PATCH v4 1/2] MdePkg/Include: Add CET instructions to Nasm.inc Sheng Wei
2021-02-19 16:57 ` Laszlo Ersek [this message]
2021-02-19 4:47 ` [PATCH v4 2/2] UefiCpuPkg/CpuExceptionHandlerLib: Clear CET shadow stack token busy bit Sheng Wei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c74dfe26-a4b1-3bb2-0404-d1d11056e279@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox