linux-stable/tools/virtio
Rong Tao 8ec977a9d3 tools/virtio: Fix arm64 ringtest compilation error
[ Upstream commit 57380fd124 ]

Add cpu_relax() for arm64 instead of directly assert(), and add assert.h
header file. Also, add smp_wmb and smp_mb for arm64.

Compilation error as follows, avoid __always_inline undefined.

    $ make
    cc -Wall -pthread -O2 -ggdb -flto -fwhole-program -c -o ring.o ring.c
    In file included from ring.c:10:
    main.h: In function ‘busy_wait’:
    main.h:99:21: warning: implicit declaration of function ‘assert’
    [-Wimplicit-function-declaration]
    99 | #define cpu_relax() assert(0)
        |                     ^~~~~~
    main.h:107:17: note: in expansion of macro ‘cpu_relax’
    107 |                 cpu_relax();
        |                 ^~~~~~~~~
    main.h:12:1: note: ‘assert’ is defined in header ‘<assert.h>’; did you
    forget to ‘#include <assert.h>’?
    11 | #include <stdbool.h>
    +++ |+#include <assert.h>
    12 |
    main.h: At top level:
    main.h:143:23: error: expected ‘;’ before ‘void’
    143 | static __always_inline
        |                       ^
        |                       ;
    144 | void __read_once_size(const volatile void *p, void *res, int
    size)
        | ~~~~
    main.h:158:23: error: expected ‘;’ before ‘void’
    158 | static __always_inline void __write_once_size(volatile void *p,
    void *res, int size)
        |                       ^~~~~
        |                       ;
    make: *** [<builtin>: ring.o] Error 1

Signed-off-by: Rong Tao <rongtao@cestc.cn>
Message-Id: <tencent_F53E159DD7925174445D830DA19FACF44B07@qq.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 11:14:23 +02:00
..
asm tools/virtio: add barrier for aarch64 2020-12-18 16:14:30 -05:00
crypto tools/virtio: more stubs 2019-10-11 09:27:27 -04:00
generated virtio/test: fix up after IOTLB changes 2020-04-16 18:31:08 -04:00
linux tools/virtio: fix the vringh test for virtio ring changes 2023-01-27 06:18:41 -05:00
ringtest tools/virtio: Fix arm64 ringtest compilation error 2023-06-28 11:14:23 +02:00
uapi/linux License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vhost_test treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
virtio-trace tools/virtio: fix typo in README instructions 2023-04-04 11:01:58 -04:00
xen tools/virtio: xen stub 2019-10-13 09:38:27 -04:00
.gitignore tools/virtio: Ignore virtio-trace/trace-agent 2023-03-13 02:29:12 -04:00
Makefile tools/virtio: enable to build with retpoline 2023-02-20 19:26:59 -05:00
virtio_test.c tools/virtio: Variable type completion 2022-12-28 05:28:10 -05:00
vringh_test.c tools/virtio: initialize spinlocks in vring_test.c 2022-12-28 05:09:47 -05:00