[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/8] intel_iommu: hmp: allow "-c" for "info iommu"
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH 5/8] intel_iommu: hmp: allow "-c" for "info iommu" |
Date: |
Tue, 27 Jun 2017 17:03:36 +0800 |
New parameter "-c" for it to clear statistics. Other platforms can
selectively support this (though none yet).
Signed-off-by: Peter Xu <address@hidden>
---
hmp-commands-info.hx | 4 ++--
hw/i386/intel_iommu.c | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index a39243d..2add941 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -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,
},
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 45d0919..72b39f0 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -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
--
2.7.4
- [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools, Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 1/8] intel_iommu: fix VTD_PAGE_MASK, Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 2/8] hmp: add info iommu, Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 3/8] intel_iommu: support "info iommu", Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 5/8] intel_iommu: hmp: allow "-c" for "info iommu",
Peter Xu <=
- [Qemu-devel] [PATCH 4/8] intel_iommu: add iotlb/context cache statistics, Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 7/8] intel_iommu: use access_flags for iotlb, Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 6/8] intel_iommu: let iotlb size tunable, Peter Xu, 2017/06/27
- [Qemu-devel] [PATCH 8/8] intel_iommu: implement mru list for iotlb, Peter Xu, 2017/06/27
- Re: [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools, Peter Xu, 2017/06/27
- Re: [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools, Michael S. Tsirkin, 2017/06/27
- Re: [Qemu-devel] [PATCH 0/8] VT-d: some enhancements on iotlb and tools, no-reply, 2017/06/27