On Thu, Sep 14, 2023, Ackerley Tng wrote:
> Sean Christopherson writes:
>
> > On Mon, Aug 28, 2023, Ackerley Tng wrote:
> >> Sean Christopherson writes:
> >> >> If we track struct kvm with the inode, then I think (a), (b) and (c) can
> >> >> be independent of the refcounting method. What do you
Sean Christopherson writes:
> On Mon, Aug 28, 2023, Ackerley Tng wrote:
>> Sean Christopherson writes:
>> >> If we track struct kvm with the inode, then I think (a), (b) and (c) can
>> >> be independent of the refcounting method. What do you think?
>> >
>> > No go. Because again, the inode (phy
On Mon, Aug 28, 2023, Elliot Berman wrote:
> I had a 3rd question that's related to how to wire the gmem up to a virtual
> machine:
>
> I learned of a usecase to implement copy-on-write for gmem. The premise
> would be to have a "golden copy" of the memory that multiple virtual
> machines can map
On Mon, Aug 28, 2023, Ackerley Tng wrote:
> Sean Christopherson writes:
> >> If we track struct kvm with the inode, then I think (a), (b) and (c) can
> >> be independent of the refcounting method. What do you think?
> >
> > No go. Because again, the inode (physical memory) is coupled to the
> >
Binbin Wu writes:
>
>
>>
>> I'm not sure whose refcount the folio_put() in kvm_gmem_allocate() is
>> dropping though:
>>
>> + The refcount for the filemap depends on whether this is a hugepage or
>>not, but folio_put() strictly drops a refcount of 1.
>> + The refcount for the lru list is jus
On 8/31/2023 12:44 AM, Ackerley Tng wrote:
Binbin Wu writes:
+static long kvm_gmem_allocate(struct inode *inode, loff_t offset, loff_t len)
+{
+ struct address_space *mapping = inode->i_mapping;
+ pgoff_t start, index, end;
+ int r;
+
+ /* Dedicated guest is immuta
Binbin Wu writes:
>>
>>
>> +static long kvm_gmem_allocate(struct inode *inode, loff_t offset, loff_t
>> len)
>> +{
>> +struct address_space *mapping = inode->i_mapping;
>> +pgoff_t start, index, end;
>> +int r;
>> +
>> +/* Dedicated guest is immutable by default. */
>> +if (
On 7/19/2023 7:44 AM, Sean Christopherson wrote:
[...]
+
+static struct folio *kvm_gmem_get_folio(struct file *file, pgoff_t index)
+{
+ struct folio *folio;
+
+ /* TODO: Support huge pages. */
+ folio = filemap_grab_folio(file->f_mapping, index);
+ if (!folio)
Should
On 8/28/2023 3:56 PM, Ackerley Tng wrote:
> 1. Since the physical memory's representation is the inode and should be
> coupled to the virtual machine (as a concept, not struct kvm), should
> the binding/coupling be with the file, or the inode?
>
I've been working on Gunyah's implementa
Sean Christopherson writes:
> On Mon, Aug 21, 2023, Ackerley Tng wrote:
>> Sean Christopherson writes:
>>
>> > On Tue, Aug 15, 2023, Ackerley Tng wrote:
>> >> Sean Christopherson writes:
>> >> > Nullifying the KVM pointer isn't sufficient, because without additional
>> >> > actions
>> >> > use
On Mon, Aug 21, 2023, Ackerley Tng wrote:
> Sean Christopherson writes:
>
> > On Tue, Aug 15, 2023, Ackerley Tng wrote:
> >> Sean Christopherson writes:
> >> > Nullifying the KVM pointer isn't sufficient, because without additional
> >> > actions
> >> > userspace could extract data from a VM by
Sean Christopherson writes:
> On Tue, Aug 15, 2023, Ackerley Tng wrote:
>> Sean Christopherson writes:
>>
>> >> I feel that memslots form a natural way of managing usage of the gmem
>> >> file. When a memslot is created, it is using the file; hence we take a
>> >> refcount on the gmem file, and
On Tue, Aug 15, 2023, Ackerley Tng wrote:
> Sean Christopherson writes:
>
> >> I feel that memslots form a natural way of managing usage of the gmem
> >> file. When a memslot is created, it is using the file; hence we take a
> >> refcount on the gmem file, and as memslots are removed, we drop
> >
Sean Christopherson writes:
> On Mon, Aug 07, 2023, Ackerley Tng wrote:
>> I’d like to propose an alternative to the refcounting approach between
>> the gmem file and associated kvm, where we think of KVM’s memslots as
>> users of the gmem file.
>>
>> Instead of having the gmem file pin the VM (i
On Thu, Aug 10, 2023, Vishal Annapurve wrote:
> On Tue, Aug 8, 2023 at 2:13 PM Sean Christopherson wrote:
> > ...
>
> > > + When binding a memslot to the file, if a kvm pointer exists, it must
> > > be the same kvm as the one in this binding
> > > + When the binding to the last memslot is remov
On Tue, Aug 8, 2023 at 2:13 PM Sean Christopherson wrote:
> ...
> > + When binding a memslot to the file, if a kvm pointer exists, it must
> > be the same kvm as the one in this binding
> > + When the binding to the last memslot is removed from a file, NULL the
> > kvm pointer.
>
> Nullifying
On Mon, Aug 07, 2023, Ackerley Tng wrote:
> I’d like to propose an alternative to the refcounting approach between
> the gmem file and associated kvm, where we think of KVM’s memslots as
> users of the gmem file.
>
> Instead of having the gmem file pin the VM (i.e. take a refcount on
> kvm), we co
Sean Christopherson writes:
>
> +static int kvm_gmem_release(struct inode *inode, struct file *file)
> +{
> + struct kvm_gmem *gmem = file->private_data;
> + struct kvm_memory_slot *slot;
> + struct kvm *kvm = gmem->kvm;
> + unsigned long index;
> +
> + filemap_invalidate_
> +static struct folio *kvm_gmem_get_folio(struct file *file, pgoff_t index)
> +{
> + struct folio *folio;
> +
> + /* TODO: Support huge pages. */
> + folio = filemap_grab_folio(file->f_mapping, index);
> + if (!folio)
> + return NULL;
In Linux 6.4, filemap_grab_folio()
Hi Sean,
On Tue, Jul 25, 2023 at 5:04 PM Sean Christopherson wrote:
>
> On Tue, Jul 25, 2023, Wei W Wang wrote:
> > On Wednesday, July 19, 2023 7:45 AM, Sean Christopherson wrote:
> > > +int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot,
> > > +gfn_t gfn, kvm_pfn_
Hi Sean,
On Thu, Jul 27, 2023 at 6:13 PM Sean Christopherson wrote:
>
> On Thu, Jul 27, 2023, Fuad Tabba wrote:
> > Hi Sean,
> >
> >
> > ...
> >
> > > @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
> > > case KVM_GET_STATS_FD:
> > > r = kvm_vm_ioctl_ge
On Thu, Jul 27, 2023, Fuad Tabba wrote:
> Hi Sean,
>
>
> ...
>
> > @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
> > case KVM_GET_STATS_FD:
> > r = kvm_vm_ioctl_get_stats_fd(kvm);
> > break;
> > + case KVM_CREATE_GUEST_MEMFD: {
>
Hi Sean,
...
> @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
> case KVM_GET_STATS_FD:
> r = kvm_vm_ioctl_get_stats_fd(kvm);
> break;
> + case KVM_CREATE_GUEST_MEMFD: {
> + struct kvm_create_guest_memfd guest_memfd;
On 7/18/2023 4:44 PM, Sean Christopherson wrote:
TODO
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 6325d1d0e90f..15041aa7d9ae 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -101,5 +101,6 @@
#define DMA_BUF_MAGIC 0x444d414
On Wed, Jul 26, 2023, Elliot Berman wrote:
>
>
> On 7/18/2023 4:44 PM, Sean Christopherson wrote:
> > TODO
>
> > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> > index 6325d1d0e90f..15041aa7d9ae 100644
> > --- a/include/uapi/linux/magic.h
> > +++ b/include/uapi/linux/mag
On Wednesday, July 26, 2023 12:04 AM, Sean Christopherson wrote:
> On Tue, Jul 25, 2023, Wei W Wang wrote:
> > On Wednesday, July 19, 2023 7:45 AM, Sean Christopherson wrote:
> > > +int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot,
> > > + gfn_t gfn, kvm_pfn_t *pfn,
On Wednesday, July 19, 2023 7:45 AM, Sean Christopherson wrote:
> +int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot,
> + gfn_t gfn, kvm_pfn_t *pfn, int *max_order) {
> + pgoff_t index = gfn - slot->base_gfn + slot->gmem.pgoff;
> + struct kvm_gmem *gmem;
>
On Tue, Jul 25, 2023, Wei W Wang wrote:
> On Wednesday, July 19, 2023 7:45 AM, Sean Christopherson wrote:
> > +int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot,
> > +gfn_t gfn, kvm_pfn_t *pfn, int *max_order) {
> > + pgoff_t index = gfn - slot->base_gfn + slot->g
On Fri, Jul 21, 2023, Isaku Yamahata wrote:
> On Fri, Jul 21, 2023 at 02:13:14PM +0800,
> Yuan Yao wrote:
> > > +static int kvm_gmem_error_page(struct address_space *mapping, struct
> > > page *page)
> > > +{
> > > + struct list_head *gmem_list = &mapping->private_list;
> > > + struct kvm_memory_
On Fri, Jul 21, 2023 at 02:13:14PM +0800,
Yuan Yao wrote:
> On Tue, Jul 18, 2023 at 04:44:55PM -0700, Sean Christopherson wrote:
> > TODO
> >
> > Cc: Fuad Tabba
> > Cc: Vishal Annapurve
> > Cc: Ackerley Tng
> > Cc: Jarkko Sakkinen
> > Cc: Maciej Szmigiero
> > Cc: Vlastimil Babka
> > Cc: Dav
On Fri, Jul 21, 2023, Paolo Bonzini wrote:
> On 7/19/23 01:44, Sean Christopherson wrote:
> > + inode = alloc_anon_inode(mnt->mnt_sb);
> > + if (IS_ERR(inode))
> > + return PTR_ERR(inode);
> > +
> > + err = security_inode_init_security_anon(inode, &qname, NULL);
> > + if (err)
> >
On Fri, Jul 21, 2023, Xiaoyao Li wrote:
> On 7/21/2023 11:05 PM, Xiaoyao Li wrote:
> > On 7/19/2023 7:44 AM, Sean Christopherson wrote:
> > > @@ -6255,12 +6298,17 @@ int kvm_init(unsigned vcpu_size, unsigned
> > > vcpu_align, struct module *module)
> > > if (r)
> > > goto err_async_
On 7/19/23 01:44, Sean Christopherson wrote:
+ inode = alloc_anon_inode(mnt->mnt_sb);
+ if (IS_ERR(inode))
+ return PTR_ERR(inode);
+
+ err = security_inode_init_security_anon(inode, &qname, NULL);
+ if (err)
+ goto err_inode;
+
I don't unders
On 7/21/2023 11:05 PM, Xiaoyao Li wrote:
On 7/19/2023 7:44 AM, Sean Christopherson wrote:
@@ -6255,12 +6298,17 @@ int kvm_init(unsigned vcpu_size, unsigned
vcpu_align, struct module *module)
if (r)
goto err_async_pf;
+ r = kvm_gmem_init();
+ if (r)
+ goto err_gmem;
On 7/19/2023 7:44 AM, Sean Christopherson wrote:
@@ -6255,12 +6298,17 @@ int kvm_init(unsigned vcpu_size, unsigned vcpu_align,
struct module *module)
if (r)
goto err_async_pf;
+ r = kvm_gmem_init();
+ if (r)
+ goto err_gmem;
+
kvm_chardev_o
On Tue, Jul 18, 2023 at 04:44:55PM -0700, Sean Christopherson wrote:
> TODO
>
> Cc: Fuad Tabba
> Cc: Vishal Annapurve
> Cc: Ackerley Tng
> Cc: Jarkko Sakkinen
> Cc: Maciej Szmigiero
> Cc: Vlastimil Babka
> Cc: David Hildenbrand
> Cc: Quentin Perret
> Cc: Michael Roth
> Cc: Wang
> Cc: Liam
On 7/19/2023 7:44 AM, Sean Christopherson wrote:
@@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
case KVM_GET_STATS_FD:
r = kvm_vm_ioctl_get_stats_fd(kvm);
break;
+ case KVM_CREATE_GUEST_MEMFD: {
+ struct kvm_create_gu
On Tue, Jul 18, 2023 at 04:44:55PM -0700,
Sean Christopherson wrote:
> +static int kvm_gmem_release(struct inode *inode, struct file *file)
> +{
> + struct kvm_gmem *gmem = file->private_data;
> + struct kvm_memory_slot *slot;
> + struct kvm *kvm = gmem->kvm;
> + unsigned long ind
On Thu, Jul 20, 2023, Xiaoyao Li wrote:
> On 7/19/2023 7:44 AM, Sean Christopherson wrote:
> > @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
> > case KVM_GET_STATS_FD:
> > r = kvm_vm_ioctl_get_stats_fd(kvm);
> > break;
> > + case KVM_CREATE_GUEST_M
On Tue, Jul 18, 2023 at 4:49 PM Sean Christopherson wrote:
> ...
> +static int kvm_gmem_error_page(struct address_space *mapping, struct page
> *page)
> +{
> + struct list_head *gmem_list = &mapping->private_list;
> + struct kvm_memory_slot *slot;
> + struct kvm_gmem *gmem;
> +
On Wed, Jul 19, 2023, Vishal Annapurve wrote:
> On Tue, Jul 18, 2023 at 4:49 PM Sean Christopherson wrote:
> > ...
> > +static int kvm_gmem_error_page(struct address_space *mapping, struct page
> > *page)
> > +{
> > + struct list_head *gmem_list = &mapping->private_list;
> > + struct
TODO
Cc: Fuad Tabba
Cc: Vishal Annapurve
Cc: Ackerley Tng
Cc: Jarkko Sakkinen
Cc: Maciej Szmigiero
Cc: Vlastimil Babka
Cc: David Hildenbrand
Cc: Quentin Perret
Cc: Michael Roth
Cc: Wang
Cc: Liam Merwick
Cc: Isaku Yamahata
Co-developed-by: Kirill A. Shutemov
Signed-off-by: Kirill A. Sh
42 matches
Mail list logo