Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-11-02 Thread Huang, Kai
On Thu, 2023-11-02 at 11:32 +0100, Paolo Bonzini wrote: > > > +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES > > > +static inline unsigned long kvm_get_memory_attributes(struct kvm *kvm, > > > gfn_t gfn) > > > +{ > > > + return xa_to_value(xa_load(>mem_attr_array, gfn)); > > > +} > > > > Only call

Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-11-02 Thread Paolo Bonzini
On 11/2/23 04:01, Huang, Kai wrote: On Fri, 2023-10-27 at 11:21 -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

Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-11-01 Thread Huang, Kai
On Fri, 2023-10-27 at 11:21 -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: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-10-31 Thread David Matlack
On 2023-10-27 11:21 AM, Sean Christopherson wrote: > From: Chao Peng > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 89c1a991a3b8..df573229651b 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -808,6 +809,9 @@ struct kvm { > > #ifdef

Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-10-30 Thread Sean Christopherson
On Mon, Oct 30, 2023, Sean Christopherson wrote: > On Mon, Oct 30, 2023, Chao Gao wrote: > > On Fri, Oct 27, 2023 at 11:21:55AM -0700, Sean Christopherson wrote: > > >From: Chao Peng > > > > > >In confidential computing usages, whether a page is private or shared is > > >necessary information for

Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-10-30 Thread Sean Christopherson
On Mon, Oct 30, 2023, Chao Gao wrote: > On Fri, Oct 27, 2023 at 11:21:55AM -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

Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-10-30 Thread Chao Gao
On Fri, Oct 27, 2023 at 11:21:55AM -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

[PATCH v13 13/35] KVM: Introduce per-page memory attributes

2023-10-27 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,