[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/49] vhost-user-test: support VHOST_USER_PROTOCOL_F
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 11/49] vhost-user-test: support VHOST_USER_PROTOCOL_F_CROSS_ENDIAN |
Date: |
Mon, 21 Jan 2019 19:05:42 +0100 |
This will be useful to run the qtest for ppc64 targets on (for example)
x86_64 hosts.
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
---
tests/vhost-user-test.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 409157d..e36f3e6 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -54,6 +54,7 @@
#define VHOST_USER_F_PROTOCOL_FEATURES 30
#define VHOST_USER_PROTOCOL_F_MQ 0
#define VHOST_USER_PROTOCOL_F_LOG_SHMFD 1
+#define VHOST_USER_PROTOCOL_F_CROSS_ENDIAN 6
#define VHOST_LOG_PAGE 0x1000
@@ -254,7 +255,7 @@ static void wait_for_fds(TestServer *s)
static void read_guest_mem_server(TestServer *s)
{
- uint32_t *guest_mem;
+ uint8_t *guest_mem;
int i, j;
size_t size;
@@ -281,8 +282,8 @@ static void read_guest_mem_server(TestServer *s)
g_assert(guest_mem != MAP_FAILED);
guest_mem += (s->memory.regions[i].mmap_offset / sizeof(*guest_mem));
- for (j = 0; j < 256; j++) {
- uint32_t a = readl(s->memory.regions[i].guest_phys_addr + j*4);
+ for (j = 0; j < 1024; j++) {
+ uint32_t a = readb(s->memory.regions[i].guest_phys_addr + j);
uint32_t b = guest_mem[j];
g_assert_cmpint(a, ==, b);
@@ -370,6 +371,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int
size)
msg.flags |= VHOST_USER_REPLY_MASK;
msg.size = sizeof(m.payload.u64);
msg.payload.u64 = 1 << VHOST_USER_PROTOCOL_F_LOG_SHMFD;
+ msg.payload.u64 |= 1 << VHOST_USER_PROTOCOL_F_CROSS_ENDIAN;
if (s->queues > 1) {
msg.payload.u64 |= 1 << VHOST_USER_PROTOCOL_F_MQ;
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/49] Misc patches for 2019-01-21, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 06/49] vhost-net: compile it on all targets that have virtio-net., Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 04/49] vhost-net-user: add stubs for when no virtio-net device is present, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 08/49] vhost-user-test: use g_cond_broadcast, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 09/49] vhost-user-test: signal data_cond when s->rings changes, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 07/49] vhost-net: revamp configure logic, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 10/49] vhost-user: support cross-endian vnet headers, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 01/49] scripts/update-linux-headers.sh: adjust for Linux 4.21-rc1 (or 5.0-rc1), Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 11/49] vhost-user-test: support VHOST_USER_PROTOCOL_F_CROSS_ENDIAN,
Paolo Bonzini <=
- [Qemu-devel] [PULL 17/49] tap: flush STDOUT on newline, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 19/49] cpu-exec: add assert_no_pages_locked() after longjmp, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 14/49] vhost-user-test: create a main loop per TestServer, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 20/49] cpu-exec: reset BQL after longjmp in cpu_exec_step_atomic, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 12/49] vhost-user-test: skip if there is no memory at address 0, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 03/49] vhost-net: move stubs to a separate file, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 13/49] vhost-user-test: reduce usage of global_qtest, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 05/49] vhost: restrict Linux dependency to kernel vhost, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 15/49] vhost-user-test: small changes to init_hugepagefs, Paolo Bonzini, 2019/01/21
- [Qemu-devel] [PULL 16/49] vhost-user-test: create a temporary directory per TestServer, Paolo Bonzini, 2019/01/21