[AMD Official Use Only - General]

Hello Nikunj,

Yes we can move MemEncryptSevLiveMigrationIsEnabled() check here before calling 
SetMemoryEncDecHypercall3()
but then we also need to remove the same check from inside 
SetMemoryEncDecHypercall3() function.

Thanks,
Ashish

From: nikunj via groups.io <nikunj=amd....@groups.io>
Sent: Tuesday, June 7, 2022 3:39 AM
To: Kalra, Ashish <ashish.ka...@amd.com>; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v8 3/6] OvmfPkg/BaseMemEncryptLib: Invoke page 
encryption state change hypercall

Hi Ashish,

For case with latest OVMF and older qemu that does not enable live migrations,
SetMemoryEncDecHypercall3() returns RETURN_UNSUPPORTED, which is correct.
But then its actually treated as an error and OVMF sees an assert. This is a 
valid usecase
and OVMF should move ahead without live migration and HC_MAP_GPA_RANGE.
....

> + //
> + // Notify Hypervisor on C-bit status
> + //
> + if (CBitChanged) {

Should we call the SetMemoryEncDecHypercall() only if migration is enabled like 
below?

if (CBitChanged && MemEncryptSevLiveMigrationIsEnabled () {

> + Status = SetMemoryEncDecHypercall3 (
> + OrigPhysicalAddress,
> + EFI_SIZE_TO_PAGES (OrigLength),
> + (Mode == SetCBit) ? TRUE : FALSE
> + );
> + }
> +
> ...
>
> return Status;

Regards
Nikunj


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90299): https://edk2.groups.io/g/devel/message/90299
Mute This Topic: https://groups.io/mt/90271222/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to