All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: "chenglong.ma" <longpareto@gmail.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Xie Yongji" <xieyongji@bytedance.com>,
	virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vduse: don't set VM_IO on the domain file mapping
Date: Wed, 25 Nov 2026 13:05:37 -0500	[thread overview]
Message-ID: <20261125130424-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <awcNt5C6jkZQLy0M@gremlin>

On Wed, Nov 25, 2026 at 04:38:51PM +0000, Lorenzo Stoakes (ARM) wrote:
> This isn't how you send patches in the kernel...
> 
> See https://docs.kernel.org/process/submitting-patches.html
> 
> This is a v2 of the original patch. It should say [PATCH v2].
> 
> You shouldn't send a respin so quickly.
> 
> On Thu, Nov 26, 2026 at 12:01:28AM +0800, chenglong.ma wrote:
> > Commit bb2e6f166547 ("vduse: fix VA/PA confusion in the coherent page fault path")
> > set VM_IO on the domain file mapping so that
> > vhost_vdpa_va_map() would skip it. Since 99fd6bf43d5d, mm refuses VM_IO
> > on mm-managed mappings: mmap() of the domain file fails with a
> > WARN_ON_ONCE() and -EINVAL, which breaks VDUSE userspace.
> >
> > VDUSE is currently broken in 7.4 because of this. Please treat this as
> > a hotfix for 7.4.
> 
> You should say that it's broken and the patch fixes it in the commit message,
> and leave commentary about it being a hotfix for below the ---.
> 
> >
> > VM_IO is not needed. vduse_domain_set_map() already rejects vhost-vdpa
> > entries backed by the domain file, and the file check in
> > vduse_domain_get_coherent_page() keeps any other entry from being
> > translated as a physical address. A self-referencing mapping now
> > reaches vduse_domain_set_map() and is refused with -EINVAL.
> >
> > Fixes: bb2e6f166547 ("vduse: fix VA/PA confusion in the coherent page fault path")
> 
> Cc: stable?

why cc stable did stable backport the buggy patch?

> You shouldn't be using VM_IO anywhere.
> 
> > Reported-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> > Closes: https://lore.kernel.org/r/awWOpS3HR_2FTN3I@gremlin
> > Suggested-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> 
> You failed to propagate my Reviewed-by tag...
> 
> > Signed-off-by: chenglong.ma <longpareto@gmail.com>
> 
> This Signed-off-by seems invalid, there shouldn't be a '.' there I don't think?
> 
> (Also gmail isn't really recommended for kernel stuff either, they drop a lot of
> kernel mail).
> 
> Anyway, I assume Michael can pick this up and fix it up a bit?
> 
> For the patch itself:
> 
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
> 
> > ---
> >
> > Notes:
> >     Tested on v7.4-rc2 (commit 7475ea8b58616b33c04afb976cf0fbaad9dd63fb).
> >
> >     Control, without this patch: mmap() of the VDUSE domain file fails,
> >     with the WARN_ON_ONCE() from 99fd6bf43d5d.
> >
> >     With this patch applied: mmap() of the domain file succeeds, and
> >     importing that mapping through vhost-vdpa is refused by
> >     vduse_domain_set_map() with -EINVAL.
> >
> >     Dynamic tests also confirmed that vduse_domain_get_coherent_page()
> >     refuses to translate entries backed by any file other than the domain
> >     file, and that legitimate coherent vring mappings are still translated.
> >
> >  drivers/vdpa/vdpa_user/iova_domain.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_domain.c
> > index 28a977248a0d..3c6fa18703b4 100644
> > --- a/drivers/vdpa/vdpa_user/iova_domain.c
> > +++ b/drivers/vdpa/vdpa_user/iova_domain.c
> > @@ -588,7 +588,7 @@ static int vduse_domain_mmap(struct file *file, struct vm_area_struct *vma)
> >  {
> >  	struct vduse_iova_domain *domain = file->private_data;
> >
> > -	vm_flags_set(vma, VM_IO | VM_DONTDUMP | VM_DONTEXPAND);
> > +	vm_flags_set(vma, VM_DONTDUMP | VM_DONTEXPAND);
> >  	vma->vm_private_data = domain;
> >  	vma->vm_ops = &vduse_domain_mmap_ops;
> >
> >
> > base-commit: 44293796526f4343639f87b2acc53811c78b5d54
> > --
> > 2.45.2.windows.1
> >
> 
> --
> Cheers, Lorenzo


  reply	other threads:[~2026-11-25 18:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 16:01 [PATCH] vduse: don't set VM_IO on the domain file mapping chenglong.ma
2026-11-25 16:12 ` sashiko-bot
2026-11-25 16:38 ` Lorenzo Stoakes (ARM)
2026-11-25 18:05   ` Michael S. Tsirkin [this message]
2026-11-25 18:34     ` Lorenzo Stoakes (ARM)
2026-11-25 18:06   ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2026-11-25 15:28 chenglong.ma
2026-11-25 15:39 ` Lorenzo Stoakes (ARM)
2026-11-25 15:42 ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261125130424-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=longpareto@gmail.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xieyongji@bytedance.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.