public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: nikunj@amd.com
To: "Kalra, Ashish" <Ashish.Kalra@amd.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: nikunj@amd.com
Subject: Re: [edk2-devel] [PATCH v8 3/6] OvmfPkg/BaseMemEncryptLib: Invoke page encryption state change hypercall
Date: Wed, 8 Jun 2022 18:52:37 +0530	[thread overview]
Message-ID: <b91b85c0-be8a-0ea5-5943-9c26f5a29820@amd.com> (raw)
In-Reply-To: <SN6PR12MB27677B2A778476E5075C40768EA59@SN6PR12MB2767.namprd12.prod.outlook.com>

Hi Ashish,

On 6/7/2022 10:58 PM, Kalra, Ashish wrote:
> 
> 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.

Sure, and we will have to check this at all places that are calling SetMemoryEncDecHypercall3()

Regards
Nikunj

>  
> 
> Thanks,
> 
> Ashish
> 
>  
> 
> *From:* nikunj via groups.io <nikunj=amd.com@groups.io>
> *Sent:* Tuesday, June 7, 2022 3:39 AM
> *To:* Kalra, Ashish <Ashish.Kalra@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
> 

  reply	other threads:[~2022-06-08 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 17:28 [PATCH v8 0/6] SEV Live Migration support for OVMF Ashish Kalra
2022-04-05 17:30 ` [PATCH v8 1/6] OvmfPkg/BaseMemEncryptLib: Detect SEV live migration feature Ashish Kalra
2022-04-05 17:31 ` [PATCH v8 2/6] OvmfPkg/BaseMemEncryptLib: Hypercall API for page encryption state change Ashish Kalra
2022-04-05 17:32 ` [PATCH v8 3/6] OvmfPkg/BaseMemEncryptLib: Invoke page encryption state change hypercall Ashish Kalra
2022-06-07  8:38   ` [edk2-devel] " nikunj
2022-06-07 17:28     ` Ashish Kalra
2022-06-08 13:22       ` nikunj [this message]
2022-04-05 17:32 ` [PATCH v8 4/6] OvmfPkg/VmgExitLib: Encryption state change hypercall support in VC handler Ashish Kalra
2022-04-05 17:32 ` [PATCH v8 5/6] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall Ashish Kalra
2022-05-31 15:42   ` [edk2-devel] " Nikunj A. Dadhania
2022-04-05 17:33 ` [PATCH v8 6/6] OvmfPkg/AmdSevDxe: Add support for SEV live migration Ashish Kalra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b91b85c0-be8a-0ea5-5943-9c26f5a29820@amd.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox