@@ -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 = "",
@@ -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);
+}
@@ -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
new file mode 100644
@@ -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
@@ -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
new file mode 100644
@@ -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");
+}
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