summaryrefslogtreecommitdiffstats
path: root/qtest.c
diff options
context:
space:
mode:
authorPeter Maydell2018-07-06 19:18:08 +0200
committerPeter Maydell2018-07-06 19:18:08 +0200
commit43a473993fd9378bf850dcafa68eb6dee8c300f8 (patch)
treec24e382dbfbbeca0a84f219766ee9a0edd523b2a /qtest.c
parenttests/migration: Skip tests for ppc tcg (diff)
parentcheckpatch: handle token pasting better (diff)
downloadqemu-43a473993fd9378bf850dcafa68eb6dee8c300f8.tar.gz
qemu-43a473993fd9378bf850dcafa68eb6dee8c300f8.tar.xz
qemu-43a473993fd9378bf850dcafa68eb6dee8c300f8.zip
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Bug fixes. # gpg: Signature made Fri 06 Jul 2018 17:40:06 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: checkpatch: handle token pasting better ioapic: remove useless lower bounds check pr-manager-helper: fix memory leak on event qemu-char: check errno together with ret < 0 i386: fix '-cpu ?' output for host cpu type qtest: Use cpu address space instead of system memory pr-helper: Rework socket path handling pr-helper: avoid error on PR IN command with zero request size Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qtest.c')
-rw-r--r--qtest.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/qtest.c b/qtest.c
index cbbfb71114..69b9e9962b 100644
--- a/qtest.c
+++ b/qtest.c
@@ -387,19 +387,23 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
if (words[0][5] == 'b') {
uint8_t data = value;
- cpu_physical_memory_write(addr, &data, 1);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ &data, 1, true);
} else if (words[0][5] == 'w') {
uint16_t data = value;
tswap16s(&data);
- cpu_physical_memory_write(addr, &data, 2);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *) &data, 2, true);
} else if (words[0][5] == 'l') {
uint32_t data = value;
tswap32s(&data);
- cpu_physical_memory_write(addr, &data, 4);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *) &data, 4, true);
} else if (words[0][5] == 'q') {
uint64_t data = value;
tswap64s(&data);
- cpu_physical_memory_write(addr, &data, 8);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *) &data, 8, true);
}
qtest_send_prefix(chr);
qtest_send(chr, "OK\n");
@@ -417,18 +421,22 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
if (words[0][4] == 'b') {
uint8_t data;
- cpu_physical_memory_read(addr, &data, 1);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ &data, 1, false);
value = data;
} else if (words[0][4] == 'w') {
uint16_t data;
- cpu_physical_memory_read(addr, &data, 2);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *) &data, 2, false);
value = tswap16(data);
} else if (words[0][4] == 'l') {
uint32_t data;
- cpu_physical_memory_read(addr, &data, 4);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *) &data, 4, false);
value = tswap32(data);
} else if (words[0][4] == 'q') {
- cpu_physical_memory_read(addr, &value, 8);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *) &value, 8, false);
tswap64s(&value);
}
qtest_send_prefix(chr);
@@ -448,7 +456,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
g_assert(len);
data = g_malloc(len);
- cpu_physical_memory_read(addr, data, len);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, len, false);
enc = g_malloc(2 * len + 1);
for (i = 0; i < len; i++) {
@@ -473,7 +482,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
g_assert(ret == 0);
data = g_malloc(len);
- cpu_physical_memory_read(addr, data, len);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, len, false);
b64_data = g_base64_encode(data, len);
qtest_send_prefix(chr);
qtest_sendf(chr, "OK %s\n", b64_data);
@@ -507,7 +517,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
data[i] = 0;
}
}
- cpu_physical_memory_write(addr, data, len);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, len, true);
g_free(data);
qtest_send_prefix(chr);
@@ -529,7 +540,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
if (len) {
data = g_malloc(len);
memset(data, pattern, len);
- cpu_physical_memory_write(addr, data, len);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, len, true);
g_free(data);
}
@@ -562,7 +574,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
out_len = MIN(out_len, len);
}
- cpu_physical_memory_write(addr, data, out_len);
+ address_space_rw(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
+ data, len, true);
qtest_send_prefix(chr);
qtest_send(chr, "OK\n");