From: "Michael S. Tsirkin" <mst@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: virtualization <virtualization@lists.linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/virtio: Test virtual address range detection
Date: Tue, 22 Feb 2022 01:31:55 -0500 [thread overview]
Message-ID: <20220222013121-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <75d5002ad505b476c81c0b92c0d624824e93d6ac.camel@infradead.org>
On Mon, Feb 21, 2022 at 05:18:48PM +0000, David Woodhouse wrote:
> On Mon, 2022-02-21 at 18:02 +0100, Stefano Garzarella wrote:
> > On Mon, Feb 21, 2022 at 04:15:22PM +0000, David Woodhouse wrote:
> > > As things stand, an application which wants to use vhost with a trivial
> > > 1:1 mapping of its virtual address space is forced to jump through hoops
> > > to detect what the address range might be. The VHOST_SET_MEM_TABLE ioctl
> > > helpfully doesn't fail immediately; you only get a failure *later* when
> > > you attempt to set the backend, if the table *could* map to an address
> > > which is out of range, even if no out-of-range address is actually
> > > being referenced.
> > >
> > > Since userspace is growing workarounds for this lovely kernel API, let's
> > > ensure that we have a regression test that does things basically the same
> > > way as
> > > https://gitlab.com/openconnect/openconnect/-/commit/443edd9d8826
> > >
> > > does.
> > >
> > > This is untested as I can't actually get virtio_test to work at all; it
> > > just seems to deadlock on a spinlock. But it's getting the right answer
> > > for the virtio range on x86_64 at least.
> >
> > I had a similar issue with virtio_test and this simple patch [1] should
> > fix the deadlock.
> >
> > [1]
> > https://lore.kernel.org/lkml/20220118150631.167015-1-sgarzare@redhat.com/=
>
> Thanks.
>
> [dwoodhou@i7 virtio]$ sudo ~/virtio_test
> Detected virtual address range 0x1000-0x7ffffffff000
> spurious wakeups: 0x0 started=0x100000 completed=0x100000
>
> Although in some circumstances I also see a different build failure:
>
> cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h -c -o vringh_test.o vringh_test.c
> In file included from ./linux/uio.h:3,
> from ./linux/../../../include/linux/vringh.h:15,
> from ./linux/vringh.h:1,
> from vringh_test.c:9:
> ./linux/../../../include/linux/uio.h:10:10: fatal error: linux/mm_types.h: No such file or directory
> 10 | #include <linux/mm_types.h>
> | ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> make: *** [<builtin>: vringh_test.o] Error 1
Which tree has this build failure? In mine linux/uio.h does not
include linux/mm_types.h.
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2022-02-22 6:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 16:15 [PATCH] tools/virtio: Test virtual address range detection David Woodhouse
2022-02-21 17:02 ` Stefano Garzarella
2022-02-21 17:18 ` David Woodhouse
2022-02-22 6:31 ` Michael S. Tsirkin [this message]
2022-02-22 7:58 ` David Woodhouse
2022-02-22 23:18 ` Matthew Wilcox
2022-02-25 15:48 ` Matthew Wilcox
2022-02-25 18:25 ` Michael S. Tsirkin
2022-03-16 14:41 ` Matthew Wilcox
2022-03-20 11:01 ` Michael S. Tsirkin
2022-03-20 11:03 ` Michael S. Tsirkin
2022-02-22 3:25 ` Jason Wang
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=20220222013121-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).