From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (NAM04-BN3-obe.outbound.protection.outlook.com [40.107.68.82]) by mx.groups.io with SMTP id smtpd.web10.400.1595529334837155572 for ; Thu, 23 Jul 2020 11:35:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=DTaIsszV; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.68.82, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f9GfUIsk4yvwPyKzhGXCzmosR4KBAZvPwedZ4CCg8UznYUGaPcZSbDFpQb5xj+SIHJk6vHrLufqTIevE+qhYuEFQED83E4Riws7IS8qvNTSOMHpIA+ZtZz6btTzENGSb5qdVbp1XdM3+OEpKWZHB3vVQphoQ/88od/8/7DtCRmpVI29oxm2LgXj/EVP6bg4w3Kd4BbfB7DxT+rtoebxgvRTYJXoXvTgYtIRuRiGj5k3GGR9A2qCLk8hNCq5Y+hueIsNi69NfoxfW3UlfuhndMJjShI62KdL0ooScWWc45Q5heFLHoh8FiEDKHh6JVGlHoMHS4lVnxZF2+v+PHIBQFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ma77Fjg3u/V6rqcfgu4XijdWOphBiX/XrfsJW8AvayU=; b=LWRHOjtQRH3BhHGfolQHFxILVe8AdEYyd8lH9I/zcGLewUXujcz5B2Fe1xsVCHZfgsVpb+Hoyr4MB0L27Aaf3Kt4/o6yqyOCXvMKUz2BH/Df0IAFyOlhjFnMHU9VY1agkwxMvbbtd0jWJfsly1wlqxm/B7A2DJRNfPwh2to/2yy6/Rc6OD/dGxDrp44YTjkgMHCwrYXCGu6DDdWE1kobTtpjbgQFrauKZmmus7fLhau8lPK4vSPyJRqQAb0eDswCLOZiqpgSGrK8TqrVwOLzG3EHXkp4YCqwGUqjJZa4xkbaKRgPB+/Ga3EH/0wJ6VnJ7w+s0Dlez7eUwqjmft1GUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ma77Fjg3u/V6rqcfgu4XijdWOphBiX/XrfsJW8AvayU=; b=DTaIsszVTG13OWswrLfnLHVoraZNE3RJCMGVpsgoK4R/50ewaG3N4RY4XjnTfoCqdtbhEU7iIvSWsCkLSsxU2LsLpM6/EJStnDO2vtEQy/Ny1HNrP1lnUf33zkaGRsRaaklUHciSPzldhtnVKGkQIDiayTanNCUKnvpWyMkCe8M= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM5PR12MB1867.namprd12.prod.outlook.com (2603:10b6:3:10d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Thu, 23 Jul 2020 18:35:32 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::25ec:e6ba:197c:4eb0]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::25ec:e6ba:197c:4eb0%8]) with mapi id 15.20.3216.021; Thu, 23 Jul 2020 18:35:32 +0000 Subject: Re: [edk2-devel] [PATCH v11 06/46] MdePkg/BaseLib: Add support for the XGETBV instruction To: "Gao, Liming" , Laszlo Ersek , "Liu, Zhiguang" , "devel@edk2.groups.io" CC: Brijesh Singh , Ard Biesheuvel , "Dong, Eric" , "Justen, Jordan L" , "Kinney, Michael D" , "Ni, Ray" References: <0d091f43ae96ca4617f6a95a018bfaed6280eec2.1595366363.git.thomas.lendacky@amd.com> <59baa2d3-69e0-2f98-27b8-92010f393109@redhat.com> From: "Lendacky, Thomas" Message-ID: <4158635d-da76-ca5c-614c-d3cdbc71587a@amd.com> Date: Thu, 23 Jul 2020 13:35:30 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: X-ClientProxiedBy: SN4PR0801CA0010.namprd08.prod.outlook.com (2603:10b6:803:29::20) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from office-linux.texastahm.com (67.79.209.213) by SN4PR0801CA0010.namprd08.prod.outlook.com (2603:10b6:803:29::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.22 via Frontend Transport; Thu, 23 Jul 2020 18:35:31 +0000 X-Originating-IP: [67.79.209.213] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: da5f8c79-9df2-4706-9bf5-08d82f372e8c X-MS-TrafficTypeDiagnostic: DM5PR12MB1867: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zGCeexB0IciLWGnguS5d4ShnMVwfqHSY5kkQD1zL5hEiXiLjO0rOfQZ5QMeIiPPl+7aUHfpJeFfdhiwH6vrI7Iaa6vbZ1RbMEIz6Tf8E/b0idIXxrq61Ke12WJPLKYuF4sBcOJ+IQQ/1FQ+/ebbe0fF9OOWQSOpu7fc7py8yG8o36OdqTjNpGAH39rPGpy34X3dl/+0fNeIcQbsTKRetTm3m30uSCE8fir3vn6x6618ZojXpWsjVnaaSLL9A3AQ6tcDV7INztZgVHNun6fNrjh4UKa7zY7+4d/pE0eZrJ9zD7ooKyjtdlmHJEh8TpeIwfyZJOzjn/Q71xqQdLG+DMgiO3PYjbTxive/7RQfgcAHQm38FXqGwNQgng/XNVcHsw/uZG7oCYk/6pXKv3PcqU8ijkG/oda+JCEmnM9I3C5TV6vfpmpA89qEwIxpT3X25ZoQKLUC9x5kMSlvUMmrDbw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(396003)(376002)(346002)(366004)(136003)(5660300002)(2616005)(956004)(86362001)(4326008)(31696002)(30864003)(316002)(2906002)(8676002)(8936002)(16526019)(186003)(31686004)(110136005)(6512007)(19627235002)(26005)(6506007)(54906003)(53546011)(45080400002)(478600001)(83380400001)(36756003)(52116002)(66556008)(66476007)(66946007)(966005)(6486002)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TYcsUxyzJ+V5gLFs8fGWikuFZhjbIsY58XyZp+UPJmC5A+jjg/Sv04H00Ia3EE0fj4x/DyS5OoTc5xCVM8ILnEtL9nwYx0rJU8l3ftnJE0ISgPG8DMNtlPo05X7zPyYU2IAXDALFM8FL23+18P+9C5Fe1keFgjRKP9f5y2IoJAD89fy3h8ZQ47EKHEfKNCjs6e4KQaOz7VUwU5kg/JlZgV+i7AYwQfQJrwImzpLtKwMn5RgDn/e3RIAfMzYNVIe7R3p20rJL5l4zN1PcPiv/lOBX/uUKvHDvYEK9Bt57qU+lLy6EVkHhfq+vJy9oXt/6we54XdCQ9NGTMpI/iotDvzOebJNFc2166/esEPUrF86zrRf/6IgHz36D0C8AezNtyPO6L6w/a+dNaTVdGyadiu5GYDviiP7oe5Wlu5Bt/wFfglOjxYDmqBt1WrSG1jHKi6IeXPLx6cBz+yNlOmtJMCGyVzO/3X39jsqq6kN+SiM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: da5f8c79-9df2-4706-9bf5-08d82f372e8c X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2020 18:35:32.6227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T9cQ0XBcidC0BGX8Gdi5/t/mdI6yZCfZqP/N12JEOt43so4ZQGHyotoaRHyT/KOTjgzIJUzPyyhYkp+ilEysSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1867 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/23/20 9:59 AM, Gao, Liming wrote: > Tom: >=20 >> -----Original Message----- >> From: Tom Lendacky >> Sent: Thursday, July 23, 2020 10:19 PM >> To: Gao, Liming ; Laszlo Ersek ; Liu, Zhiguang ; >> devel@edk2.groups.io >> Cc: Brijesh Singh ; Ard Biesheuvel ; Dong, Eric ; Justen, >> Jordan L ; Kinney, Michael D ; Ni, Ray >> Subject: Re: [edk2-devel] [PATCH v11 06/46] MdePkg/BaseLib: Add support= for the XGETBV instruction >> >> On 7/22/20 8:16 PM, Gao, Liming wrote: >>> Laszlo: >>> >>> -----Original Message----- >>> From: Laszlo Ersek >>> Sent: 2020=E5=B9=B47=E6=9C=8823=E6=97=A5 4:28 >>> To: Liu, Zhiguang ; devel@edk2.groups.io; thom= as.lendacky@amd.com >>> Cc: Brijesh Singh ; Ard Biesheuvel ; Dong, Eric ; Justen, >> Jordan L ; Gao, Liming ; Kinney, Michael D ; Ni, Ray >> >>> Subject: Re: [edk2-devel] [PATCH v11 06/46] MdePkg/BaseLib: Add suppor= t for the XGETBV instruction >>> >>> On 07/22/20 02:55, Liu, Zhiguang wrote: >>>> Hi Tom, >>>> Nasm is a cross-OS assembly code and can be used in Linux. >>>> So I think we don't need implement the same function in GccInline.c, = we can just use the nasm file in Linux. >>> >>> I could agree, but this would create an inconsistency with the existen= t functions (where both gcc inline assembly and NASM exists). >>> [Liming] Yes. This is clean up task to make the existing ones be consi= stent. The new one X86 assembly function (IA32 and X64) >> should follow nasm style. >> >> I was following what I thought was convention. If you'd like, I can rem= ove >> the "| MSFT" from the .nasm entries in the .inf file and delete (not ad= d) >> the functions in the GccInline.c file. >> >> Let me know what you would like done. >=20 > Yes. This is my suggestion. Only add nasm style, don't touch GccInline.c= file. Ok, I'll update the patches and send out a new version soon. I'll wait a= =20 day or two to see if there is any further feedback before sending. Thanks, Tom >=20 > Thanks > Liming >> >> Thanks, >> Tom >> >>> >>> For example, consider AsmReadEflags(): >>> - inline assembly for MSFT IA32 ("Ia32/ReadEflags.c") >>> - NASM for MSFT X64 ("X64/ReadEflags.nasm") >>> - inline assembly for GCC IA32 ("Ia32/GccInline.c") >>> - inline assembly for GCC X64 ("X64/GccInline.c") >>> >>> The source file "X64/ReadEflags.nasm" could be used with GCC X64 too, = not just with MSFT X64. >>> >>> So why do we have the gcc inline implementation for AsmReadEflags() in= "X64/GccInline.c", in the first place? >>> [Liming] This is the history. Nasm migration replaces .S and .asm. But= , the remaining one in C source is not replaced. >>> >>> Thanks >>> Liming >>> The pattern that a contributor is supposed to follow is not clear to m= e. >>> >>> Thanks, >>> Laszlo >>> >>>>> -----Original Message----- >>>>> From: devel@edk2.groups.io On Behalf Of >>>>> Lendacky, Thomas >>>>> Sent: Wednesday, July 22, 2020 5:19 AM >>>>> To: devel@edk2.groups.io >>>>> Cc: Brijesh Singh ; Ard Biesheuvel >>>>> ; Dong, Eric ; Justen, >>>>> Jordan L ; Laszlo Ersek >>>>> ; Gao, Liming ; Kinney, >>>>> Michael D ; Ni, Ray >>>>> Subject: [edk2-devel] [PATCH v11 06/46] MdePkg/BaseLib: Add support >>>>> for the XGETBV instruction >>>>> >>>>> From: Tom Lendacky >>>>> >>>>> BZ: >> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbug= zilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2198&d >> ata=3D02%7C01%7Cthomas.lendacky%40amd.com%7C7cbbd5ae7ded4963ad1e08d82ea= 5ff27%7C3dd8961fe4884e608e11a82d994e183d% >> 7C0%7C0%7C637310637778599307&sdata=3DGPutAlSGucRGFnjU4rxWXfeiy4fJhZ= HHZe5YJ8hhPSQ%3D&reserved=3D0 >>>>> >>>>> Under SEV-ES, a CPUID instruction requires the current value of the >>>>> XCR0 register. In order to retrieve that value, the XGETBV >>>>> instruction needs to be executed. >>>>> >>>>> Provide the necessary support to execute the XGETBV instruction. >>>>> >>>>> Cc: Michael D Kinney >>>>> Cc: Liming Gao >>>>> Signed-off-by: Tom Lendacky >>>>> --- >>>>> MdePkg/Library/BaseLib/BaseLib.inf | 2 ++ >>>>> MdePkg/Include/Library/BaseLib.h | 17 +++++++++++++ >>>>> MdePkg/Library/BaseLib/Ia32/GccInline.c | 28 ++++++++++++++++++++ >>>>> MdePkg/Library/BaseLib/X64/GccInline.c | 30 ++++++++++++++++++++++ >>>>> MdePkg/Library/BaseLib/Ia32/XGetBv.nasm | 31 >>>>> ++++++++++++++++++++++ >>>>> MdePkg/Library/BaseLib/X64/XGetBv.nasm | 34 >>>>> +++++++++++++++++++++++++ >>>>> 6 files changed, 142 insertions(+) >>>>> create mode 100644 MdePkg/Library/BaseLib/Ia32/XGetBv.nasm >>>>> create mode 100644 MdePkg/Library/BaseLib/X64/XGetBv.nasm >>>>> >>>>> diff --git a/MdePkg/Library/BaseLib/BaseLib.inf >>>>> b/MdePkg/Library/BaseLib/BaseLib.inf >>>>> index c740a819cacf..e26c0d8cb0ac 100644 >>>>> --- a/MdePkg/Library/BaseLib/BaseLib.inf >>>>> +++ b/MdePkg/Library/BaseLib/BaseLib.inf >>>>> @@ -153,6 +153,7 @@ [Sources.Ia32] >>>>> Ia32/ARShiftU64.c | MSFT >>>>> Ia32/EnableCache.c | MSFT >>>>> Ia32/DisableCache.c | MSFT >>>>> + Ia32/XGetBv.nasm | MSFT >>>>> >>>>> >>>>> Ia32/GccInline.c | GCC >>>>> @@ -288,6 +289,7 @@ [Sources.X64] >>>>> X64/ReadCr2.nasm| MSFT >>>>> X64/ReadCr0.nasm| MSFT >>>>> X64/ReadEflags.nasm| MSFT >>>>> + X64/XGetBv.nasm | MSFT >>>>> >>>>> >>>>> X64/Non-existing.c >>>>> diff --git a/MdePkg/Include/Library/BaseLib.h >>>>> b/MdePkg/Include/Library/BaseLib.h >>>>> index 8e7b87cbda4e..7edf0051a0a0 100644 >>>>> --- a/MdePkg/Include/Library/BaseLib.h >>>>> +++ b/MdePkg/Include/Library/BaseLib.h >>>>> @@ -7831,6 +7831,23 @@ AsmLfence ( >>>>> VOID >>>>> ); >>>>> >>>>> +/** >>>>> + Executes a XGETBV instruction >>>>> + >>>>> + Executes a XGETBV instruction. This function is only available on >>>>> + IA-32 and x64. >>>>> + >>>>> + @param[in] Index Extended control register index >>>>> + >>>>> + @return The current value of the extended control= register >>>>> +**/ >>>>> +UINT64 >>>>> +EFIAPI >>>>> +AsmXGetBv ( >>>>> + IN UINT32 Index >>>>> + ); >>>>> + >>>>> + >>>>> /** >>>>> Patch the immediate operand of an IA32 or X64 instruction such >>>>> that the byte, >>>>> word, dword or qword operand is encoded at the end of the >>>>> instruction's diff --git a/MdePkg/Library/BaseLib/Ia32/GccInline.c >>>>> b/MdePkg/Library/BaseLib/Ia32/GccInline.c >>>>> index 6ed938187a08..c2565ab9a183 100644 >>>>> --- a/MdePkg/Library/BaseLib/Ia32/GccInline.c >>>>> +++ b/MdePkg/Library/BaseLib/Ia32/GccInline.c >>>>> @@ -584,3 +584,31 @@ AsmReadTsc ( >>>>> >>>>> return Data; >>>>> } >>>>> + >>>>> + >>>>> +/** >>>>> + Executes a XGETBV instruction >>>>> + >>>>> + Executes a XGETBV instruction. This function is only available on >>>>> + IA-32 and x64. >>>>> + >>>>> + @param[in] Index Extended control register index >>>>> + >>>>> + @return The current value of the extended control= register >>>>> +**/ >>>>> +UINT64 >>>>> +EFIAPI >>>>> +AsmXGetBv ( >>>>> + IN UINT32 Index >>>>> + ) >>>>> +{ >>>>> + UINT64 Data; >>>>> + >>>>> + __asm__ __volatile__ ( >>>>> + "xgetbv" >>>>> + : "=3DA" (Data) >>>>> + : "c" (Index) >>>>> + ); >>>>> + >>>>> + return Data; >>>>> +} >>>>> diff --git a/MdePkg/Library/BaseLib/X64/GccInline.c >>>>> b/MdePkg/Library/BaseLib/X64/GccInline.c >>>>> index 40a208f1985f..65f864e35922 100644 >>>>> --- a/MdePkg/Library/BaseLib/X64/GccInline.c >>>>> +++ b/MdePkg/Library/BaseLib/X64/GccInline.c >>>>> @@ -560,3 +560,33 @@ AsmReadTsc ( >>>>> >>>>> return (((UINT64)HiData) << 32) | LowData; } >>>>> + >>>>> + >>>>> +/** >>>>> + Executes a XGETBV instruction >>>>> + >>>>> + Executes a XGETBV instruction. This function is only available on >>>>> + IA-32 and x64. >>>>> + >>>>> + @param[in] Index Extended control register index >>>>> + >>>>> + @return The current value of the extended control= register >>>>> +**/ >>>>> +UINT64 >>>>> +EFIAPI >>>>> +AsmXGetBv ( >>>>> + IN UINT32 Index >>>>> + ) >>>>> +{ >>>>> + UINT32 LowData; >>>>> + UINT32 HighData; >>>>> + >>>>> + __asm__ __volatile__ ( >>>>> + "xgetbv" >>>>> + : "=3Da" (LowData), >>>>> + "=3Dd" (HighData) >>>>> + : "c" (Index) >>>>> + ); >>>>> + >>>>> + return (((UINT64)HighData) << 32) | LowData; } >>>>> diff --git a/MdePkg/Library/BaseLib/Ia32/XGetBv.nasm >>>>> b/MdePkg/Library/BaseLib/Ia32/XGetBv.nasm >>>>> new file mode 100644 >>>>> index 000000000000..9f7b03bbff35 >>>>> --- /dev/null >>>>> +++ b/MdePkg/Library/BaseLib/Ia32/XGetBv.nasm >>>>> @@ -0,0 +1,31 @@ >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> +; >>>>> +; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights >>>>> +reserved.
; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; >>>>> +Module Name: >>>>> +; >>>>> +; XGetBv.Asm >>>>> +; >>>>> +; Abstract: >>>>> +; >>>>> +; AsmXgetBv function >>>>> +; >>>>> +; Notes: >>>>> +; >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> + >>>>> + SECTION .text >>>>> + >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> +; UINT64 >>>>> +; EFIAPI >>>>> +; AsmXGetBv ( >>>>> +; IN UINT32 Index >>>>> +; ); >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> +global ASM_PFX(AsmXGetBv) >>>>> +ASM_PFX(AsmXGetBv): >>>>> + mov ecx, [esp + 4] >>>>> + xgetbv >>>>> + ret >>>>> diff --git a/MdePkg/Library/BaseLib/X64/XGetBv.nasm >>>>> b/MdePkg/Library/BaseLib/X64/XGetBv.nasm >>>>> new file mode 100644 >>>>> index 000000000000..09f3be8ae0a8 >>>>> --- /dev/null >>>>> +++ b/MdePkg/Library/BaseLib/X64/XGetBv.nasm >>>>> @@ -0,0 +1,34 @@ >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> +; >>>>> +; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights >>>>> +reserved.
; SPDX-License-Identifier: BSD-2-Clause-Patent ; ; >>>>> +Module Name: >>>>> +; >>>>> +; XGetBv.Asm >>>>> +; >>>>> +; Abstract: >>>>> +; >>>>> +; AsmXgetBv function >>>>> +; >>>>> +; Notes: >>>>> +; >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> + >>>>> + DEFAULT REL >>>>> + SECTION .text >>>>> + >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> +; UINT64 >>>>> +; EFIAPI >>>>> +; AsmXGetBv ( >>>>> +; IN UINT32 Index >>>>> +; ); >>>>> +;------------------------------------------------------------------= - >>>>> +----------- >>>>> +global ASM_PFX(AsmXGetBv) >>>>> +ASM_PFX(AsmXGetBv): >>>>> + xgetbv >>>>> + shl rdx, 32 >>>>> + or rax, rdx >>>>> + ret >>>>> + >>>>> -- >>>>> 2.27.0 >>>>> >>>>> >>>>>=20 >>>> >>>