From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.45]) by mx.groups.io with SMTP id smtpd.web10.19638.1602864593784276945 for ; Fri, 16 Oct 2020 09:09:53 -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=p1U9i4gT; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.94.45, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yp3lsWjjvm5SF/SHhYT6NoZjv6JT7xvR6YDjMTCUijZj/aDkF8mAv0yXh4MtE4ntkVKdMlpmkjgpru/KqmirMSQIPZvTepTgldWihlN+26tagMS1Hlyzgl7MpsjkotrVLYkCYkLhd73Mhi/l7PJeR/Rboh04n54m6/FhLrDua+vN8N+5cMPjLasb1Zx6uO0ymaWf7Zg2OpZTtseWn+F9/xS5FQh3Iv368OmN0Ymc0XmsorJxAlnsi0v/YT7Mom9oumOyj9BCquXPmXvI7A6tm1sXADyefYBXSMRZs3XrxuxkGURYgaqQu+Si5KjHRlcpfJzcJcAlPh6uLCk2lbNkHQ== 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=EFlm3bsDZqQ4unLOHMjuIO/ajyvreukvT43fuTzlmYc=; b=Q0lKIICYfzGiFKPsQmiOeYs1qFYiFkc3x5O2jLJfLnpP7SzQYHT9o+lxRXzAfW89VHjCmDdq2hvBKaqhILFnuWVuL6kY0dnACie4ph5Bzo8v5zyj5YUW9mIL1MOn/n/qwfxMALYyLl7il7wKNB019VeYpapbsbtvxKt63uOd/A/IijwS4UJFx6ibuLdVCcVYQw/TenImac/nh33fQuJ7tubDo9zb+WT7GBzGKF93Ys60Zj4EN81SwnjfwjxkYNNOJcgfG2Ok4JL5Q222+XiMt4DSsQKRWOBP4/hIDfr7DS24LV74yf0+7hnZiiM/13SEpnU2/+evboMdj4YZdF8mtA== 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=EFlm3bsDZqQ4unLOHMjuIO/ajyvreukvT43fuTzlmYc=; b=p1U9i4gT+RrXwPNM3ufo/3S2d5B3mu+Y+a/GtrjLZ6Jc0WiMiwhbu3th4vabpx0tpdYktC6bRgFeA9J5IctpKK+rpDF+WT2gN3jrAA1SbJSJR1/8VaTmCLDii8nub8RKYBXWXkSe2Zzl7vCPz8G4pjMUcEFcdgkGqNQF/0Q4q4M= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB4926.namprd12.prod.outlook.com (2603:10b6:5:1bb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Fri, 16 Oct 2020 16:09:52 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4d88:9239:2419:7348]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4d88:9239:2419:7348%2]) with mapi id 15.20.3455.030; Fri, 16 Oct 2020 16:09:52 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v2 03/11] OvmfPkg/VmgExitLib: Implement new VmgExitLib interfaces Date: Fri, 16 Oct 2020 11:09:09 -0500 Message-ID: <495003dd5667796b7e79ac30b8d72308e46bd91a.1602864557.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM3PR12CA0076.namprd12.prod.outlook.com (2603:10b6:0:57::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 tlendack-t1.amd.com (165.204.77.1) by DM3PR12CA0076.namprd12.prod.outlook.com (2603:10b6:0:57::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22 via Frontend Transport; Fri, 16 Oct 2020 16:09:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: db32df70-fc6c-43ad-8227-08d871edea19 X-MS-TrafficTypeDiagnostic: DM6PR12MB4926: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5Wl5IpsSeHYZXUE4pjBfCmhbl/H/P7kzo2soCrHrs+7xLuu5jPfVj+3nb8ktUTUZM+leUBzL7C/ihLAXMrE99nW9SIe9EOU/ndT5jLYu05L888OoExWpGM9s5dDP1hUL0ApkaqnM4TTvDuDCfxLPLQ2xsmiKs2KK9VP6oYVJXpk29t5hljDW4zffV1xnAsITHhLvKVxF6WQFgcQp6b4+noQpU9kHb973Cs8IFf10+i5ZZglO7aDhuB89yJyGFfaMVCk5/PORbTKhgaFNkxc3DWBYIrcx6cAjo/gFheJvPcgovLMyjrRJaXo0DSzeFYeziGPf0txETgOwC023p7F+pffYnpOhzCVMmgEcG9cYSvbJBhAtqQAFGPGv8sUsA2s3mi80dLpmttCJuizqc5m7kpolXLm4j7/1ctJtoYSgGS6C8VtKZUJiujgIDbhQB2cRv2Nw60djW3j5K4nCl0EB4A== 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;SFS:(4636009)(39860400002)(136003)(396003)(376002)(366004)(346002)(7696005)(52116002)(83380400001)(66556008)(66476007)(86362001)(66946007)(36756003)(4326008)(2906002)(316002)(6666004)(54906003)(6486002)(34490700002)(5660300002)(6916009)(26005)(956004)(2616005)(16526019)(478600001)(8936002)(966005)(8676002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zTejRGCaSRL7sjw75Wcy8nBW+n+esGnCJjiN4m5L+4IFqAdzOGsTD1TjBw0mcwrs0m1h6nKbe0p3zFgGHxGJ6RXjua/upSAS+k+Vcq2Z7vc5/lZ7faTIw93Pjplkkmv2pKn+ycaoFM+FT21Y8Szcrg5oVc2lYiBbUaZHOhc1aDjet7ZfLH23vultrkpigqgiR/elmZ3x7YX60mGf4KY5n0a+M9RfP28sPw0YIrrbo139RlRS2gdkQWX3+Z4MCN7hGBoclUo5CLrEzysc1u2udy0F92Ka7pMgWT/V3//rC6b5cErArN+VTAtND989TOC0UFD61+6PkzhmklhCtFllsx9JWXKsv5Xs83XAhcdth3IB1ALmuhPHF9JQkioC2CGIyJVC1oaYcj+vDY0oQ4zZfifaGmicGHJ04A4uQqxpMBGXTdoHpJCDe35qpCcBCMLEng1xYasPhN0w8KQ1FHpR+wuw/Tiz2voOorVNIxhOGjscbfHGLC8M8FySrVtyWsTf5dJP1oxk2/k55BkbCfv3Buzs8yt1cplYWP62Rot4rdPsU8c+rqUtqfqjuJfnM09QajGfQqmxWE2QQvRKzkdPmFOsmbxxhTv1n4kVIVK1pFMABzoJourlal8SMIQIi/vuW5Pf/0EV7VXFt8svTLudJA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: db32df70-fc6c-43ad-8227-08d871edea19 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 16:09:52.3862 (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: +Pbcz59JGS+SYajKORZVSl8ghmTnrxGr8BoOHWRa3M+/076xreI87noLBPq1XnSwMS59uKPEJGIsF0rNUtqpYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4926 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Tom Lendacky BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3008 The VmgExitLib library added two new interfaces, VmgSetOffsetValid() and VmgIsOffsetValid(), that must now be implemented in the OvmfPkg version of the library. Implement VmgSetOffsetValid() and VmgIsOffsetValid() and update existing code, that is directly accessing ValidBitmap, to use the new interfaces. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Tom Lendacky Cc: Brijesh Singh Signed-off-by: Tom Lendacky --- OvmfPkg/Library/VmgExitLib/VmgExitLib.c | 54 +++++++++ OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 118 +++++--------------- 2 files changed, 85 insertions(+), 87 deletions(-) diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c b/OvmfPkg/Library/VmgE= xitLib/VmgExitLib.c index 53040cc6f649..3072c2265df7 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c +++ b/OvmfPkg/Library/VmgExitLib/VmgExitLib.c @@ -157,3 +157,57 @@ VmgDone ( { } =20 +/** + Marks a field at the specified offset as valid in the GHCB. + + The ValidBitmap area represents the areas of the GHCB that have been mar= ked + valid. Set the bit in ValidBitmap for the input offset. + + @param[in, out] Ghcb Pointer to the Guest-Hypervisor Communication Bl= ock + @param[in] Offset Qword offset in the GHCB to mark valid + +**/ +VOID +EFIAPI +VmgSetOffsetValid ( + IN OUT GHCB *Ghcb, + IN GHCB_QWORD_OFFSET Offset + ) +{ + UINT32 OffsetIndex; + UINT32 OffsetBit; + + OffsetIndex =3D Offset / 8; + OffsetBit =3D Offset % 8; + + Ghcb->SaveArea.ValidBitmap[OffsetIndex] |=3D (1 << OffsetBit); +} + +/** + Checks if a specified offset is valid in the GHCB. + + The ValidBitmap area represents the areas of the GHCB that have been mar= ked + valid. Return whether the bit in the ValidBitmap is set for the input of= fset. + + @param[in] Ghcb A pointer to the GHCB + @param[in] Offset Qword offset in the GHCB to mark valid + + @retval TRUE Offset is marked vald in the GHCB + @retval FALSE Offset is not marked valid in the GHCB + +**/ +BOOLEAN +EFIAPI +VmgIsOffsetValid ( + IN GHCB *Ghcb, + IN GHCB_QWORD_OFFSET Offset + ) +{ + UINT32 OffsetIndex; + UINT32 OffsetBit; + + OffsetIndex =3D Offset / 8; + OffsetBit =3D Offset % 8; + + return ((Ghcb->SaveArea.ValidBitmap[OffsetIndex] & (1 << OffsetBit)) != =3D 0); +} diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c b/OvmfPkg/Librar= y/VmgExitLib/VmgExitVcHandler.c index c5484a3f478c..7d14341d592b 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c +++ b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c @@ -135,62 +135,6 @@ typedef struct { } SEV_ES_PER_CPU_DATA; =20 =20 -/** - Checks the GHCB to determine if the specified register has been marked v= alid. - - The ValidBitmap area represents the areas of the GHCB that have been mar= ked - valid. Return an indication of whether the area of the GHCB that holds t= he - specified register has been marked valid. - - @param[in] Ghcb Pointer to the Guest-Hypervisor Communication Block - @param[in] Reg Offset in the GHCB of the register to check - - @retval TRUE Register has been marked vald in the GHCB - @retval FALSE Register has not been marked valid in the GHCB - -**/ -STATIC -BOOLEAN -GhcbIsRegValid ( - IN GHCB *Ghcb, - IN GHCB_QWORD_OFFSET Reg - ) -{ - UINT32 RegIndex; - UINT32 RegBit; - - RegIndex =3D Reg / 8; - RegBit =3D Reg & 0x07; - - return ((Ghcb->SaveArea.ValidBitmap[RegIndex] & (1 << RegBit)) !=3D 0); -} - -/** - Marks a register as valid in the GHCB. - - The ValidBitmap area represents the areas of the GHCB that have been mar= ked - valid. Set the area of the GHCB that holds the specified register as val= id. - - @param[in, out] Ghcb Pointer to the Guest-Hypervisor Communication Bl= ock - @param[in] Reg Offset in the GHCB of the register to mark valid - -**/ -STATIC -VOID -GhcbSetRegValid ( - IN OUT GHCB *Ghcb, - IN GHCB_QWORD_OFFSET Reg - ) -{ - UINT32 RegIndex; - UINT32 RegBit; - - RegIndex =3D Reg / 8; - RegBit =3D Reg & 0x07; - - Ghcb->SaveArea.ValidBitmap[RegIndex] |=3D (1 << RegBit); -} - /** Return a pointer to the contents of the specified register. =20 @@ -891,9 +835,9 @@ MwaitExit ( DecodeModRm (Regs, InstructionData); =20 Ghcb->SaveArea.Rax =3D Regs->Rax; - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rcx =3D Regs->Rcx; - GhcbSetRegValid (Ghcb, GhcbRcx); + VmgSetOffsetValid (Ghcb, GhcbRcx); =20 return VmgExit (Ghcb, SVM_EXIT_MWAIT, 0, 0); } @@ -923,11 +867,11 @@ MonitorExit ( DecodeModRm (Regs, InstructionData); =20 Ghcb->SaveArea.Rax =3D Regs->Rax; // Identity mapped, so VA =3D PA - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rcx =3D Regs->Rcx; - GhcbSetRegValid (Ghcb, GhcbRcx); + VmgSetOffsetValid (Ghcb, GhcbRcx); Ghcb->SaveArea.Rdx =3D Regs->Rdx; - GhcbSetRegValid (Ghcb, GhcbRdx); + VmgSetOffsetValid (Ghcb, GhcbRdx); =20 return VmgExit (Ghcb, SVM_EXIT_MONITOR, 0, 0); } @@ -988,9 +932,9 @@ RdtscpExit ( return Status; } =20 - if (!GhcbIsRegValid (Ghcb, GhcbRax) || - !GhcbIsRegValid (Ghcb, GhcbRcx) || - !GhcbIsRegValid (Ghcb, GhcbRdx)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax) || + !VmgIsOffsetValid (Ghcb, GhcbRcx) || + !VmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } Regs->Rax =3D Ghcb->SaveArea.Rax; @@ -1027,16 +971,16 @@ VmmCallExit ( DecodeModRm (Regs, InstructionData); =20 Ghcb->SaveArea.Rax =3D Regs->Rax; - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Cpl =3D (UINT8) (Regs->Cs & 0x3); - GhcbSetRegValid (Ghcb, GhcbCpl); + VmgSetOffsetValid (Ghcb, GhcbCpl); =20 Status =3D VmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0); if (Status !=3D 0) { return Status; } =20 - if (!GhcbIsRegValid (Ghcb, GhcbRax)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } Regs->Rax =3D Ghcb->SaveArea.Rax; @@ -1074,15 +1018,15 @@ MsrExit ( case 0x30: // WRMSR ExitInfo1 =3D 1; Ghcb->SaveArea.Rax =3D Regs->Rax; - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rdx =3D Regs->Rdx; - GhcbSetRegValid (Ghcb, GhcbRdx); + VmgSetOffsetValid (Ghcb, GhcbRdx); // // fall through // case 0x32: // RDMSR Ghcb->SaveArea.Rcx =3D Regs->Rcx; - GhcbSetRegValid (Ghcb, GhcbRcx); + VmgSetOffsetValid (Ghcb, GhcbRcx); break; default: return UnsupportedExit (Ghcb, Regs, InstructionData); @@ -1094,8 +1038,8 @@ MsrExit ( } =20 if (ExitInfo1 =3D=3D 0) { - if (!GhcbIsRegValid (Ghcb, GhcbRax) || - !GhcbIsRegValid (Ghcb, GhcbRdx)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax) || + !VmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } Regs->Rax =3D Ghcb->SaveArea.Rax; @@ -1311,7 +1255,7 @@ IoioExit ( } else { CopyMem (&Ghcb->SaveArea.Rax, &Regs->Rax, IOIO_DATA_BYTES (ExitInfo1= )); } - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); =20 Status =3D VmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, 0); if (Status !=3D 0) { @@ -1319,7 +1263,7 @@ IoioExit ( } =20 if ((ExitInfo1 & IOIO_TYPE_IN) !=3D 0) { - if (!GhcbIsRegValid (Ghcb, GhcbRax)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } CopyMem (&Regs->Rax, &Ghcb->SaveArea.Rax, IOIO_DATA_BYTES (ExitInfo1= )); @@ -1379,15 +1323,15 @@ CpuidExit ( UINT64 Status; =20 Ghcb->SaveArea.Rax =3D Regs->Rax; - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rcx =3D Regs->Rcx; - GhcbSetRegValid (Ghcb, GhcbRcx); + VmgSetOffsetValid (Ghcb, GhcbRcx); if (Regs->Rax =3D=3D CPUID_EXTENDED_STATE) { IA32_CR4 Cr4; =20 Cr4.UintN =3D AsmReadCr4 (); Ghcb->SaveArea.XCr0 =3D (Cr4.Bits.OSXSAVE =3D=3D 1) ? AsmXGetBv (0) : = 1; - GhcbSetRegValid (Ghcb, GhcbXCr0); + VmgSetOffsetValid (Ghcb, GhcbXCr0); } =20 Status =3D VmgExit (Ghcb, SVM_EXIT_CPUID, 0, 0); @@ -1395,10 +1339,10 @@ CpuidExit ( return Status; } =20 - if (!GhcbIsRegValid (Ghcb, GhcbRax) || - !GhcbIsRegValid (Ghcb, GhcbRbx) || - !GhcbIsRegValid (Ghcb, GhcbRcx) || - !GhcbIsRegValid (Ghcb, GhcbRdx)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax) || + !VmgIsOffsetValid (Ghcb, GhcbRbx) || + !VmgIsOffsetValid (Ghcb, GhcbRcx) || + !VmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } Regs->Rax =3D Ghcb->SaveArea.Rax; @@ -1434,15 +1378,15 @@ RdpmcExit ( UINT64 Status; =20 Ghcb->SaveArea.Rcx =3D Regs->Rcx; - GhcbSetRegValid (Ghcb, GhcbRcx); + VmgSetOffsetValid (Ghcb, GhcbRcx); =20 Status =3D VmgExit (Ghcb, SVM_EXIT_RDPMC, 0, 0); if (Status !=3D 0) { return Status; } =20 - if (!GhcbIsRegValid (Ghcb, GhcbRax) || - !GhcbIsRegValid (Ghcb, GhcbRdx)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax) || + !VmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } Regs->Rax =3D Ghcb->SaveArea.Rax; @@ -1480,8 +1424,8 @@ RdtscExit ( return Status; } =20 - if (!GhcbIsRegValid (Ghcb, GhcbRax) || - !GhcbIsRegValid (Ghcb, GhcbRdx)) { + if (!VmgIsOffsetValid (Ghcb, GhcbRax) || + !VmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } Regs->Rax =3D Ghcb->SaveArea.Rax; @@ -1531,7 +1475,7 @@ Dr7WriteExit ( // Using a value of 0 for ExitInfo1 means RAX holds the value // Ghcb->SaveArea.Rax =3D *Register; - GhcbSetRegValid (Ghcb, GhcbRax); + VmgSetOffsetValid (Ghcb, GhcbRax); =20 Status =3D VmgExit (Ghcb, SVM_EXIT_DR7_WRITE, 0, 0); if (Status !=3D 0) { --=20 2.28.0