Skip to content

Commit

Permalink
tools/virtio: fix the vringh test for virtio ring changes
Browse files Browse the repository at this point in the history
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>
Message-Id: <20230110034310.779744-1-mie@igel.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Shunsuke Mie authored and Michael S. Tsirkin committed Jan 27, 2023
1 parent 9526f9a commit 3f7b75a
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tools/virtio/linux/bug.h
Original file line number Diff line number Diff line change
@@ -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 <asm/bug.h>

#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 */
7 changes: 7 additions & 0 deletions tools/virtio/linux/build_bug.h
Original file line number Diff line number Diff line change
@@ -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 */
7 changes: 7 additions & 0 deletions tools/virtio/linux/cpumask.h
Original file line number Diff line number Diff line change
@@ -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 */
7 changes: 7 additions & 0 deletions tools/virtio/linux/gfp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_GFP_H
#define __LINUX_GFP_H

#include <linux/topology.h>

#endif
1 change: 1 addition & 0 deletions tools/virtio/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 12 additions & 0 deletions tools/virtio/linux/kmsan.h
Original file line number Diff line number Diff line change
@@ -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 */
1 change: 1 addition & 0 deletions tools/virtio/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef SCATTERLIST_H
#define SCATTERLIST_H
#include <linux/kernel.h>
#include <linux/bug.h>

struct scatterlist {
unsigned long page_link;
Expand Down
7 changes: 7 additions & 0 deletions tools/virtio/linux/topology.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_TOPOLOGY_H
#define _LINUX_TOPOLOGY_H

#include <linux/cpumask.h>

#endif /* _LINUX_TOPOLOGY_H */

0 comments on commit 3f7b75a

Please sign in to comment.