From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24322C433F5 for ; Tue, 22 Feb 2022 23:19:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236271AbiBVXTZ (ORCPT ); Tue, 22 Feb 2022 18:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236286AbiBVXTA (ORCPT ); Tue, 22 Feb 2022 18:19:00 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E084931A7 for ; Tue, 22 Feb 2022 15:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WgBSWEgjN1w1rfgdGYqlLhuiwSB4vMovObriufzKuVs=; b=AYR1hh89Un+yzNFBdfLoaw/kgX TcXqsECvACDyD51bpK5KdTdaWCFE/wMx973gswpmlGWtqfvzAet6H1bfuTAfVh+NgRzyGT757ZeNE tgOmWLYHTvkpoAr3UBHHidTzd7tKTRndZBGMau3jpsP2cW7vl5xWroNgRH9aAR49wfVOvjmxsOwEw Cc+Ix1tSTQyZ3wSVBvHlIz3jjFe3VgnZjZpAfSrXfDHie06eZZDTyTezLhvvIEzNHyfsgebXE+q3b FwTLs1EvcLliZR5Js16MuSAG+SpMNFwLRUnLGFj4W12eUM9+o+1kOE3pad4Zuc0/LVyDAszOmKc4K drZ4/7NA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMeQE-003E8X-Ff; Tue, 22 Feb 2022 23:18:18 +0000 Date: Tue, 22 Feb 2022 23:18:18 +0000 From: Matthew Wilcox To: David Woodhouse Cc: "Michael S. Tsirkin" , Stefano Garzarella , Jason Wang , virtualization , linux-kernel Subject: Re: [PATCH] tools/virtio: Test virtual address range detection Message-ID: References: <20220221170217.5bq7nhr3pvchku5x@sgarzare-redhat> <75d5002ad505b476c81c0b92c0d624824e93d6ac.camel@infradead.org> <20220222013121-mutt-send-email-mst@kernel.org> <8e60951973cab3a3d27a3c7f18d866cdb804e663.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8e60951973cab3a3d27a3c7f18d866cdb804e663.camel@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > > 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 > > > | ^~~~~~~~~~~~~~~~~~ > > > compilation terminated. > > > make: *** [: vringh_test.o] Error 1 > > > > Which tree has this build failure? In mine linux/uio.h does not > > include linux/mm_types.h. > > Strictly it's > https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/xen-evtchn-kernel > but I'm sure my part isn't relevant; it's just v5.17-rc5. > > $ git blame include/linux/uio.h | grep mm_types.h > d9c19d32d86fa (Matthew Wilcox (Oracle) 2021-10-18 10:39:06 -0400 10) #include > $ git describe --tags d9c19d32d86fa > v5.16-rc4-37-gd9c19d32d86f grr. Originally, I had this doing a typebusting cast, but hch objected, so I had to include mm_types.h. This should fix it ... $ git diff diff --git a/tools/virtio/linux/mm_types.h b/tools/virtio/linux/mm_types.h new file mode 100644 index 000000000000..3b0fc9bc5b8f --- /dev/null +++ b/tools/virtio/linux/mm_types.h @@ -0,0 +1,3 @@ +struct folio { + struct page page; +}; At least, it makes it compile for me.