From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.47403.1640749010853964926 for ; Tue, 28 Dec 2021 19:37:30 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 29 Dec 2021 11:14:38 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Jason'" , Cc: "'Michael D Kinney'" , "'Zhiguang Liu'" References: <20211229021026.3107-1-yun.lou@intel.com> <20211229021026.3107-2-yun.lou@intel.com> In-Reply-To: <20211229021026.3107-2-yun.lou@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggdjEgMi80XSBNZGVQa2c6IFJlcGxhY2UgT3Bjb2RlIHdpdGggdGhlIGNvcnJlc3BvbmRpbmcgaW5zdHJ1Y3Rpb25zLg==?= Date: Wed, 29 Dec 2021 11:14:50 +0800 Message-ID: <012e01d7fc62$3e29f290$ba7dd7b0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQDiFwwHKY21BPbnSSWwcCYnbO88SAFFayVMripqzhA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Jason: Does this change depend on new version nasm compiler? Can you provide which nasm compiler version is required? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Jason > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA12=D4=C229=C8=D5 10:10 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Jason Lou ; Michael D Kinney > ; Liming Gao ; > Zhiguang Liu > =D6=F7=CC=E2: [PATCH v1 2/4] MdePkg: Replace Opcode with the = corresponding > instructions. >=20 > From: Jason Lou >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3790 >=20 > Replace Opcode with the corresponding instructions. > The code changes have been verified with CompareBuild.py tool, which > can be used to compare the results of two different EDK II builds to > determine if they generate the same binaries. > (the tool link: https://github.com/mdkinney/edk2) >=20 > Signed-off-by: Jason Lou > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > --- > MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm | 20 > ++++++++------------ > MdePkg/Library/BaseLib/Ia32/LongJump.nasm | 6 +++--- > MdePkg/Library/BaseLib/Ia32/Monitor.nasm | 4 ++-- > MdePkg/Library/BaseLib/Ia32/Mwait.nasm | 4 ++-- > MdePkg/Library/BaseLib/Ia32/RdRand.nasm | 13 +++++-------- > MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm | 6 +++--- > MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm | 6 +++--- > MdePkg/Library/BaseLib/Ia32/SetJump.nasm | 6 +++--- > MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm | 6 +++--- > MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm | 6 +++--- > MdePkg/Library/BaseLib/X64/DisablePaging64.nasm | 5 ++--- > MdePkg/Library/BaseLib/X64/LongJump.nasm | 6 +++--- > MdePkg/Library/BaseLib/X64/Monitor.nasm | 4 ++-- > MdePkg/Library/BaseLib/X64/Mwait.nasm | 4 ++-- > MdePkg/Library/BaseLib/X64/RdRand.nasm | 11 ++++------- > MdePkg/Library/BaseLib/X64/ReadDr4.nasm | 4 ++-- > MdePkg/Library/BaseLib/X64/ReadDr5.nasm | 4 ++-- > MdePkg/Library/BaseLib/X64/ReadMm0.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm1.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm2.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm3.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm4.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm5.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm6.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/ReadMm7.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/SetJump.nasm | 6 +++--- > MdePkg/Library/BaseLib/X64/WriteDr4.nasm | 4 ++-- > MdePkg/Library/BaseLib/X64/WriteDr5.nasm | 4 ++-- > MdePkg/Library/BaseLib/X64/WriteMm0.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm1.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm2.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm3.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm4.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm5.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm6.nasm | 7 ++----- > MdePkg/Library/BaseLib/X64/WriteMm7.nasm | 7 ++----- > MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm | 10 > +++++----- > MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm | 8 ++++---- > MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm | 8 ++++---- > MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm | 10 > +++++----- > MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm | 6 +++--- > MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm | 8 ++++---- > 42 files changed, 116 insertions(+), 175 deletions(-) >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm > b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm > index 544e3c3892..492306fd70 100644 > --- a/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -44,16 +44,12 @@ ASM_PFX(InternalX86EnablePaging64): > mov cr0, eax ; enable paging >=20 > retf ; topmost 2 dwords hold the > address >=20 > .0: >=20 > - DB 0x67, 0x48 ; 32-bit address size, > 64-bit operand size >=20 > - mov ebx, [esp] ; mov rbx, [esp] >=20 > - DB 0x67, 0x48 >=20 > - mov ecx, [esp + 8] ; mov rcx, [esp + 8] >=20 > - DB 0x67, 0x48 >=20 > - mov edx, [esp + 0x10] ; mov rdx, [esp + 10h] >=20 > - DB 0x67, 0x48 >=20 > - mov esp, [esp + 0x18] ; mov rsp, [esp + 18h] >=20 > - DB 0x48 >=20 > - add esp, -0x20 ; add rsp, -20h >=20 > - call ebx ; call rbx >=20 > +BITS 64 >=20 > + mov rbx, [esp] >=20 > + mov rcx, [esp + 8] >=20 > + mov rdx, [esp + 0x10] >=20 > + mov rsp, [esp + 0x18] >=20 > + add rsp, -0x20 >=20 > + call rbx >=20 > hlt ; no one should get here >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > b/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > index f94d10f806..17e215b9cb 100644 > --- a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006 - 2019, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -39,12 +39,12 @@ ASM_PFX(InternalLongJump): >=20 >=20 > mov edx, [esp + 4] ; edx =3D JumpBuffer >=20 > mov edx, [edx + 24] ; edx =3D target SSP >=20 > - READSSP_EAX >=20 > + rdsspd eax >=20 > sub edx, eax ; edx =3D delta >=20 > mov eax, edx ; eax =3D delta >=20 >=20 >=20 > shr eax, 2 ; eax =3D delta/sizeof(UINT32) >=20 > - INCSSP_EAX >=20 > + incsspd eax >=20 >=20 >=20 > CetDone: >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/Monitor.nasm > b/MdePkg/Library/BaseLib/Ia32/Monitor.nasm > index 28dc0ba70a..145520ce44 100644 > --- a/MdePkg/Library/BaseLib/Ia32/Monitor.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/Monitor.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,6 +31,6 @@ ASM_PFX(AsmMonitor): > mov eax, [esp + 4] >=20 > mov ecx, [esp + 8] >=20 > mov edx, [esp + 12] >=20 > - DB 0xf, 1, 0xc8 ; monitor >=20 > + monitor >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/Mwait.nasm > b/MdePkg/Library/BaseLib/Ia32/Mwait.nasm > index 3956940cab..f0a6d14f5f 100644 > --- a/MdePkg/Library/BaseLib/Ia32/Mwait.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/Mwait.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -29,6 +29,6 @@ global ASM_PFX(AsmMwait) > ASM_PFX(AsmMwait): >=20 > mov eax, [esp + 4] >=20 > mov ecx, [esp + 8] >=20 > - DB 0xf, 1, 0xc9 ; mwait >=20 > + mwait >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/RdRand.nasm > b/MdePkg/Library/BaseLib/Ia32/RdRand.nasm > index e12b8e9611..7a69dc9b0d 100644 > --- a/MdePkg/Library/BaseLib/Ia32/RdRand.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/RdRand.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2015 - 2016, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2015 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -25,9 +25,8 @@ SECTION .text > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalX86RdRand16) >=20 > ASM_PFX(InternalX86RdRand16): >=20 > - ; rdrand ax ; generate a 16 bit RN into ax >=20 > + rdrand eax ; generate a 16 bit RN into ax >=20 > ; CF=3D1 if RN generated ok, > otherwise CF=3D0 >=20 > - db 0xf, 0xc7, 0xf0 ; rdrand r16: "0f c7 /6 > ModRM:r/m(w)" >=20 > jc rn16_ok ; jmp if CF=3D1 >=20 > xor eax, eax ; reg=3D0 if CF=3D0 >=20 > ret ; return with failure status >=20 > @@ -45,9 +44,8 @@ rn16_ok: > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalX86RdRand32) >=20 > ASM_PFX(InternalX86RdRand32): >=20 > - ; rdrand eax ; generate a 32 bit RN into eax >=20 > + rdrand eax ; generate a 32 bit RN into eax >=20 > ; CF=3D1 if RN generated ok, > otherwise CF=3D0 >=20 > - db 0xf, 0xc7, 0xf0 ; rdrand r32: "0f c7 /6 > ModRM:r/m(w)" >=20 > jc rn32_ok ; jmp if CF=3D1 >=20 > xor eax, eax ; reg=3D0 if CF=3D0 >=20 > ret ; return with failure status >=20 > @@ -65,14 +63,13 @@ rn32_ok: > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalX86RdRand64) >=20 > ASM_PFX(InternalX86RdRand64): >=20 > - ; rdrand eax ; generate a 32 bit RN into eax >=20 > + rdrand eax ; generate a 32 bit RN into eax >=20 > ; CF=3D1 if RN generated ok, > otherwise CF=3D0 >=20 > - db 0xf, 0xc7, 0xf0 ; rdrand r32: "0f c7 /6 > ModRM:r/m(w)" >=20 > jnc rn64_ret ; jmp if CF=3D0 >=20 > mov edx, dword [esp + 4] >=20 > mov [edx], eax >=20 >=20 >=20 > - db 0xf, 0xc7, 0xf0 ; generate another 32 bit RN >=20 > + rdrand eax ; generate another 32 bit RN >=20 > jnc rn64_ret ; jmp if CF=3D0 >=20 > mov [edx + 4], eax >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm > b/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm > index 81c681de34..0014720143 100644 > --- a/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,8 +31,8 @@ ASM_PFX(AsmReadDr4): > ; this register will cause a #UD exception. >=20 > ; >=20 > ; MS assembler doesn't support this instruction since no one = would use > it >=20 > - ; under normal circustances. Here opcode is used. >=20 > + ; under normal circustances. >=20 > ; >=20 > - DB 0xf, 0x21, 0xe0 >=20 > + mov eax, dr4 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm > b/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm > index e2deacb832..40f48e07e9 100644 > --- a/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,8 +31,8 @@ ASM_PFX(AsmReadDr5): > ; this register will cause a #UD exception. >=20 > ; >=20 > ; MS assembler doesn't support this instruction since no one = would use > it >=20 > - ; under normal circustances. Here opcode is used. >=20 > + ; under normal circustances. >=20 > ; >=20 > - DB 0xf, 0x21, 0xe8 >=20 > + mov eax, dr5 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > b/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > index 364613b5f9..978e1946af 100644 > --- a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006 - 2019, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -46,8 +46,8 @@ ASM_PFX(SetJump): > jnc CetDone >=20 >=20 >=20 > mov eax, 1 >=20 > - INCSSP_EAX ; to read original SSP >=20 > - READSSP_EAX >=20 > + incsspd eax ; to read original SSP >=20 > + rdsspd eax >=20 > mov [edx + 0x24], eax ; save SSP >=20 >=20 >=20 > CetDone: >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm > b/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm > index 0d23fca111..e36678ff24 100644 > --- a/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -32,8 +32,8 @@ ASM_PFX(AsmWriteDr4): > ; this register will cause a #UD exception. >=20 > ; >=20 > ; MS assembler doesn't support this instruction since no one = would use > it >=20 > - ; under normal circustances. Here opcode is used. >=20 > + ; under normal circustances. >=20 > ; >=20 > - DB 0xf, 0x23, 0xe0 >=20 > + mov dr4, eax >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm > b/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm > index bc5f424b8d..2a43ef6b9c 100644 > --- a/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -32,8 +32,8 @@ ASM_PFX(AsmWriteDr5): > ; this register will cause a #UD exception. >=20 > ; >=20 > ; MS assembler doesn't support this instruction since no one = would use > it >=20 > - ; under normal circustances. Here opcode is used. >=20 > + ; under normal circustances. >=20 > ; >=20 > - DB 0xf, 0x23, 0xe8 >=20 > + mov dr5, eax >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm > b/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm > index c76ed1a76c..55fef56fc4 100644 > --- a/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm > +++ b/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006 - 2008, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -51,8 +51,7 @@ ASM_PFX(InternalX86DisablePaging64): > sub eax, 4 ; eax <- One slot below > transition code on the stack >=20 > push rcx ; push Cs to stack >=20 > push r10 ; push address of tansition > code on stack >=20 > - DB 0x48 ; prefix to composite > "retq" with next "retf" >=20 > - retf ; Use far return to load CS > register from stack >=20 > + retfq >=20 >=20 >=20 > ; Start of transition code >=20 > .0: >=20 > diff --git a/MdePkg/Library/BaseLib/X64/LongJump.nasm > b/MdePkg/Library/BaseLib/X64/LongJump.nasm > index 59f7092169..0cbad70edc 100644 > --- a/MdePkg/Library/BaseLib/X64/LongJump.nasm > +++ b/MdePkg/Library/BaseLib/X64/LongJump.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006 - 2019, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -41,12 +41,12 @@ ASM_PFX(InternalLongJump): > push rdx ; save rdx >=20 >=20 >=20 > mov rdx, [rcx + 0xF8] ; rdx =3D target SSP >=20 > - READSSP_RAX >=20 > + rdsspq rax >=20 > sub rdx, rax ; rdx =3D delta >=20 > mov rax, rdx ; rax =3D delta >=20 >=20 >=20 > shr rax, 3 ; rax =3D = delta/sizeof(UINT64) >=20 > - INCSSP_RAX >=20 > + incsspq rax >=20 >=20 >=20 > pop rdx ; restore rdx >=20 > CetDone: >=20 > diff --git a/MdePkg/Library/BaseLib/X64/Monitor.nasm > b/MdePkg/Library/BaseLib/X64/Monitor.nasm > index e1ccb83a85..5855bc3522 100644 > --- a/MdePkg/Library/BaseLib/X64/Monitor.nasm > +++ b/MdePkg/Library/BaseLib/X64/Monitor.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -32,6 +32,6 @@ ASM_PFX(AsmMonitor): > mov eax, ecx >=20 > mov ecx, edx >=20 > mov edx, r8d >=20 > - DB 0xf, 1, 0xc8 ; monitor >=20 > + monitor >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/Mwait.nasm > b/MdePkg/Library/BaseLib/X64/Mwait.nasm > index 83fc895491..fc34b6f6f4 100644 > --- a/MdePkg/Library/BaseLib/X64/Mwait.nasm > +++ b/MdePkg/Library/BaseLib/X64/Mwait.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -30,6 +30,6 @@ global ASM_PFX(AsmMwait) > ASM_PFX(AsmMwait): >=20 > mov eax, ecx >=20 > mov ecx, edx >=20 > - DB 0xf, 1, 0xc9 ; mwait >=20 > + mwait >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/RdRand.nasm > b/MdePkg/Library/BaseLib/X64/RdRand.nasm > index 7e7fe99670..8417b4dfb4 100644 > --- a/MdePkg/Library/BaseLib/X64/RdRand.nasm > +++ b/MdePkg/Library/BaseLib/X64/RdRand.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2015 - 2016, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2015 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -26,9 +26,8 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalX86RdRand16) >=20 > ASM_PFX(InternalX86RdRand16): >=20 > - ; rdrand ax ; generate a 16 bit RN into eax, >=20 > + rdrand eax ; generate a 16 bit RN into eax, >=20 > ; CF=3D1 if RN generated ok, > otherwise CF=3D0 >=20 > - db 0xf, 0xc7, 0xf0 ; rdrand r16: "0f c7 /6 > ModRM:r/m(w)" >=20 > jc rn16_ok ; jmp if CF=3D1 >=20 > xor rax, rax ; reg=3D0 if CF=3D0 >=20 > ret ; return with failure status >=20 > @@ -45,9 +44,8 @@ rn16_ok: > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalX86RdRand32) >=20 > ASM_PFX(InternalX86RdRand32): >=20 > - ; rdrand eax ; generate a 32 bit RN into eax, >=20 > + rdrand eax ; generate a 32 bit RN into eax, >=20 > ; CF=3D1 if RN generated ok, > otherwise CF=3D0 >=20 > - db 0xf, 0xc7, 0xf0 ; rdrand r32: "0f c7 /6 > ModRM:r/m(w)" >=20 > jc rn32_ok ; jmp if CF=3D1 >=20 > xor rax, rax ; reg=3D0 if CF=3D0 >=20 > ret ; return with failure status >=20 > @@ -64,9 +62,8 @@ rn32_ok: > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalX86RdRand64) >=20 > ASM_PFX(InternalX86RdRand64): >=20 > - ; rdrand rax ; generate a 64 bit RN into rax, >=20 > + rdrand rax ; generate a 64 bit RN into rax, >=20 > ; CF=3D1 if RN generated ok, > otherwise CF=3D0 >=20 > - db 0x48, 0xf, 0xc7, 0xf0 ; rdrand r64: "REX.W + 0f c7 /6 > ModRM:r/m(w)" >=20 > jc rn64_ok ; jmp if CF=3D1 >=20 > xor rax, rax ; reg=3D0 if CF=3D0 >=20 > ret ; return with failure status >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadDr4.nasm > b/MdePkg/Library/BaseLib/X64/ReadDr4.nasm > index 82c0a9a588..ea131c9fc3 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadDr4.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadDr4.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,6 +31,6 @@ ASM_PFX(AsmReadDr4): > ; There's no obvious reason to access this register, since it's aliased to >=20 > ; DR7 when DE=3D0 or an exception generated when DE=3D1 >=20 > ; >=20 > - DB 0xf, 0x21, 0xe0 >=20 > + mov rax, dr4 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadDr5.nasm > b/MdePkg/Library/BaseLib/X64/ReadDr5.nasm > index c309c66dfe..10aefc8d28 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadDr5.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadDr5.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,6 +31,6 @@ ASM_PFX(AsmReadDr5): > ; There's no obvious reason to access this register, since it's aliased to >=20 > ; DR7 when DE=3D0 or an exception generated when DE=3D1 >=20 > ; >=20 > - DB 0xf, 0x21, 0xe8 >=20 > + mov rax, dr5 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm0.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm0.nasm > index 615721b6aa..29d284c3b1 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm0.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm0.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm0) >=20 > ASM_PFX(AsmReadMm0): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xc0 >=20 > + movq rax, mm0 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm1.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm1.nasm > index 7b27393490..6e0b9bba29 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm1.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm1.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm1) >=20 > ASM_PFX(AsmReadMm1): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xc8 >=20 > + movq rax, mm1 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm2.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm2.nasm > index c654b91a7a..7c7d086c4f 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm2.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm2.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm2) >=20 > ASM_PFX(AsmReadMm2): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xd0 >=20 > + movq rax, mm2 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm3.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm3.nasm > index 88d51c0781..ecaea83c8f 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm3.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm3.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm3) >=20 > ASM_PFX(AsmReadMm3): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xd8 >=20 > + movq rax, mm3 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm4.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm4.nasm > index 4252d20bb1..63aed0911b 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm4.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm4.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm4) >=20 > ASM_PFX(AsmReadMm4): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xe0 >=20 > + movq rax, mm4 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm5.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm5.nasm > index d8f530dec8..f6b7b48536 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm5.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm5.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm5) >=20 > ASM_PFX(AsmReadMm5): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xe8 >=20 > + movq rax, mm5 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm6.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm6.nasm > index 6f6883c2b6..ff8d1de80c 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm6.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm6.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm6) >=20 > ASM_PFX(AsmReadMm6): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xf0 >=20 > + movq rax, mm6 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/ReadMm7.nasm > b/MdePkg/Library/BaseLib/X64/ReadMm7.nasm > index 573f15dfc8..17b0e7d2fb 100644 > --- a/MdePkg/Library/BaseLib/X64/ReadMm7.nasm > +++ b/MdePkg/Library/BaseLib/X64/ReadMm7.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmReadMm7) >=20 > ASM_PFX(AsmReadMm7): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x7e, 0xf8 >=20 > + movq rax, mm7 >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/SetJump.nasm > b/MdePkg/Library/BaseLib/X64/SetJump.nasm > index 5a68396eec..b15a7c5a65 100644 > --- a/MdePkg/Library/BaseLib/X64/SetJump.nasm > +++ b/MdePkg/Library/BaseLib/X64/SetJump.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006 - 2019, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -48,8 +48,8 @@ ASM_PFX(SetJump): > jnc CetDone >=20 >=20 >=20 > mov rax, 1 >=20 > - INCSSP_RAX ; to read original SSP >=20 > - READSSP_RAX >=20 > + incsspq rax ; to read original SSP >=20 > + rdsspq rax >=20 > mov [rcx + 0xF8], rax ; save SSP >=20 >=20 >=20 > CetDone: >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteDr4.nasm > b/MdePkg/Library/BaseLib/X64/WriteDr4.nasm > index c4b12c9e92..16765a6c08 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteDr4.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteDr4.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,7 +31,7 @@ ASM_PFX(AsmWriteDr4): > ; There's no obvious reason to access this register, since it's aliased to >=20 > ; DR6 when DE=3D0 or an exception generated when DE=3D1 >=20 > ; >=20 > - DB 0xf, 0x23, 0xe1 >=20 > + mov dr4, rcx >=20 > mov rax, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteDr5.nasm > b/MdePkg/Library/BaseLib/X64/WriteDr5.nasm > index 986a4a95d9..2161bed0be 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteDr5.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteDr5.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006 - 2008, Intel Corporation. All rights = reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,7 +31,7 @@ ASM_PFX(AsmWriteDr5): > ; There's no obvious reason to access this register, since it's aliased to >=20 > ; DR7 when DE=3D0 or an exception generated when DE=3D1 >=20 > ; >=20 > - DB 0xf, 0x23, 0xe9 >=20 > + mov dr5, rcx >=20 > mov rax, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm0.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm0.nasm > index 3f03529edf..028d42c2be 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm0.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm0.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm0) >=20 > ASM_PFX(AsmWriteMm0): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xc1 >=20 > + movq mm0, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm1.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm1.nasm > index f552d40716..cc98e6bd36 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm1.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm1.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm1) >=20 > ASM_PFX(AsmWriteMm1): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xc9 >=20 > + movq mm1, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm2.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm2.nasm > index 1bd176ced9..2450f955a4 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm2.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm2.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm2) >=20 > ASM_PFX(AsmWriteMm2): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xd1 >=20 > + movq mm2, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm3.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm3.nasm > index 403f140736..8ff3a24ea0 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm3.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm3.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm3) >=20 > ASM_PFX(AsmWriteMm3): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xd9 >=20 > + movq mm3, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm4.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm4.nasm > index d99709d495..d5dd4f8667 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm4.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm4.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm4) >=20 > ASM_PFX(AsmWriteMm4): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xe1 >=20 > + movq mm4, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm5.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm5.nasm > index 0467ac4220..d3ad74d7ae 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm5.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm5.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm5) >=20 > ASM_PFX(AsmWriteMm5): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xe9 >=20 > + movq mm5, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm6.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm6.nasm > index 6d2e5eb8fb..441c0f636e 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm6.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm6.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm6) >=20 > ASM_PFX(AsmWriteMm6): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xf1 >=20 > + movq mm6, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/WriteMm7.nasm > b/MdePkg/Library/BaseLib/X64/WriteMm7.nasm > index de72adf685..c98292e65f 100644 > --- a/MdePkg/Library/BaseLib/X64/WriteMm7.nasm > +++ b/MdePkg/Library/BaseLib/X64/WriteMm7.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -27,9 +27,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(AsmWriteMm7) >=20 > ASM_PFX(AsmWriteMm7): >=20 > - ; >=20 > - ; 64-bit MASM doesn't support MMX instructions, so use opcode = here >=20 > - ; >=20 > - DB 0x48, 0xf, 0x6e, 0xf9 >=20 > + movq mm7, rcx >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm > b/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm > index 5769c00bf9..139f3b6fa7 100644 > --- a/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm > +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -44,15 +44,15 @@ ASM_PFX(InternalMemCopyMem): > and r8, 7 >=20 > shr rcx, 3 ; rcx <- # of Qwords to copy >=20 > jz @CopyBytes >=20 > - DB 0x49, 0xf, 0x7e, 0xc2 ; movd r10, mm0 (Save mm0 > in r10) >=20 > + movq r10, mm0 >=20 > .1: >=20 > - DB 0xf, 0x6f, 0x6 ; movd mm0, [rsi] >=20 > - DB 0xf, 0xe7, 0x7 ; movntq [rdi], mm0 >=20 > + movq mm0, [rsi] >=20 > + movntq [rdi], mm0 >=20 > add rsi, 8 >=20 > add rdi, 8 >=20 > loop .1 >=20 > mfence >=20 > - DB 0x49, 0xf, 0x6e, 0xc2 ; movd mm0, r10 (Restore > mm0) >=20 > + movq mm0, r10 >=20 > jmp @CopyBytes >=20 > @CopyBackward: >=20 > mov rsi, r9 ; rsi <- End of Source >=20 > diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm > b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm > index 450113ba84..71df7c1121 100644 > --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm > +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -32,16 +32,16 @@ ASM_PFX(InternalMemSetMem): > push rdi >=20 > mov rax, r8 >=20 > mov ah, al >=20 > - DB 0x48, 0xf, 0x6e, 0xc0 ; movd mm0, rax >=20 > + movq mm0, rax >=20 > mov r8, rcx >=20 > mov rdi, r8 ; rdi <- Buffer >=20 > mov rcx, rdx >=20 > and edx, 7 >=20 > shr rcx, 3 >=20 > jz @SetBytes >=20 > - DB 0xf, 0x70, 0xC0, 0x0 ; pshufw mm0, mm0, 0h >=20 > + pshufw mm0, mm0, 0 >=20 > .0: >=20 > - DB 0xf, 0xe7, 0x7 ; movntq [rdi], mm0 >=20 > + movntq [rdi], mm0 >=20 > add rdi, 8 >=20 > loop .0 >=20 > mfence >=20 > diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm > b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm > index 4e1f4be2b4..5092e4db15 100644 > --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm > +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -31,16 +31,16 @@ global ASM_PFX(InternalMemSetMem16) > ASM_PFX(InternalMemSetMem16): >=20 > push rdi >=20 > mov rax, r8 >=20 > - DB 0x48, 0xf, 0x6e, 0xc0 ; movd mm0, rax >=20 > + movq mm0, rax >=20 > mov r8, rcx >=20 > mov rdi, r8 >=20 > mov rcx, rdx >=20 > and edx, 3 >=20 > shr rcx, 2 >=20 > jz @SetWords >=20 > - DB 0xf, 0x70, 0xC0, 0x0 ; pshufw mm0, mm0, 0h >=20 > + pshufw mm0, mm0, 0 >=20 > .0: >=20 > - DB 0xf, 0xe7, 0x7 ; movntq [rdi], mm0 >=20 > + movntq [rdi], mm0 >=20 > add rdi, 8 >=20 > loop .0 >=20 > mfence >=20 > diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm > b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm > index b3a7385897..ed2f80d30d 100644 > --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm > +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -28,20 +28,20 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalMemSetMem32) >=20 > ASM_PFX(InternalMemSetMem32): >=20 > - DB 0x49, 0xf, 0x6e, 0xc0 ; movd mm0, r8 (Value) >=20 > + movq mm0, r8 >=20 > mov rax, rcx ; rax <- Buffer >=20 > xchg rcx, rdx ; rcx <- Count rdx <- Buffer >=20 > shr rcx, 1 ; rcx <- # of qwords to set >=20 > jz @SetDwords >=20 > - DB 0xf, 0x70, 0xC0, 0x44 ; pshufw mm0, mm0, 44h >=20 > + pshufw mm0, mm0, 44h >=20 > .0: >=20 > - DB 0xf, 0xe7, 0x2 ; movntq [rdx], mm0 >=20 > + movntq [rdx], mm0 >=20 > lea rdx, [rdx + 8] ; use "lea" to avoid flag = changes >=20 > loop .0 >=20 > mfence >=20 > @SetDwords: >=20 > jnc .1 >=20 > - DB 0xf, 0x7e, 0x2 ; movd [rdx], mm0 >=20 > + movd [rdx], mm0 >=20 > .1: >=20 > ret >=20 >=20 >=20 > diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm > b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm > index f517e1d23a..b3f75b1636 100644 > --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm > +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -28,11 +28,11 @@ > ;------------------------------------------------------------------------= --- --- >=20 > global ASM_PFX(InternalMemSetMem64) >=20 > ASM_PFX(InternalMemSetMem64): >=20 > - DB 0x49, 0xf, 0x6e, 0xc0 ; movd mm0, r8 (Value) >=20 > + movq mm0, r8 >=20 > mov rax, rcx ; rax <- Buffer >=20 > xchg rcx, rdx ; rcx <- Count >=20 > .0: >=20 > - DB 0xf, 0xe7, 0x2 ; movntq [rdx], mm0 >=20 > + movntq [rdx], mm0 >=20 > add rdx, 8 >=20 > loop .0 >=20 > mfence >=20 > diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm > b/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm > index 2a85f15b55..2865d26b34 100644 > --- a/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm > +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm > @@ -1,6 +1,6 @@ > ;------------------------------------------------------------------------= --- --- >=20 > ; >=20 > -; Copyright (c) 2006, Intel Corporation. All rights reserved.
>=20 > +; Copyright (c) 2006 - 2021, Intel Corporation. All rights = reserved.
>=20 > ; SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > ; >=20 > ; Module Name: >=20 > @@ -34,12 +34,12 @@ ASM_PFX(InternalMemZeroMem): > and edx, 7 >=20 > shr rcx, 3 >=20 > jz @ZeroBytes >=20 > - DB 0xf, 0xef, 0xc0 ; pxor mm0, mm0 >=20 > + pxor mm0, mm0 >=20 > .0: >=20 > - DB 0xf, 0xe7, 7 ; movntq [rdi], mm0 >=20 > + movntq [rdi], mm0 >=20 > add rdi, 8 >=20 > loop .0 >=20 > - DB 0xf, 0xae, 0xf0 ; mfence >=20 > + mfence >=20 > @ZeroBytes: >=20 > xor eax, eax >=20 > mov ecx, edx >=20 > -- > 2.28.0.windows.1