lkml.org 
[lkml]   [2021]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl
Date
[AMD Public Use]


-----Original Message-----
From: Sean Christopherson <seanjc@google.com>
Sent: Thursday, February 18, 2021 10:39 AM
To: Kalra, Ashish <Ashish.Kalra@amd.com>
Cc: pbonzini@redhat.com; tglx@linutronix.de; mingo@redhat.com; hpa@zytor.com; rkrcmar@redhat.com; joro@8bytes.org; bp@suse.de; Lendacky, Thomas <Thomas.Lendacky@amd.com>; x86@kernel.org; kvm@vger.kernel.org; linux-kernel@vger.kernel.org; srutherford@google.com; venu.busireddy@oracle.com; Singh, Brijesh <brijesh.singh@amd.com>
Subject: Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl

On Thu, Feb 18, 2021, Kalra, Ashish wrote:
> From: Sean Christopherson <seanjc@google.com>
>
> On Wed, Feb 17, 2021, Kalra, Ashish wrote:
> >> From: Sean Christopherson <seanjc@google.com> On Thu, Feb 04, 2021,
> >> Ashish Kalra wrote:
> >> > From: Brijesh Singh <brijesh.singh@amd.com>
> >> >
> >> > The ioctl is used to retrieve a guest's shared pages list.
> >>
> >> >What's the performance hit to boot time if KVM_HC_PAGE_ENC_STATUS
> >> >is passed through to userspace? That way, userspace could manage
> >> >the set of pages >in whatever data structure they want, and these get/set ioctls go away.
> >>
> >> What is the advantage of passing KVM_HC_PAGE_ENC_STATUS through to
> >> user-space ?
> >>
> >> As such it is just a simple interface to get the shared page list
> >> via the get/set ioctl's. simply an array is passed to these ioctl
> >> to get/set the shared pages list.
>>
>> > It eliminates any probability of the kernel choosing the wrong data
>> > structure, and it's two fewer ioctls to maintain and test.
>>
>> The set shared pages list ioctl cannot be avoided as it needs to be
>> issued to setup the shared pages list on the migrated VM, it cannot be
>> achieved by passing KVM_HC_PAGE_ENC_STATUS through to user-space.

>Why's that? AIUI, KVM doesn't do anything with the list other than pass it back to userspace. Assuming that's the case, userspace can just hold onto the list >for the next migration.

KVM does use it as part of the SEV DBG_DECTYPT API, within sev_dbg_decrypt() to check if the guest page(s) are encrypted or not,
and accordingly use it to decide whether to decrypt the guest page(s) and return that back to user-space or just return it as it is.

Thanks,
Ashish

\
 
 \ /
  Last update: 2021-02-18 19:56    [W:0.150 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site