Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47a4c49a authored by Halil Pasic's avatar Halil Pasic Committed by Michael S. Tsirkin
Browse files

tools/virtio/ringtest: tweaks for s390



Make ringtest work on s390 too.

Signed-off-by: default avatarHalil Pasic <pasic@linux.vnet.ibm.com>
Acked-by: default avatarSascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
parent 21f5eda9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -26,6 +26,16 @@ static inline void wait_cycles(unsigned long long cycles)
#define VMEXIT_CYCLES 500
#define VMENTRY_CYCLES 500

#elif defined(__s390x__)
static inline void wait_cycles(unsigned long long cycles)
{
	asm volatile("0: brctg %0,0b" : : "d" (cycles));
}

/* tweak me */
#define VMEXIT_CYCLES 200
#define VMENTRY_CYCLES 200

#else
static inline void wait_cycles(unsigned long long cycles)
{
@@ -81,6 +91,8 @@ extern unsigned ring_size;
/* Is there a portable way to do this? */
#if defined(__x86_64__) || defined(__i386__)
#define cpu_relax() asm ("rep; nop" ::: "memory")
#elif defined(__s390x__)
#define cpu_relax() barrier()
#else
#define cpu_relax() assert(0)
#endif