Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-23 Thread Nicolas Saenz Julienne
Hi Sean, On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > Hi, > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: [...] > > VSM introduces isolated guest execution contexts called Virtual Trust > > Levels (VTL) [2].

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Nicolas Saenz Julienne
Hi Sean, On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > Hi, > > > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > > > [...] > > > +The user sets the per-page memory attributes to a guest memory range > > >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Nicolas Saenz Julienne
Hi, On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: [...] > +4.138 KVM_GET_SUPPORTED_MEMORY_ATTRIBUTES > +- > + > +:Capability: KVM_CAP_MEMORY_ATTRIBUTES > +:Architectures: x86 > +:Type: vm ioctl > +:Parameters: u64 memory attributes bitmask(out) >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Sean Christopherson
On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > Hi Sean, > > On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > > Hi, > > > > > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > > > > > [...] > > > > +The user

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Sean Christopherson
On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > Hi, > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > [...] > > +The user sets the per-page memory attributes to a guest memory range > > indicated > > +by address/size, and in return KVM adjusts address and size to reflect the > >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-02-14 Thread Sean Christopherson
On Mon, Feb 13, 2023, Isaku Yamahata wrote: > On Fri, Feb 10, 2023 at 12:35:30AM +, > Sean Christopherson wrote: > > > On Wed, Feb 08, 2023, Isaku Yamahata wrote: > > > On Fri, Dec 02, 2022 at 02:13:40PM +0800, > > > Chao Peng wrote: > > > > > > > +static int

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-02-13 Thread Isaku Yamahata
On Fri, Feb 10, 2023 at 12:35:30AM +, Sean Christopherson wrote: > On Wed, Feb 08, 2023, Isaku Yamahata wrote: > > On Fri, Dec 02, 2022 at 02:13:40PM +0800, > > Chao Peng wrote: > > > > > +static int kvm_vm_ioctl_set_mem_attributes(struct kvm *kvm, > > > +

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-02-09 Thread Sean Christopherson
On Wed, Feb 08, 2023, Isaku Yamahata wrote: > On Fri, Dec 02, 2022 at 02:13:40PM +0800, > Chao Peng wrote: > > > +static int kvm_vm_ioctl_set_mem_attributes(struct kvm *kvm, > > + struct kvm_memory_attributes *attrs) > > +{ > > + gfn_t start, end; > > +

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-02-08 Thread Isaku Yamahata
On Fri, Dec 02, 2022 at 02:13:40PM +0800, Chao Peng wrote: > +static int kvm_vm_ioctl_set_mem_attributes(struct kvm *kvm, > +struct kvm_memory_attributes *attrs) > +{ > + gfn_t start, end; > + unsigned long i; > + void *entry; > + u64

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-17 Thread Sean Christopherson
On Tue, Jan 17, 2023, Chao Peng wrote: > On Tue, Jan 17, 2023 at 11:21:10AM +0800, Binbin Wu wrote: > > > > On 12/2/2022 2:13 PM, Chao Peng wrote: > > > In confidential computing usages, whether a page is private or shared is > > > necessary information for KVM to perform operations like page

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-17 Thread Binbin Wu
On 12/2/2022 2:13 PM, Chao Peng wrote: 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

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-17 Thread Chao Peng
On Tue, Jan 17, 2023 at 11:21:10AM +0800, Binbin Wu wrote: > > On 12/2/2022 2:13 PM, Chao Peng wrote: > > 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 v10 2/9] KVM: Introduce per-page memory attributes

2023-01-13 Thread Sean Christopherson
On Fri, Dec 02, 2022, Chao Peng wrote: > diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig > index fbeaa9ddef59..a8e379a3afee 100644 > --- a/arch/x86/kvm/Kconfig > +++ b/arch/x86/kvm/Kconfig > @@ -49,6 +49,7 @@ config KVM > select SRCU > select INTERVAL_TREE > select

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-04 Thread Chao Peng
On Tue, Jan 03, 2023 at 11:06:37PM +, Sean Christopherson wrote: > On Tue, Jan 03, 2023, Wang, Wei W wrote: > > On Tuesday, January 3, 2023 9:40 AM, Chao Peng wrote: > > > > Because guest memory defaults to private, and now this patch stores > > > > the attributes with

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-03 Thread Sean Christopherson
On Tue, Jan 03, 2023, Wang, Wei W wrote: > On Tuesday, January 3, 2023 9:40 AM, Chao Peng wrote: > > > Because guest memory defaults to private, and now this patch stores > > > the attributes with KVM_MEMORY_ATTRIBUTE_PRIVATE instead of > > _SHARED, > > > it would bring more KVM_EXIT_MEMORY_FAULT

RE: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-02 Thread Wang, Wei W
On Tuesday, January 3, 2023 9:40 AM, Chao Peng wrote: > > Because guest memory defaults to private, and now this patch stores > > the attributes with KVM_MEMORY_ATTRIBUTE_PRIVATE instead of > _SHARED, > > it would bring more KVM_EXIT_MEMORY_FAULT exits at the beginning of > > boot time. Maybe it

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-01-02 Thread Chao Peng
On Wed, Dec 28, 2022 at 04:28:01PM +0800, Chenyi Qiang wrote: ... > > +static int kvm_vm_ioctl_set_mem_attributes(struct kvm *kvm, > > + struct kvm_memory_attributes *attrs) > > +{ > > + gfn_t start, end; > > + unsigned long i; > > + void *entry; > > +

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-28 Thread Chenyi Qiang
On 12/2/2022 2:13 PM, Chao Peng wrote: > 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

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-19 Thread Chao Peng
On Mon, Dec 19, 2022 at 11:17:22AM +0100, Borislav Petkov wrote: > On Mon, Dec 19, 2022 at 04:15:32PM +0800, Chao Peng wrote: > > Tamping down with error number a bit: > > > > if (attrs->flags) > > return -ENXIO; > > if (attrs->attributes & ~supported_attrs) > >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-19 Thread Borislav Petkov
On Mon, Dec 19, 2022 at 04:15:32PM +0800, Chao Peng wrote: > Tamping down with error number a bit: > > if (attrs->flags) > return -ENXIO; > if (attrs->attributes & ~supported_attrs) > return -EOPNOTSUPP; > if (!PAGE_ALIGNED(attrs->address)

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-19 Thread Chao Peng
On Fri, Dec 16, 2022 at 04:09:06PM +0100, Borislav Petkov wrote: > On Fri, Dec 02, 2022 at 02:13:40PM +0800, Chao Peng wrote: > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index 1782c4555d94..7f0f5e9f2406 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-16 Thread Borislav Petkov
On Fri, Dec 02, 2022 at 02:13:40PM +0800, Chao Peng wrote: > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 1782c4555d94..7f0f5e9f2406 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -1150,6 +1150,9 @@ static struct kvm *kvm_create_vm(unsigned long type, >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-07 Thread Chao Peng
On Tue, Dec 06, 2022 at 03:07:27PM +, Fuad Tabba wrote: > Hi, > > On Fri, Dec 2, 2022 at 6:18 AM Chao Peng wrote: > > > > 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 v10 2/9] KVM: Introduce per-page memory attributes

2022-12-07 Thread Chao Peng
On Tue, Dec 06, 2022 at 10:34:32AM -0300, Fabiano Rosas wrote: > Chao Peng writes: > > > 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

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-06 Thread Fuad Tabba
Hi, On Fri, Dec 2, 2022 at 6:18 AM Chao Peng wrote: > > 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

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-06 Thread Fabiano Rosas
Chao Peng writes: > 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

[PATCH v10 2/9] KVM: Introduce per-page memory attributes

2022-12-01 Thread 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, or exec-only,