Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5366285rwj; Wed, 21 Dec 2022 01:26:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXsUOJUNnptDYUV9PXtlY6UyaAJ7/D5SY+n9lgA4YH2NIwfJlV1xig8acr+Yp0+/skHa4gUF X-Received: by 2002:a05:6a21:e20d:b0:af:b16b:eeb4 with SMTP id by13-20020a056a21e20d00b000afb16beeb4mr1182076pzc.26.1671614785085; Wed, 21 Dec 2022 01:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671614785; cv=none; d=google.com; s=arc-20160816; b=ZnegRkyvqEnWhOPl59PoAjfMt7tstDyCXjfq8P5DMu5fv/s0PAwFH54p2wFeHrF4Ef 02AdayHawdru3LP7I+MnWfnzvEK6BKNupxBEuzGq4ijPwLpP2x4L9FWjhBf+n6eYlySx f3SsE6fOwNkzpv2IHGyr87DUtM4Gyh5RxtAfTeD3Vo3dIyA6yJN2LjqQueaCiYHssJrD DhgK26/beZs5nZMTLsYXWuEaJQzevxSkB8WLa34LRqiQzoLy604dJb7pemADAK/RMtki ztAOe/AGEZgHc4AnDIwN8WGVa2AxcXzgK9Wiq03sgnURfpuFHXO6OBVRlVXX50ugkTqo DK0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2KUDYCSoD2AR1pNrDgSkwFfCRcQklBfsXuQ70QZWMgM=; b=0PI+MVWp6DWcizVxUju9LoERaTQt/s+mGMGx4rZAtWcIIBf3Xyuy01zhfu8DREGi9C 6ZcbOFL1TuGbBnWrDFmh27N+OVHmGZXzzUwuUqEapmBdHjJOsZO52DbU0ZFZKyYv1qJi MGHdLEjT3AFXUY6JPJD/O9rwZA9czUjCEYV9rKRJcvfxF60Z5/nAo4jllDMr8dHRZKJj cbuHF9vJ1TStEZ+WlYujATVCvSlMg0ZzVMv8rz+R027DC62qu9A45IDYqHk3m45eLZIo Ykb7tZ6+Z/eWnGiPG/562IhQVttik2ItZPXC9DjtO+LALvb7XCtUAmdqcEQOE+Dlkk56 BSiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=pcEogXXL; 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 w200-20020a627bd1000000b005726e8b1cedsi13749095pfc.345.2022.12.21.01.26.16; Wed, 21 Dec 2022 01:26:25 -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=pcEogXXL; 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 S234495AbiLUJP5 (ORCPT + 69 others); Wed, 21 Dec 2022 04:15:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234503AbiLUJPv (ORCPT ); Wed, 21 Dec 2022 04:15:51 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C631BDF for ; Wed, 21 Dec 2022 01:15:46 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 82so10061194pgc.0 for ; Wed, 21 Dec 2022 01:15:46 -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:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=2KUDYCSoD2AR1pNrDgSkwFfCRcQklBfsXuQ70QZWMgM=; b=pcEogXXL3NvRgooEZ7uSHA4fA28PfLFqpltbhCyG90WADJ11BPsxPB2CdOrXq2i5GZ B5DBBXc0jrXe+hxGfzaR5oP9cXi4afslu/fFdh535pjU8W/TwkFHUXE+AAe7suUZ7d/o VAqRV/3Ji+aqB2xPA+Dhh1zgSRML4rokZSIssSIbLe9AEG7jyxQZqmz+34bmJafsmx62 oQsVMtGVADyX9oevjjKcYjHlRvLlU+P9cVfaf4yjZ+w67IZEY0a0/hNx7vJjTMEaV9M9 SO7JR3SSX4S10sC42FifyFZFC13Ad62hv9VH8qKFTzloZADZuP3BFXHkIr+AFRBJjlJj tA+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2KUDYCSoD2AR1pNrDgSkwFfCRcQklBfsXuQ70QZWMgM=; b=Eqh4E40LUEcBy1+YaWf9w/CdJa9hICLtLp0QGzIQjUy9/rDInaOQCbwcxOyGpr0Owp Io6iaTqAIRndkILs4WiCuhJ8E4TtuvlRhgnsFKvgWeOF9gFdLbiJO1OjOyEKViEDdsJg 3I2olZeL/SCJOXFM+5LyzHvj0B87uAU49XpYxWEOqIDnhEPxzhwhY2CgnVzC3L8ixBor A56jC2LI4uZoecetz4KvSIbhxkiIV4d0QYEao2rgwi6DkwSeCuQ6TNHFJ8ZL3Yci8NlE mQ6Gu3cFpRDS9JB/7f8AKhc/IjTUclwvaZZmis7hRhtAlpS6c75zw6encWtbuFPcGjrv 76AA== X-Gm-Message-State: AFqh2kqAug9vpeJFxn7Vqc0tYsi51fGnGdW88dFq2MKGFBmjlvzeuBNO GNxWcDKPxcBS+OYY8pAsPJWaQA== X-Received: by 2002:aa7:983a:0:b0:57e:827c:901b with SMTP id q26-20020aa7983a000000b0057e827c901bmr838661pfl.34.1671614146174; Wed, 21 Dec 2022 01:15:46 -0800 (PST) Received: from [10.16.128.218] (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id l187-20020a6225c4000000b0057621a437d7sm10010694pfl.116.2022.12.21.01.15.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Dec 2022 01:15:45 -0800 (PST) Message-ID: Date: Wed, 21 Dec 2022 18:15:43 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] tools/virtio: fix the vringh test for virtio ring changes Content-Language: en-US To: Stefano Garzarella Cc: "Michael S. Tsirkin" , Jason Wang , =?UTF-8?Q?Eugenio_P=c3=a9rez?= , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org References: <20221221075506.3291148-1-mie@igel.co.jp> <20221221091302.mxnmrnqvn7oua7nf@sgarzare-redhat> From: Shunsuke Mie In-Reply-To: <20221221091302.mxnmrnqvn7oua7nf@sgarzare-redhat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,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 Thank you for your quick response. On 2022/12/21 18:13, Stefano Garzarella wrote: > On Wed, Dec 21, 2022 at 04:55:06PM +0900, Shunsuke Mie wrote: >> 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 >> --- >> 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/log2.h     | 11 +++++++++++ >> tools/virtio/linux/topology.h |  7 +++++++ >> 6 files changed, 45 insertions(+) >> 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/log2.h >> create mode 100644 tools/virtio/linux/topology.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/log2.h b/tools/virtio/linux/log2.h >> new file mode 100644 >> index 000000000000..aa67bb21d8e2 >> --- /dev/null >> +++ b/tools/virtio/linux/log2.h >> @@ -0,0 +1,11 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> + >> +#ifndef _LINUX_LOG2_H >> +#define _LINUX_LOG2_H >> + >> +inline bool is_power_of_2(unsigned long n) >> +{ >> +    return true; >> +} > > is_power_of_2 seems defined in tools/include/linux/log2.h so > `#include ` in tools/virtio/linux/kernel.h should be > enough. > > If that's not the case, however, I think we should return true here only > if n is really power of 2. I'm going to check and try those. > Thanks, > Stefano > Best, Shunsuke