Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-19 Thread Fuad Tabba
On Wed, Oct 19, 2022 at 5:09 PM Sean Christopherson wrote: > > On Wed, Oct 19, 2022, Fuad Tabba wrote: > > > > > This sounds good. Thank you. > > > > > > > > I like the idea of a separate Kconfig, e.g. > > > > CONFIG_KVM_GENERIC_PRIVATE_MEM or > > > > something. I highly doubt there will be any

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-19 Thread Sean Christopherson
On Wed, Oct 19, 2022, Fuad Tabba wrote: > > > > This sounds good. Thank you. > > > > > > I like the idea of a separate Kconfig, e.g. > > > CONFIG_KVM_GENERIC_PRIVATE_MEM or > > > something. I highly doubt there will be any non-x86 users for multiple > > > years, > > > if ever, but it would allow

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-19 Thread Fuad Tabba
> > > This sounds good. Thank you. > > > > I like the idea of a separate Kconfig, e.g. CONFIG_KVM_GENERIC_PRIVATE_MEM > > or > > something. I highly doubt there will be any non-x86 users for multiple > > years, > > if ever, but it would allow testing the private memory stuff on ARM (and > > any

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-19 Thread Chao Peng
On Mon, Oct 17, 2022 at 10:17:45PM +, Sean Christopherson wrote: > On Mon, Oct 17, 2022, Fuad Tabba wrote: > > Hi, > > > > > > > +#ifdef CONFIG_HAVE_KVM_PRIVATE_MEM > > > > > +#define KVM_MEM_ATTR_SHARED0x0001 > > > > > +static int kvm_vm_ioctl_set_mem_attr(struct kvm *kvm, gpa_t gpa, > >

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-17 Thread Sean Christopherson
On Mon, Oct 17, 2022, Fuad Tabba wrote: > Hi, > > > > > +#ifdef CONFIG_HAVE_KVM_PRIVATE_MEM > > > > +#define KVM_MEM_ATTR_SHARED0x0001 > > > > +static int kvm_vm_ioctl_set_mem_attr(struct kvm *kvm, gpa_t gpa, gpa_t > > > > size, > > > > +bool is_private) >

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-17 Thread Fuad Tabba
Hi, > > > +#ifdef CONFIG_HAVE_KVM_PRIVATE_MEM > > > +#define KVM_MEM_ATTR_SHARED0x0001 > > > +static int kvm_vm_ioctl_set_mem_attr(struct kvm *kvm, gpa_t gpa, gpa_t > > > size, > > > +bool is_private) > > > +{ > > > > I wonder if this ioctl should be implem

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-11 Thread Chao Peng
On Tue, Oct 11, 2022 at 10:48:58AM +0100, Fuad Tabba wrote: > Hi, > > On Thu, Sep 15, 2022 at 3:38 PM Chao Peng wrote: > > > > If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the > > guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION > > ioctls. The patch

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-10-11 Thread Fuad Tabba
Hi, On Thu, Sep 15, 2022 at 3:38 PM Chao Peng wrote: > > If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the > guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION > ioctls. The patch reuses existing SEV ioctl number but differs that the > address in the reg

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-09-26 Thread Chao Peng
On Mon, Sep 26, 2022 at 11:36:34AM +0100, Fuad Tabba wrote: ... > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index 2125b50f6345..d65690cae80b 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -260,6 +260,15 @@ bool kvm_test_age_gfn(stru

Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-09-26 Thread Fuad Tabba
Hi Chao, On Thu, Sep 15, 2022 at 3:38 PM Chao Peng wrote: > > If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the > guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION > ioctls. The patch reuses existing SEV ioctl number but differs that the > address in th

[PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-09-15 Thread Chao Peng
If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION ioctls. The patch reuses existing SEV ioctl number but differs that the address in the region for KVM_PRIVATE_MEM case is gpa while for SEV case it's hva.