All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [RFC PATCH 7/8] monitor: Restrict CPU I/O instructions
Date: Mon, 15 Mar 2021 00:29:12 +0100	[thread overview]
Message-ID: <20210314232913.2607360-8-f4bug@amsat.org> (raw)
In-Reply-To: <20210314232913.2607360-1-f4bug@amsat.org>

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



  parent reply	other threads:[~2021-03-14 23:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 23:29 [RFC PATCH 0/8] softmmu: Restrict CPU I/O instructions Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 1/8] softmmu/physmem: Rename io_mem_unassigned -> unassigned_mr Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 2/8] exec: Extract CPU I/O instructions to "cpu-io.h" Philippe Mathieu-Daudé
2021-03-14 23:29   ` Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 3/8] target: Introduce TARGET_HAS_IOPORT Philippe Mathieu-Daudé
2021-03-14 23:29 ` [RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions Philippe Mathieu-Daudé
2021-03-15  1:27   ` Alexander Bulekov
2021-03-15  5:14   ` Thomas Huth
2021-03-15 10:13     ` Philippe Mathieu-Daudé
2021-03-17 17:47     ` Paolo Bonzini
2021-03-14 23:29 ` [RFC PATCH 5/8] qtest/libqos: " Philippe Mathieu-Daudé
2021-03-16 15:37   ` Laszlo Ersek
2021-03-16 15:43     ` Richard Henderson
2021-03-16 15:55       ` Philippe Mathieu-Daudé
2021-03-17 15:59         ` Laszlo Ersek
2021-03-17 16:24           ` Philippe Mathieu-Daudé
2021-03-17 17:17             ` Laszlo Ersek
2021-03-14 23:29 ` [RFC PATCH 6/8] qtest: " Philippe Mathieu-Daudé
2021-03-14 23:29 ` Philippe Mathieu-Daudé [this message]
2021-03-14 23:29 ` [RFC PATCH 8/8] softmmu: " Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210314232913.2607360-8-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=armbru@redhat.com \
    --cc=cfontana@suse.de \
    --cc=dgilbert@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.