From: "Michael S. Tsirkin" <mst@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: virtualization <virtualization@lists.linux-foundation.org>,
David Woodhouse <dwmw2@infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/virtio: Test virtual address range detection
Date: Sun, 20 Mar 2022 07:01:19 -0400 [thread overview]
Message-ID: <20220320065640-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <YjH3H9KvTFAayTPY@casper.infradead.org>
On Wed, Mar 16, 2022 at 02:41:35PM +0000, Matthew Wilcox wrote:
> On Tue, Feb 22, 2022 at 11:18:18PM +0000, Matthew Wilcox wrote:
> > On Tue, Feb 22, 2022 at 07:58:33AM +0000, David Woodhouse wrote:
> > > On Tue, 2022-02-22 at 01:31 -0500, Michael S. Tsirkin wrote:
> > > > On Mon, Feb 21, 2022 at 05:18:48PM +0000, David Woodhouse wrote:
> > > > >
> > > > > [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
> >
> > Trying to test this myself ...
> >
> > $ cd tools/virtio/
> > $ make
> > ...
> > cc -lpthread virtio_test.o virtio_ring.o -o virtio_test
> > /usr/bin/ld: virtio_ring.o: in function `spin_lock':
> > /home/willy/kernel/folio/tools/virtio/./linux/spinlock.h:16: undefined reference to `pthread_spin_lock'
> >
> > So this is not the only problem here?
>
> FYI, this fixes it for me:
>
> diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile
> index 0d7bbe49359d..83b6a522d0d2 100644
> --- a/tools/virtio/Makefile
> +++ b/tools/virtio/Makefile
> @@ -5,7 +5,7 @@ virtio_test: virtio_ring.o virtio_test.o
> vringh_test: vringh_test.o vringh.o virtio_ring.o
>
> CFLAGS += -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
> -LDFLAGS += -lpthread
> +LDFLAGS += -pthread
> vpath %.c ../../drivers/virtio ../../drivers/vhost
> mod:
> ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
gcc documentation seems to say this is neeed in cflags too:
-pthread
Define additional macros required for using the POSIX threads library. You should use this option consistently for both
compilation and linking. This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86
Cygwin and MinGW targets.
right?
--
MST
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: David Woodhouse <dwmw2@infradead.org>,
Stefano Garzarella <sgarzare@redhat.com>,
Jason Wang <jasowang@redhat.com>,
virtualization <virtualization@lists.linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/virtio: Test virtual address range detection
Date: Sun, 20 Mar 2022 07:01:19 -0400 [thread overview]
Message-ID: <20220320065640-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <YjH3H9KvTFAayTPY@casper.infradead.org>
On Wed, Mar 16, 2022 at 02:41:35PM +0000, Matthew Wilcox wrote:
> On Tue, Feb 22, 2022 at 11:18:18PM +0000, Matthew Wilcox wrote:
> > On Tue, Feb 22, 2022 at 07:58:33AM +0000, David Woodhouse wrote:
> > > On Tue, 2022-02-22 at 01:31 -0500, Michael S. Tsirkin wrote:
> > > > On Mon, Feb 21, 2022 at 05:18:48PM +0000, David Woodhouse wrote:
> > > > >
> > > > > [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
> >
> > Trying to test this myself ...
> >
> > $ cd tools/virtio/
> > $ make
> > ...
> > cc -lpthread virtio_test.o virtio_ring.o -o virtio_test
> > /usr/bin/ld: virtio_ring.o: in function `spin_lock':
> > /home/willy/kernel/folio/tools/virtio/./linux/spinlock.h:16: undefined reference to `pthread_spin_lock'
> >
> > So this is not the only problem here?
>
> FYI, this fixes it for me:
>
> diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile
> index 0d7bbe49359d..83b6a522d0d2 100644
> --- a/tools/virtio/Makefile
> +++ b/tools/virtio/Makefile
> @@ -5,7 +5,7 @@ virtio_test: virtio_ring.o virtio_test.o
> vringh_test: vringh_test.o vringh.o virtio_ring.o
>
> CFLAGS += -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
> -LDFLAGS += -lpthread
> +LDFLAGS += -pthread
> vpath %.c ../../drivers/virtio ../../drivers/vhost
> mod:
> ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
gcc documentation seems to say this is neeed in cflags too:
-pthread
Define additional macros required for using the POSIX threads library. You should use this option consistently for both
compilation and linking. This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86
Cygwin and MinGW targets.
right?
--
MST
next prev parent reply other threads:[~2022-03-20 11:01 UTC|newest]
Thread overview: 24+ 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 16:15 ` David Woodhouse
2022-02-21 17:02 ` Stefano Garzarella
2022-02-21 17:02 ` Stefano Garzarella
2022-02-21 17:18 ` David Woodhouse
2022-02-21 17:18 ` David Woodhouse
2022-02-22 6:31 ` Michael S. Tsirkin
2022-02-22 6:31 ` Michael S. Tsirkin
2022-02-22 7:58 ` David Woodhouse
2022-02-22 7:58 ` David Woodhouse
2022-02-22 23:18 ` Matthew Wilcox
2022-02-22 23:18 ` Matthew Wilcox
2022-02-25 15:48 ` Matthew Wilcox
2022-02-25 15:48 ` Matthew Wilcox
2022-02-25 18:25 ` Michael S. Tsirkin
2022-02-25 18:25 ` Michael S. Tsirkin
2022-03-16 14:41 ` Matthew Wilcox
2022-03-16 14:41 ` Matthew Wilcox
2022-03-20 11:01 ` Michael S. Tsirkin [this message]
2022-03-20 11:01 ` Michael S. Tsirkin
2022-03-20 11:03 ` Michael S. Tsirkin
2022-03-20 11:03 ` Michael S. Tsirkin
2022-02-22 3:25 ` Jason Wang
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=20220320065640-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 \
--cc=willy@infradead.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 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.