Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-06 Thread Fuad Tabba
Hi Sean, On Fri, Oct 6, 2023 at 4:21 AM Sean Christopherson wrote: > > On Thu, Oct 05, 2023, Fuad Tabba wrote: > > Hi Sean, > > > > On Tue, Oct 3, 2023 at 9:51 PM Sean Christopherson > > wrote: > > > > Like I said, pKVM doesn't need a userspace ABI for managing > > > > PRIVATE/SHARED, > > > >

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-05 Thread Sean Christopherson
On Thu, Oct 05, 2023, Fuad Tabba wrote: > Hi Sean, > > On Tue, Oct 3, 2023 at 9:51 PM Sean Christopherson wrote: > > > Like I said, pKVM doesn't need a userspace ABI for managing > > > PRIVATE/SHARED, > > > just a way of tracking in the host kernel of what is shared (as opposed to > > > the

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-05 Thread Fuad Tabba
Hi Sean, On Tue, Oct 3, 2023 at 9:51 PM Sean Christopherson wrote: > > On Tue, Oct 03, 2023, Fuad Tabba wrote: > > On Tue, Oct 3, 2023 at 4:59 PM Sean Christopherson > > wrote: > > > On Tue, Oct 03, 2023, Fuad Tabba wrote: > > > > > +#define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3) >

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-03 Thread Sean Christopherson
On Tue, Oct 03, 2023, Fuad Tabba wrote: > On Tue, Oct 3, 2023 at 4:59 PM Sean Christopherson wrote: > > On Tue, Oct 03, 2023, Fuad Tabba wrote: > > > > +#define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3) > > > > + > > > > > > In pKVM, we don't want to allow setting (or clearing) of

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-03 Thread Fuad Tabba
Hi Sean, On Tue, Oct 3, 2023 at 4:59 PM Sean Christopherson wrote: > > On Tue, Oct 03, 2023, Fuad Tabba wrote: > > Hi, > > > > > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > > > index d2d913acf0df..f8642ff2eb9d 100644 > > > --- a/include/uapi/linux/kvm.h > > > +++

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-03 Thread Sean Christopherson
On Tue, Oct 03, 2023, Fuad Tabba wrote: > Hi, > > > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > > index d2d913acf0df..f8642ff2eb9d 100644 > > --- a/include/uapi/linux/kvm.h > > +++ b/include/uapi/linux/kvm.h > > @@ -1227,6 +1227,7 @@ struct kvm_ppc_resize_hpt { > > #define

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-10-03 Thread Fuad Tabba
Hi, > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > index d2d913acf0df..f8642ff2eb9d 100644 > --- a/include/uapi/linux/kvm.h > +++ b/include/uapi/linux/kvm.h > @@ -1227,6 +1227,7 @@ struct kvm_ppc_resize_hpt { > #define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228 > #define

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-26 Thread Binbin Wu
On 9/21/2023 5:03 AM, Sean Christopherson wrote: On Mon, Sep 18, 2023, Binbin Wu wrote: On 9/14/2023 9:55 AM, Sean Christopherson wrote: From: Chao Peng [...] +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES +/* + * Returns true if _all_ gfns in the range [@start, @end) have attributes + *

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-25 Thread Sean Christopherson
On Thu, Sep 21, 2023, Yan Zhao wrote: > On Wed, Sep 20, 2023 at 02:00:22PM -0700, Sean Christopherson wrote: > > On Fri, Sep 15, 2023, Yan Zhao wrote: > > > On Wed, Sep 13, 2023 at 06:55:09PM -0700, Sean Christopherson wrote: > > > > +/* Set @attributes for the gfn range [@start, @end). */ > > > >

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-20 Thread Yan Zhao
On Wed, Sep 20, 2023 at 02:00:22PM -0700, Sean Christopherson wrote: > On Fri, Sep 15, 2023, Yan Zhao wrote: > > On Wed, Sep 13, 2023 at 06:55:09PM -0700, Sean Christopherson wrote: > > > From: Chao Peng > > > > > > In confidential computing usages, whether a page is private or shared is > > >

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-20 Thread Sean Christopherson
On Mon, Sep 18, 2023, Binbin Wu wrote: > > > On 9/14/2023 9:55 AM, Sean Christopherson wrote: > > From: Chao Peng > [...] > > +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES > > +/* > > + * Returns true if _all_ gfns in the range [@start, @end) have attributes > > + * matching @attrs. > > + */ > >

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-20 Thread Sean Christopherson
On Fri, Sep 15, 2023, Yan Zhao wrote: > On Wed, Sep 13, 2023 at 06:55:09PM -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,

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-18 Thread Binbin Wu
On 9/14/2023 9:55 AM, Sean Christopherson wrote: From: Chao Peng [...] +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES +/* + * Returns true if _all_ gfns in the range [@start, @end) have attributes + * matching @attrs. + */ +bool kvm_range_has_memory_attributes(struct kvm *kvm, gfn_t

Re: [RFC PATCH v12 11/33] KVM: Introduce per-page memory attributes

2023-09-15 Thread Yan Zhao
On Wed, Sep 13, 2023 at 06:55:09PM -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