@@ -803,8 +803,8 @@ ETEXI
{
.name = "iommu",
- .args_type = "",
- .params = "",
+ .args_type = "clear_stats:-c",
+ .params = "[-c]",
.help = "Display system IOMMU information",
.cmd = hmp_info_iommu,
},
@@ -3008,6 +3008,7 @@ static void vtd_info_dump(X86IOMMUState *x86_iommu, Monitor *mon,
const QDict *qdict)
{
IntelIOMMUState *s = INTEL_IOMMU_DEVICE(x86_iommu);
+ bool clear_stats = qdict_get_try_bool(qdict, "clear_stats", false);
DUMP("Version: %d\n", 1);
DUMP("Cap: 0x%"PRIx64"\n", s->cap);
@@ -3047,6 +3048,10 @@ static void vtd_info_dump(X86IOMMUState *x86_iommu, Monitor *mon,
DUMP("Misc: next_frr=%d, context_gen=%d, buggy_eim=%d\n",
s->next_frcd_reg, s->context_cache_gen, s->buggy_eim);
DUMP(" iotlb_size=%d\n", g_hash_table_size(s->iotlb));
+
+ if (clear_stats) {
+ vtd_reset_stats(s);
+ }
}
#undef DUMP
New parameter "-c" for it to clear statistics. Other platforms can selectively support this (though none yet). Signed-off-by: Peter Xu <peterx@redhat.com> --- hmp-commands-info.hx | 4 ++-- hw/i386/intel_iommu.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-)