[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 7/8] monitor: Restrict CPU I/O instructions
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 7/8] monitor: Restrict CPU I/O instructions |
Date: |
Mon, 15 Mar 2021 00:29:12 +0100 |
Restrict CPU I/O instructions to architectures providing
I/O bus.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
monitor/misc.c | 4 ++++
hmp-commands.hx | 2 ++
2 files changed, 6 insertions(+)
diff --git a/monitor/misc.c b/monitor/misc.c
index d40c7d5afc0..b59f11433eb 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -77,7 +77,9 @@
#include "qapi/qmp-event.h"
#include "sysemu/cpus.h"
#include "qemu/cutils.h"
+#ifdef TARGET_HAS_IOPORT
#include "exec/cpu-io.h"
+#endif
#if defined(TARGET_S390X)
#include "hw/s390x/storage-keys.h"
#include "hw/s390x/storage-attributes.h"
@@ -884,6 +886,7 @@ static void hmp_mouse_button(Monitor *mon, const QDict
*qdict)
mouse_button_state = button_state;
}
+#ifdef TARGET_HAS_IOPORT
static void hmp_ioport_read(Monitor *mon, const QDict *qdict)
{
int size = qdict_get_int(qdict, "size");
@@ -939,6 +942,7 @@ static void hmp_ioport_write(Monitor *mon, const QDict
*qdict)
break;
}
}
+#endif /* TARGET_HAS_IOPORT */
static void hmp_boot_set(Monitor *mon, const QDict *qdict)
{
diff --git a/hmp-commands.hx b/hmp-commands.hx
index d4001f9c5dc..cedcedf7d8d 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -561,6 +561,7 @@ SRST
used.
ERST
+#ifdef TARGET_HAS_IOPORT
{
.name = "i",
.args_type = "fmt:/,addr:i,index:i.",
@@ -586,6 +587,7 @@ SRST
``o/``\ *fmt* *addr* *val*
Write to I/O port.
ERST
+#endif /* TARGET_HAS_IOPORT */
{
.name = "sendkey",
--
2.26.2
- [RFC PATCH 0/8] softmmu: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 1/8] softmmu/physmem: Rename io_mem_unassigned -> unassigned_mr, Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 2/8] exec: Extract CPU I/O instructions to "cpu-io.h", Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 3/8] target: Introduce TARGET_HAS_IOPORT, Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 6/8] qtest: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14
- [RFC PATCH 7/8] monitor: Restrict CPU I/O instructions,
Philippe Mathieu-Daudé <=
- [RFC PATCH 8/8] softmmu: Restrict CPU I/O instructions, Philippe Mathieu-Daudé, 2021/03/14