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

2022-11-17 Thread Chao Peng
On Wed, Nov 16, 2022 at 10:24:11PM +, Sean Christopherson wrote: > On Tue, Oct 25, 2022, Chao Peng wrote: > > +static int kvm_vm_ioctl_set_mem_attr(struct kvm *kvm, gpa_t gpa, gpa_t > > size, > > +bool is_private) > > +{ > > + gfn_t start, end; > > +

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

2022-11-16 Thread Sean Christopherson
On Tue, Oct 25, 2022, Chao Peng wrote: > +static int kvm_vm_ioctl_set_mem_attr(struct kvm *kvm, gpa_t gpa, gpa_t size, > + bool is_private) > +{ > + gfn_t start, end; > + unsigned long i; > + void *entry; > + int idx; > + int r = 0; > + > +

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

2022-11-08 Thread Yuan Yao
On Tue, Nov 08, 2022 at 05:41:41PM +0800, Chao Peng wrote: > On Tue, Nov 08, 2022 at 09:35:06AM +0800, Yuan Yao wrote: > > On Tue, Oct 25, 2022 at 11:13:41PM +0800, Chao Peng wrote: > > > Introduce generic private memory register/unregister by reusing existing > > > SEV ioctls

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

2022-11-08 Thread Chao Peng
On Tue, Nov 08, 2022 at 09:35:06AM +0800, Yuan Yao wrote: > On Tue, Oct 25, 2022 at 11:13:41PM +0800, Chao Peng wrote: > > Introduce generic private memory register/unregister by reusing existing > > SEV ioctls KVM_MEMORY_ENCRYPT_{UN,}REG_REGION. It differs from SEV case > > by treating address in

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

2022-11-08 Thread Chao Peng
On Fri, Nov 04, 2022 at 09:19:31PM +, Sean Christopherson wrote: > Paolo, any thoughts before I lead things further astray? > > On Fri, Nov 04, 2022, Chao Peng wrote: > > On Thu, Nov 03, 2022 at 11:04:53PM +, Sean Christopherson wrote: > > > On Tue, Oct 25, 2022, Chao Peng wrote: > > > >

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

2022-11-07 Thread Yuan Yao
On Tue, Oct 25, 2022 at 11:13:41PM +0800, Chao Peng wrote: > Introduce generic private memory register/unregister by reusing existing > SEV ioctls KVM_MEMORY_ENCRYPT_{UN,}REG_REGION. It differs from SEV case > by treating address in the region as gpa instead of hva. Which cases > should these

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

2022-11-04 Thread Sean Christopherson
Paolo, any thoughts before I lead things further astray? On Fri, Nov 04, 2022, Chao Peng wrote: > On Thu, Nov 03, 2022 at 11:04:53PM +, Sean Christopherson wrote: > > On Tue, Oct 25, 2022, Chao Peng wrote: > > > @@ -4708,6 +4802,24 @@ static long kvm_vm_ioctl(struct file *filp, > > >

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

2022-11-04 Thread Chao Peng
On Thu, Nov 03, 2022 at 11:04:53PM +, Sean Christopherson wrote: > On Tue, Oct 25, 2022, Chao Peng wrote: > > @@ -4708,6 +4802,24 @@ static long kvm_vm_ioctl(struct file *filp, > > r = kvm_vm_ioctl_set_memory_region(kvm, ); > > break; > > } > > +#ifdef

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

2022-11-03 Thread Sean Christopherson
On Tue, Oct 25, 2022, Chao Peng wrote: > @@ -4708,6 +4802,24 @@ static long kvm_vm_ioctl(struct file *filp, > r = kvm_vm_ioctl_set_memory_region(kvm, ); > break; > } > +#ifdef CONFIG_KVM_GENERIC_PRIVATE_MEM > + case KVM_MEMORY_ENCRYPT_REG_REGION: > + case

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

2022-10-27 Thread Fuad Tabba
Hi, On Tue, Oct 25, 2022 at 4:19 PM Chao Peng wrote: > > Introduce generic private memory register/unregister by reusing existing > SEV ioctls KVM_MEMORY_ENCRYPT_{UN,}REG_REGION. It differs from SEV case > by treating address in the region as gpa instead of hva. Which cases > should these ioctls

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

2022-10-25 Thread Chao Peng
Introduce generic private memory register/unregister by reusing existing SEV ioctls KVM_MEMORY_ENCRYPT_{UN,}REG_REGION. It differs from SEV case by treating address in the region as gpa instead of hva. Which cases should these ioctls go is determined by the kvm_arch_has_private_mem(). Architecture