[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 6/8] qtest: Restrict CPU I/O instructions
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 6/8] qtest: Restrict CPU I/O instructions |
Date: |
Mon, 15 Mar 2021 00:29:11 +0100 |
Restrict CPU I/O instructions to architectures providing
I/O bus.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
softmmu/qtest.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index ff253068657..51fe256297a 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -31,7 +31,9 @@
#ifdef CONFIG_PSERIES
#include "hw/ppc/spapr_rtas.h"
#endif
+#ifdef TARGET_HAS_IOPORT
#include "exec/cpu-io.h"
+#endif
#define MAX_IRQ 256
@@ -462,7 +464,9 @@ static void qtest_process_command(CharBackend *chr, gchar
**words)
qemu_set_irq(irq, level);
qtest_send_prefix(chr);
qtest_send(chr, "OK\n");
- } else if (strcmp(words[0], "outb") == 0 ||
+ }
+#ifdef TARGET_HAS_IOPORT
+ else if (strcmp(words[0], "outb") == 0 ||
strcmp(words[0], "outw") == 0 ||
strcmp(words[0], "outl") == 0) {
unsigned long addr;
@@ -506,7 +510,9 @@ static void qtest_process_command(CharBackend *chr, gchar
**words)
}
qtest_send_prefix(chr);
qtest_sendf(chr, "OK 0x%04x\n", value);
- } else if (strcmp(words[0], "writeb") == 0 ||
+ }
+#endif /* TARGET_HAS_IOPORT */
+ else if (strcmp(words[0], "writeb") == 0 ||
strcmp(words[0], "writew") == 0 ||
strcmp(words[0], "writel") == 0 ||
strcmp(words[0], "writeq") == 0) {
--
2.26.2
- Re: [RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions, (continued)
- [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14
- Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Laszlo Ersek, 2021/03/16
- Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Richard Henderson, 2021/03/16
- Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/16
- Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Laszlo Ersek, 2021/03/17
- Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/17
- Re: [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Laszlo Ersek, 2021/03/17
[RFC PATCH 6/8] qtest: Restrict CPU I/O instructions,
Philippe Mathieu-Daudé <=
[RFC PATCH 7/8] monitor: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14
[RFC PATCH 8/8] softmmu: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14