Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-08-14 Thread Binbin Wu
On 7/19/2023 7:44 AM, Sean Christopherson wrote: From: Chao Peng In confidential computing usages, whether a page is private or shared is necessary information for KVM to perform operations like page fault handling, page zapping etc. There are other potential use cases for per-page memory at

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-08-14 Thread Sean Christopherson
On Mon, Aug 14, 2023, Binbin Wu wrote: > > On 7/19/2023 7:44 AM, Sean Christopherson wrote: > > + struct kvm_mmu_notifier_range post_set_range = { > > + .start = start, > > + .end = end, > > + .arg.attributes = attributes, > > + .handler = kvm_arch_post_se

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-08-02 Thread Isaku Yamahata
On Tue, Jul 18, 2023 at 04:44:51PM -0700, Sean Christopherson wrote: > From: Chao Peng > > In confidential computing usages, whether a page is private or shared is > necessary information for KVM to perform operations like page fault > handling, page zapping etc. There are other potential use c

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-26 Thread Xu Yilun
On 2023-07-26 at 08:59:53 -0700, Sean Christopherson wrote: > On Mon, Jul 24, 2023, Xu Yilun wrote: > > On 2023-07-18 at 16:44:51 -0700, Sean Christopherson wrote: > > > + if (WARN_ON_ONCE(start == end)) > > > + return -EINVAL; > > > > Also, is this check possible to be hit? Maybe remove i

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-26 Thread Sean Christopherson
On Mon, Jul 24, 2023, Xu Yilun wrote: > On 2023-07-18 at 16:44:51 -0700, Sean Christopherson wrote: > > @@ -1346,6 +1350,9 @@ static void kvm_destroy_vm(struct kvm *kvm) > > kvm_free_memslots(kvm, &kvm->__memslots[i][0]); > > kvm_free_memslots(kvm, &kvm->__memslots[i][1]); >

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-23 Thread Xu Yilun
On 2023-07-18 at 16:44:51 -0700, Sean Christopherson wrote: > From: Chao Peng > > In confidential computing usages, whether a page is private or shared is > necessary information for KVM to perform operations like page fault > handling, page zapping etc. There are other potential use cases for >

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-21 Thread Xiaoyao Li
On 7/19/2023 7:44 AM, Sean Christopherson wrote: +4.140 KVM_SET_MEMORY_ATTRIBUTES +- + +:Capability: KVM_CAP_MEMORY_ATTRIBUTES +:Architectures: x86 +:Type: vm ioctl +:Parameters: struct kvm_memory_attributes(in/out) +:Returns: 0 on success, <0 on error + +S

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-21 Thread Paolo Bonzini
On 7/19/23 01:44, Sean Christopherson wrote: From: Chao Peng In confidential computing usages, whether a page is private or shared is necessary information for KVM to perform operations like page fault handling, page zapping etc. There are other potential use cases for per-page memory attribute

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-20 Thread Sean Christopherson
On Thu, Jul 20, 2023, Isaku Yamahata wrote: > On Thu, Jul 20, 2023 at 04:09:12PM +0800, > Yuan Yao wrote: > > > On Tue, Jul 18, 2023 at 04:44:51PM -0700, Sean Christopherson wrote: > > > @@ -2301,4 +2305,14 @@ static inline void kvm_account_pgtable_pages(void > > > *virt, int nr) > > > /* Max n

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-20 Thread Isaku Yamahata
On Thu, Jul 20, 2023 at 04:09:12PM +0800, Yuan Yao wrote: > On Tue, Jul 18, 2023 at 04:44:51PM -0700, Sean Christopherson wrote: > > From: Chao Peng > > > > In confidential computing usages, whether a page is private or shared is > > necessary information for KVM to perform operations like page

Re: [RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-20 Thread Yuan Yao
On Tue, Jul 18, 2023 at 04:44:51PM -0700, Sean Christopherson wrote: > From: Chao Peng > > In confidential computing usages, whether a page is private or shared is > necessary information for KVM to perform operations like page fault > handling, page zapping etc. There are other potential use case

[RFC PATCH v11 08/29] KVM: Introduce per-page memory attributes

2023-07-18 Thread Sean Christopherson
From: Chao Peng In confidential computing usages, whether a page is private or shared is necessary information for KVM to perform operations like page fault handling, page zapping etc. There are other potential use cases for per-page memory attributes, e.g. to make memory read-only (or no-exec, o