[edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

Ni, Ray ray.ni at intel.com
Wed Mar 16 01:26:37 UTC 2022


Thanks.
I am ok with DB instructions for tdcall.

-----Original Message-----
From: Xu, Min M <min.m.xu at intel.com> 
Sent: Wednesday, March 16, 2022 9:19 AM
To: Ni, Ray <ray.ni at intel.com>; devel at edk2.groups.io
Cc: Kinney, Michael D <michael.d.kinney at intel.com>; Gao, Liming <gaoliming at byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu at intel.com>; Brijesh Singh <brijesh.singh at amd.com>; Aktas, Erdem <erdemaktas at google.com>; James Bottomley <jejb at linux.ibm.com>; Yao, Jiewen <jiewen.yao at intel.com>; Tom Lendacky <thomas.lendacky at amd.com>; Gerd Hoffmann <kraxel at redhat.com>
Subject: RE: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

On March 15, 2022 3:42 PM, Ni Ray wrote:
> +
> +%macro tdcall 0
> +    db 0x66,0x0f,0x01,0xcc
> +%endmacro
> 
> 1. can you please check whether the tdcall instruction is supported by 
> latest NASM compiler?
I checked the NASM (2.15.05) doc https://www.nasm.us/xdoc/2.15.05/html/nasmdocb.html#section-B.1 but not find the tdcall instruction.
> 
> 
> +    AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, &Ecx, NULL);
> +    if ((Ecx & BIT31) == 0) {
> 
> 2. Can you please update CPUID_VERSION_INFO_ECX in 
> MdePkg/Include/Regiter/Intel/Cpuid.h for the BIT31?
Sure. It will be updated in the next version.
> 
> +      break;
> +    }
> +
> +    if (LargestEax < 0x21) {
> +      break;
> +    }
> +
> +    AsmCpuidEx (0x21, 0, &Eax, &Ebx, &Ecx, &Edx);
> +    if (  (Ebx != SIGNATURE_32 ('I', 'n', 't', 'e'))
> +       || (Edx != SIGNATURE_32 ('l', 'T', 'D', 'X'))
> +       || (Ecx != SIGNATURE_32 (' ', ' ', ' ', ' ')))
> +    {
> +      break;
> +    }
> +
> 
> 3. Similar comment as #2.
Sure. It will be updated in the next version.
> 
> 
> +%macro tdcall 0
> +    db 0x66,0x0f,0x01,0xcc
> +%endmacro
> 
> 4. similar comment as #1.
See my answer to comment #1.

Thanks
Min



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87611): https://edk2.groups.io/g/devel/message/87611
Mute This Topic: https://groups.io/mt/89725391/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list