tools/virtio: fix the vringh test for virtio ring changes

[ Upstream commit 3f7b75abf41cc4143aa295f62acbb060a012868d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Shunsuke Mie 2023-01-10 12:43:10 +09:00 committed by Greg Kroah-Hartman
parent 6644685f79
commit ec54c946b4
8 changed files with 45 additions and 5 deletions

View File

@ -1,11 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef BUG_H #ifndef _LINUX_BUG_H
#define BUG_H #define _LINUX_BUG_H
#define BUG_ON(__BUG_ON_cond) assert(!(__BUG_ON_cond)) #define BUG_ON(__BUG_ON_cond) assert(!(__BUG_ON_cond))
#define BUILD_BUG_ON(x)
#define BUG() abort() #define BUG() abort()
#endif /* BUG_H */ #endif /* _LINUX_BUG_H */

View File

@ -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 */

View File

@ -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
tools/virtio/linux/gfp.h Normal file
View File

@ -0,0 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_GFP_H
#define __LINUX_GFP_H
#include <linux/topology.h>
#endif

View File

@ -10,6 +10,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/log2.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/printk.h> #include <linux/printk.h>
#include <linux/bug.h> #include <linux/bug.h>

View File

@ -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 */

View File

@ -2,6 +2,7 @@
#ifndef SCATTERLIST_H #ifndef SCATTERLIST_H
#define SCATTERLIST_H #define SCATTERLIST_H
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/bug.h>
struct scatterlist { struct scatterlist {
unsigned long page_link; unsigned long page_link;

View File

@ -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 */