On 7/8/21 9:08 AM, Ashish Kalra wrote: > From: Ashish Kalra <ashish.ka...@amd.com> >
The subject isn't correct since the #VC handler already supports hypercalls. It should say something like "Make the #VC handler aware of the encryption state change hypercall" or "Update the #VC handler to support the encryption state change hypercall" or something like that. > Make the VC handler hypercall aware by adding support > to compare the hypercall number and add the additional > register values used by hypercall in the GHCB. > > Also mark the SEC GHCB page (that is mapped as > unencrypted in ResetVector code) in the hypervisor > guest page status tracking. This part of the commit message shoudn't be here any more. > > Cc: Jordan Justen <jordan.l.jus...@intel.com> > Cc: Laszlo Ersek <ler...@redhat.com> > Cc: Ard Biesheuvel <ard.biesheu...@arm.com> > Signed-off-by: Ashish Kalra <ashish.ka...@amd.com> > --- > OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c > b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c > index 41b0c8cc53..7f69bfab5f 100644 > --- a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c > +++ b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c > @@ -1171,6 +1171,15 @@ VmmCallExit ( > Ghcb->SaveArea.Cpl = (UINT8) (Regs->Cs & 0x3); > VmgSetOffsetValid (Ghcb, GhcbCpl); > Add a comment that this hypercall requires these extra registers so you are explicitly adding them. Thanks, Tom > + if (Regs->Rax == KVM_HC_MAP_GPA_RANGE) { > + Ghcb->SaveArea.Rbx = Regs->Rbx; > + VmgSetOffsetValid (Ghcb, GhcbRbx); > + Ghcb->SaveArea.Rcx = Regs->Rcx; > + VmgSetOffsetValid (Ghcb, GhcbRcx); > + Ghcb->SaveArea.Rdx = Regs->Rdx; > + VmgSetOffsetValid (Ghcb, GhcbRdx); > + } > + > Status = VmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0); > if (Status != 0) { > return Status; > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77829): https://edk2.groups.io/g/devel/message/77829 Mute This Topic: https://groups.io/mt/84068349/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-