Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5415643rwj; Wed, 21 Dec 2022 02:17:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtdZYeOiqLzKu4585IpOYGVitBJ9yDewatlyJStnW3tVKcfCRej1tOfnZvNMBcHvK3+Uipn X-Received: by 2002:a17:907:20e7:b0:7c0:969a:ca7f with SMTP id rh7-20020a17090720e700b007c0969aca7fmr786824ejb.76.1671617821991; Wed, 21 Dec 2022 02:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671617821; cv=none; d=google.com; s=arc-20160816; b=pl/uiV1/ksTK9mRDvpI2XU47dbcAOcUAVfxD+XmHjg9+HBmDxHoX8CI9rEhwqilrr6 Yr5roKFhv6DG4m5jHbbEn86yo2I9y9hYe3B8mhg/0eBFud+TqJiAUU23ITb4r5M8JZMm 02hzFKQYKnQ/dAVFoctxfErlX1BHd45sHBdDS0Bg4mSgU/0wnkepFPbGM1r0m5D/aXQ7 iKD1Zgv5eKVmm5AhJTT5mCsd7XbDdoYnksdoPrGXi2sBLl1sa6rjBgGmI1d4031ZcYoF j8dP9C6Hy+MRhqSt3mDn681A/+OYAsO15eQV7eZC+z0ObyLkZe6uCHuGtk4q0/E/o1OB K2dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Q8PYa+hzhyaXM2zhhaOaZAWlrRm4/hVUI6gNjdoah80=; b=n+7XWgpFYuiz3rRaA5UpMzIw0n8peSGWcgmO7/P32D4W4duKOyCVS01vI43mX9Lbby sRyruBcs0EUL3LGNgIo7d/3Ua3/yBXIqpE6Qko4X0Es5GszLhML3dbW5/x8Inp/bSabk bp1wAkqCzwYRcLftCjbL9bDKPvQYehFjv8Bm3E3F/einOHC1KToAATeKDwFK0/DC5wgH Nkf6e4V8w/DO04aGdyzMWZBo+B52mKWD63vX5Nakn46xXRE8xpqN8UnP+pOJe3ZJdZbu jiJ3m7marNGjn8jdPPqQZkTzA3SBsyweq8CS40Kcy8vSL8cF3AWXne7OEAN/tdr3E/X8 g7wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=eRYC09CE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wg10-20020a17090705ca00b007c0b7b5ff5csi3107571ejb.646.2022.12.21.02.16.45; Wed, 21 Dec 2022 02:17:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=eRYC09CE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234534AbiLUJgC (ORCPT + 69 others); Wed, 21 Dec 2022 04:36:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231652AbiLUJgA (ORCPT ); Wed, 21 Dec 2022 04:36:00 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C64E5183AB for ; Wed, 21 Dec 2022 01:35:59 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id t11-20020a17090a024b00b0021932afece4so1617765pje.5 for ; Wed, 21 Dec 2022 01:35:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Q8PYa+hzhyaXM2zhhaOaZAWlrRm4/hVUI6gNjdoah80=; b=eRYC09CENai5kj+0qBQ106ipvQvKCerF6/GbIaNv8EXhnYN+Wj8EBVeLL6Tc0/NZ+C INQJx2Qelsp8JaqgYdzpMCxMa3Myq6H9zCDxZbDDO/qW5k/hl6Ea1uG3P9cuxIQ4Q723 I/9z0t5l9eIupPhGLfr+6kkTJs7l7mEZPAgvm4ZKz/mmcfjxi0n6r9PQ5eaQCit7xMVt 5f1x8kIqFRuJFTjIEQ/SXU2SI+GvRENHyaGdSjthUsCuQVELOzf5m6TTLPPL37OvPhF0 xbK9tSDxhCqddO2ifM0kZjtgZwczEuH0wr/dPdLeQN+p+Tkvdq3g5YmeyB+51rpDxp4K mrSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Q8PYa+hzhyaXM2zhhaOaZAWlrRm4/hVUI6gNjdoah80=; b=q31Jf1v9IZHShucVTbACCBc2PAVAoOZ+xp0q1ARr1e+oLD06/h5ppULOL9gFL7LNUB +PoCHcjWqoAG0PazOwYklAb+l3LhtAJ7eYxFCUMSvKhSB3pN5fJwhlt62e8EZ3YwjxY3 SySdeBFvKUbyYLm7QWtlXZ9bLpsDcqHzaM9IHtUPWxZVIycvKPVMNVHUR5SkRFxj3pdm U5noZHFvHktW6FQMviP/H9K8R/yjdHY1ZEO6VFC6dgENBpXd4vhY+exctKSfzJMYL+r8 yGvZZifpczcEgz3CMvar/qBv4qMWeXe+Ot59i2WHsSVajE018tnNhPRtBjb/hjAa3nA8 thdA== X-Gm-Message-State: AFqh2kqaOIbZwudL20aCs1V/7r5ufkJfazIHlYhwTYLm8TKJmLq+66Kd rd77NNYa66V49Eqno8ynWTS7vTlTaP092eo01s6kOQ== X-Received: by 2002:a05:6a21:e302:b0:a3:d6:8795 with SMTP id cb2-20020a056a21e30200b000a300d68795mr2068561pzc.17.1671615359286; Wed, 21 Dec 2022 01:35:59 -0800 (PST) Received: from tyrell.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id t76-20020a63784f000000b0046fe244ed6esm9640114pgc.23.2022.12.21.01.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 01:35:58 -0800 (PST) From: Shunsuke Mie To: "Michael S. Tsirkin" Cc: Jason Wang , Shunsuke Mie , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stefano Garzarella , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v2] tools/virtio: fix the vringh test for virtio ring changes Date: Wed, 21 Dec 2022 18:35:50 +0900 Message-Id: <20221221093550.3308698-1-mie@igel.co.jp> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the build caused by missing kmsan_handle_dma() and is_power_of_2() that are used in drivers/virtio/virtio_ring.c. Signed-off-by: Shunsuke Mie --- Changes in v2: * Remove a file, tools/virtio/linux/log2.h * Correct a include guard of tools/virtio/linux/bug.h * Move BUILD_BUG_ON() definition into tools/virtio/linux/build_bug.h --- --- tools/virtio/linux/bug.h | 8 +++----- tools/virtio/linux/build_bug.h | 7 +++++++ tools/virtio/linux/cpumask.h | 7 +++++++ tools/virtio/linux/gfp.h | 7 +++++++ tools/virtio/linux/kernel.h | 1 + tools/virtio/linux/kmsan.h | 12 ++++++++++++ tools/virtio/linux/scatterlist.h | 1 + tools/virtio/linux/topology.h | 7 +++++++ 8 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 tools/virtio/linux/build_bug.h create mode 100644 tools/virtio/linux/cpumask.h create mode 100644 tools/virtio/linux/gfp.h create mode 100644 tools/virtio/linux/kmsan.h create mode 100644 tools/virtio/linux/topology.h diff --git a/tools/virtio/linux/bug.h b/tools/virtio/linux/bug.h index 813baf13f62a..51a919083d9b 100644 --- a/tools/virtio/linux/bug.h +++ b/tools/virtio/linux/bug.h @@ -1,13 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#ifndef BUG_H -#define BUG_H +#ifndef _LINUX_BUG_H +#define _LINUX_BUG_H #include #define BUG_ON(__BUG_ON_cond) assert(!(__BUG_ON_cond)) -#define BUILD_BUG_ON(x) - #define BUG() abort() -#endif /* BUG_H */ +#endif /* _LINUX_BUG_H */ diff --git a/tools/virtio/linux/build_bug.h b/tools/virtio/linux/build_bug.h new file mode 100644 index 000000000000..cdbb75e28a60 --- /dev/null +++ b/tools/virtio/linux/build_bug.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_BUILD_BUG_H +#define _LINUX_BUILD_BUG_H + +#define BUILD_BUG_ON(x) + +#endif /* _LINUX_BUILD_BUG_H */ diff --git a/tools/virtio/linux/cpumask.h b/tools/virtio/linux/cpumask.h new file mode 100644 index 000000000000..307da69d6b26 --- /dev/null +++ b/tools/virtio/linux/cpumask.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CPUMASK_H +#define _LINUX_CPUMASK_H + +#include + +#endif /* _LINUX_CPUMASK_H */ diff --git a/tools/virtio/linux/gfp.h b/tools/virtio/linux/gfp.h new file mode 100644 index 000000000000..43d146f236f1 --- /dev/null +++ b/tools/virtio/linux/gfp.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LINUX_GFP_H +#define __LINUX_GFP_H + +#include + +#endif diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 21593bf97755..8b877167933d 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/tools/virtio/linux/kmsan.h b/tools/virtio/linux/kmsan.h new file mode 100644 index 000000000000..272b5aa285d5 --- /dev/null +++ b/tools/virtio/linux/kmsan.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_KMSAN_H +#define _LINUX_KMSAN_H + +#include + +inline void kmsan_handle_dma(struct page *page, size_t offset, size_t size, + enum dma_data_direction dir) +{ +} + +#endif /* _LINUX_KMSAN_H */ diff --git a/tools/virtio/linux/scatterlist.h b/tools/virtio/linux/scatterlist.h index 369ee308b668..74d9e1825748 100644 --- a/tools/virtio/linux/scatterlist.h +++ b/tools/virtio/linux/scatterlist.h @@ -2,6 +2,7 @@ #ifndef SCATTERLIST_H #define SCATTERLIST_H #include +#include struct scatterlist { unsigned long page_link; diff --git a/tools/virtio/linux/topology.h b/tools/virtio/linux/topology.h new file mode 100644 index 000000000000..910794afb993 --- /dev/null +++ b/tools/virtio/linux/topology.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_TOPOLOGY_H +#define _LINUX_TOPOLOGY_H + +#include + +#endif /* _LINUX_TOPOLOGY_H */ -- 2.25.1