From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
peterx@redhat.com, Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PATCH 2/8] hmp: add info iommu
Date: Tue, 27 Jun 2017 17:03:33 +0800 [thread overview]
Message-ID: <1498554219-4942-3-git-send-email-peterx@redhat.com> (raw)
In-Reply-To: <1498554219-4942-1-git-send-email-peterx@redhat.com>
Introducing a new HMP interface "info iommu" to dump IOMMU information.
This command will be only used for developers' debugging purpose, and no
possible use for users. So QMP interface will not be implemented.
This patch only implements the stub one. We can provide arch-dependent
status dump in the future.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
hmp-commands-info.hx | 14 ++++++++++++++
hmp.c | 6 ++++++
hmp.h | 1 +
include/hw/iommu.h | 9 +++++++++
stubs/Makefile.objs | 1 +
stubs/iommu.c | 9 +++++++++
6 files changed, 40 insertions(+)
create mode 100644 include/hw/iommu.h
create mode 100644 stubs/iommu.c
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index ae16901..a39243d 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -802,6 +802,20 @@ Dump all the ramblocks of the system.
ETEXI
{
+ .name = "iommu",
+ .args_type = "",
+ .params = "",
+ .help = "Display system IOMMU information",
+ .cmd = hmp_info_iommu,
+ },
+
+STEXI
+@item info ramblock
+@findex ramblock
+Dump all the ramblocks of the system.
+ETEXI
+
+ {
.name = "hotpluggable-cpus",
.args_type = "",
.params = "",
diff --git a/hmp.c b/hmp.c
index 8c72c58..68994af 100644
--- a/hmp.c
+++ b/hmp.c
@@ -42,6 +42,7 @@
#include "qemu/error-report.h"
#include "exec/ramlist.h"
#include "hw/intc/intc.h"
+#include "hw/iommu.h"
#include "migration/snapshot.h"
#ifdef CONFIG_SPICE
@@ -2817,3 +2818,8 @@ void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict)
hmp_handle_error(mon, &err);
qapi_free_GuidInfo(info);
}
+
+void hmp_info_iommu(Monitor *mon, const QDict *qdict)
+{
+ arch_iommu_info(mon, qdict);
+}
diff --git a/hmp.h b/hmp.h
index d8b94ce..ed01c49 100644
--- a/hmp.h
+++ b/hmp.h
@@ -143,5 +143,6 @@ void hmp_info_dump(Monitor *mon, const QDict *qdict);
void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
+void hmp_info_iommu(Monitor *mon, const QDict *qdict);
#endif
diff --git a/include/hw/iommu.h b/include/hw/iommu.h
new file mode 100644
index 0000000..5201a8d
--- /dev/null
+++ b/include/hw/iommu.h
@@ -0,0 +1,9 @@
+#ifndef __HW_IOMMU_H__
+#define __HW_IOMMU_H__
+
+#include "qemu/typedefs.h"
+#include "qapi/qmp/qdict.h"
+
+void arch_iommu_info(Monitor *mon, const QDict *qdict);
+
+#endif
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index f5b47bf..dfd5569 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -39,3 +39,4 @@ stub-obj-y += pc_madt_cpu_entry.o
stub-obj-y += vmgenid.o
stub-obj-y += xen-common.o
stub-obj-y += xen-hvm.o
+stub-obj-y += iommu.o
diff --git a/stubs/iommu.c b/stubs/iommu.c
new file mode 100644
index 0000000..75b4f4c
--- /dev/null
+++ b/stubs/iommu.c
@@ -0,0 +1,9 @@
+#include "qemu/osdep.h"
+#include "monitor/monitor.h"
+#include "hw/iommu.h"
+
+void arch_iommu_info(Monitor *mon, const QDict *qdict)
+{
+ monitor_printf(mon, "This command is not supported "
+ "on this platform.\n");
+}
--
2.7.4
next prev parent reply other threads:[~2017-06-27 9:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 9:03 [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools Peter Xu
2017-06-27 9:03 ` [Qemu-devel] [PATCH 1/8] intel_iommu: fix VTD_PAGE_MASK Peter Xu
2017-06-27 9:03 ` Peter Xu [this message]
2017-06-27 9:03 ` [Qemu-devel] [PATCH 3/8] intel_iommu: support "info iommu" Peter Xu
2017-06-27 9:03 ` [Qemu-devel] [PATCH 4/8] intel_iommu: add iotlb/context cache statistics Peter Xu
2017-06-27 9:03 ` [Qemu-devel] [PATCH 5/8] intel_iommu: hmp: allow "-c" for "info iommu" Peter Xu
2017-06-27 9:03 ` [Qemu-devel] [PATCH 6/8] intel_iommu: let iotlb size tunable Peter Xu
2017-06-27 9:03 ` [Qemu-devel] [PATCH 7/8] intel_iommu: use access_flags for iotlb Peter Xu
2017-06-27 9:03 ` [Qemu-devel] [PATCH 8/8] intel_iommu: implement mru list " Peter Xu
2017-06-27 9:22 ` [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools Peter Xu
2017-06-27 14:42 ` Michael S. Tsirkin
2017-06-28 7:03 ` Peter Xu
2017-06-27 16:30 ` no-reply
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=1498554219-4942-3-git-send-email-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).