提交 47a4c49a 编写于 作者: H Halil Pasic 提交者: Michael S. Tsirkin

tools/virtio/ringtest: tweaks for s390

Make ringtest work on s390 too.
Signed-off-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
Acked-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
上级 21f5eda9
...@@ -26,6 +26,16 @@ static inline void wait_cycles(unsigned long long cycles) ...@@ -26,6 +26,16 @@ static inline void wait_cycles(unsigned long long cycles)
#define VMEXIT_CYCLES 500 #define VMEXIT_CYCLES 500
#define VMENTRY_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 #else
static inline void wait_cycles(unsigned long long cycles) static inline void wait_cycles(unsigned long long cycles)
{ {
...@@ -81,6 +91,8 @@ extern unsigned ring_size; ...@@ -81,6 +91,8 @@ extern unsigned ring_size;
/* Is there a portable way to do this? */ /* Is there a portable way to do this? */
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#define cpu_relax() asm ("rep; nop" ::: "memory") #define cpu_relax() asm ("rep; nop" ::: "memory")
#elif defined(__s390x__)
#define cpu_relax() barrier()
#else #else
#define cpu_relax() assert(0) #define cpu_relax() assert(0)
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册