mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shunsuke Mie <mie@igel.co.jp>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] tools/virtio: fix the vringh test for virtio ring changes
Date: Wed, 21 Dec 2022 18:15:43 +0900	[thread overview]
Message-ID: <a8ef5b8f-2dc2-808e-1f24-0e3de09b5356@igel.co.jp> (raw)
In-Reply-To: <20221221091302.mxnmrnqvn7oua7nf@sgarzare-redhat>

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 <mie@igel.co.jp>
>> ---
>> 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 <linux/kernel.h>
>> +
>> +#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 <linux/topology.h>
>> +
>> +#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 <stdarg.h>
>>
>> #include <linux/compiler.h>
>> +#include <linux/log2.h>
>> #include <linux/types.h>
>> #include <linux/overflow.h>
>> #include <linux/list.h>
>> 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 <linux/gfp.h>
>> +
>> +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 <linux/log2.h>` 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


      reply	other threads:[~2022-12-21  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  7:55 Shunsuke Mie
2022-12-21  9:13 ` Stefano Garzarella
2022-12-21  9:15   ` Shunsuke Mie [this message]

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=a8ef5b8f-2dc2-808e-1f24-0e3de09b5356@igel.co.jp \
    --to=mie@igel.co.jp \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --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

all inboxes | Powered by JetHome®