Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/virtio/ringtest: tweaks for s390

Make ringtest work on s390 too.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Acked-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

authored by

Halil Pasic and committed by
Michael S. Tsirkin
47a4c49a 21f5eda9

+12
+12
tools/virtio/ringtest/main.h
··· 26 26 #define VMEXIT_CYCLES 500 27 27 #define VMENTRY_CYCLES 500 28 28 29 + #elif defined(__s390x__) 30 + static inline void wait_cycles(unsigned long long cycles) 31 + { 32 + asm volatile("0: brctg %0,0b" : : "d" (cycles)); 33 + } 34 + 35 + /* tweak me */ 36 + #define VMEXIT_CYCLES 200 37 + #define VMENTRY_CYCLES 200 38 + 29 39 #else 30 40 static inline void wait_cycles(unsigned long long cycles) 31 41 { ··· 91 81 /* Is there a portable way to do this? */ 92 82 #if defined(__x86_64__) || defined(__i386__) 93 83 #define cpu_relax() asm ("rep; nop" ::: "memory") 84 + #elif defined(__s390x__) 85 + #define cpu_relax() barrier() 94 86 #else 95 87 #define cpu_relax() assert(0) 96 88 #endif