Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-12 Thread Jarkko Sakkinen
On Mon, Oct 10, 2022 at 04:25:07PM +0800, Chao Peng wrote: > On Sat, Oct 08, 2022 at 08:35:47PM +0300, Jarkko Sakkinen wrote: > > On Sat, Oct 08, 2022 at 07:15:17PM +0300, Jarkko Sakkinen wrote: > > > On Sat, Oct 08, 2022 at 12:54:32AM +0300, Jarkko Sakkinen wrote: > > > > On Fri, Oct 07, 2022 at 0

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-10 Thread Chao Peng
On Sat, Oct 08, 2022 at 08:35:47PM +0300, Jarkko Sakkinen wrote: > On Sat, Oct 08, 2022 at 07:15:17PM +0300, Jarkko Sakkinen wrote: > > On Sat, Oct 08, 2022 at 12:54:32AM +0300, Jarkko Sakkinen wrote: > > > On Fri, Oct 07, 2022 at 02:58:54PM +, Sean Christopherson wrote: > > > > On Fri, Oct 07,

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-08 Thread Jarkko Sakkinen
On Sat, Oct 08, 2022 at 07:15:17PM +0300, Jarkko Sakkinen wrote: > On Sat, Oct 08, 2022 at 12:54:32AM +0300, Jarkko Sakkinen wrote: > > On Fri, Oct 07, 2022 at 02:58:54PM +, Sean Christopherson wrote: > > > On Fri, Oct 07, 2022, Jarkko Sakkinen wrote: > > > > On Thu, Oct 06, 2022 at 03:34:58PM

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-08 Thread Jarkko Sakkinen
On Sat, Oct 08, 2022 at 12:54:32AM +0300, Jarkko Sakkinen wrote: > On Fri, Oct 07, 2022 at 02:58:54PM +, Sean Christopherson wrote: > > On Fri, Oct 07, 2022, Jarkko Sakkinen wrote: > > > On Thu, Oct 06, 2022 at 03:34:58PM +, Sean Christopherson wrote: > > > > On Thu, Oct 06, 2022, Jarkko Sa

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-07 Thread Jarkko Sakkinen
On Fri, Oct 07, 2022 at 02:58:54PM +, Sean Christopherson wrote: > On Fri, Oct 07, 2022, Jarkko Sakkinen wrote: > > On Thu, Oct 06, 2022 at 03:34:58PM +, Sean Christopherson wrote: > > > On Thu, Oct 06, 2022, Jarkko Sakkinen wrote: > > > > On Thu, Oct 06, 2022 at 05:58:03PM +0300, Jarkko Sa

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-07 Thread Sean Christopherson
On Fri, Oct 07, 2022, Jarkko Sakkinen wrote: > On Thu, Oct 06, 2022 at 03:34:58PM +, Sean Christopherson wrote: > > On Thu, Oct 06, 2022, Jarkko Sakkinen wrote: > > > On Thu, Oct 06, 2022 at 05:58:03PM +0300, Jarkko Sakkinen wrote: > > > > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wro

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-07 Thread Jarkko Sakkinen
On Thu, Oct 06, 2022 at 03:34:58PM +, Sean Christopherson wrote: > On Thu, Oct 06, 2022, Jarkko Sakkinen wrote: > > On Thu, Oct 06, 2022 at 05:58:03PM +0300, Jarkko Sakkinen wrote: > > > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > > > This new extension, indicated by the new

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-06 Thread Sean Christopherson
On Thu, Oct 06, 2022, Jarkko Sakkinen wrote: > On Thu, Oct 06, 2022 at 05:58:03PM +0300, Jarkko Sakkinen wrote: > > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > > This new extension, indicated by the new flag KVM_MEM_PRIVATE, adds two > > > additional KVM memslot fields private_fd

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-06 Thread Jarkko Sakkinen
On Thu, Oct 06, 2022 at 05:58:03PM +0300, Jarkko Sakkinen wrote: > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > This new extension, indicated by the new flag KVM_MEM_PRIVATE, adds two > > additional KVM memslot fields private_fd/private_offset to allow > > userspace to specify tha

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-06 Thread Jarkko Sakkinen
On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > This new extension, indicated by the new flag KVM_MEM_PRIVATE, adds two > additional KVM memslot fields private_fd/private_offset to allow > userspace to specify that guest private memory provided from the > private_fd and guest_phys_addr

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-06 Thread Fuad Tabba
Hi, I'm not sure if this patch or the last one might be the best place for it, but I think it would be useful to have a KVM_CAP associated with this. I am working on getting kvmtool to work with this, and I haven't found a clean way of getting it to discover whether mem_private is supported. Than

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-05 Thread Jarkko Sakkinen
On Wed, Oct 05, 2022 at 04:04:05PM +0300, Jarkko Sakkinen wrote: > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > In memory encryption usage, guest memory may be encrypted with special > > key and can be accessed only by the VM itself. We call such memory > > private memory. It's va

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-10-05 Thread Jarkko Sakkinen
On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > In memory encryption usage, guest memory may be encrypted with special > key and can be accessed only by the VM itself. We call such memory > private memory. It's valueless and sometimes can cause problem to allow > userspace to access gu

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-29 Thread Sean Christopherson
On Thu, Sep 29, 2022, Isaku Yamahata wrote: > On Thu, Sep 15, 2022 at 10:29:07PM +0800, > Chao Peng wrote: > > @@ -4645,14 +4672,20 @@ static long kvm_vm_ioctl(struct file *filp, > > break; > > } > > case KVM_SET_USER_MEMORY_REGION: { > > - struct kvm_userspace_memory

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-29 Thread Isaku Yamahata
On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: ... > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 584a5bab3af3..12dc0dc57b06 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c ... > @@ -4622,6 +4622,33 @@ static int kvm_vm_ioctl_get_stats_fd(struct kvm *kv

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-26 Thread Chao Peng
On Mon, Sep 26, 2022 at 11:26:45AM +0100, Fuad Tabba wrote: ... > > + > > +- KVM_MEM_PRIVATE can be set to indicate a new slot has private memory > > backed by > > + a file descirptor(fd) and the content of the private memory is invisible > > to > > s/descirptor/descriptor Thanks. ... > st

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-26 Thread Fuad Tabba
Hi Chao, On Thu, Sep 15, 2022 at 3:35 PM Chao Peng wrote: > > In memory encryption usage, guest memory may be encrypted with special > key and can be accessed only by the VM itself. We call such memory > private memory. It's valueless and sometimes can cause problem to allow > userspace to access

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-16 Thread Bagas Sanjaya
On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst > index abd7c32126ce..c1fac1e9f820 100644 > --- a/Documentation/virt/kvm/api.rst > +++ b/Documentation/virt/kvm/api.rst > @@ -1319,7 +1319,7 @@ yet and must be c

Re: [PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-16 Thread Chao Peng
On Fri, Sep 16, 2022 at 04:14:29PM +0700, Bagas Sanjaya wrote: > On Thu, Sep 15, 2022 at 10:29:07PM +0800, Chao Peng wrote: > > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst > > index abd7c32126ce..c1fac1e9f820 100644 > > --- a/Documentation/virt/kvm/api.rst > > +++ b

[PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-15 Thread Chao Peng
In memory encryption usage, guest memory may be encrypted with special key and can be accessed only by the VM itself. We call such memory private memory. It's valueless and sometimes can cause problem to allow userspace to access guest private memory. This patch extends the KVM memslot definition s