[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 02/28] intel_iommu: introduce vtd_reset_caches()
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 02/28] intel_iommu: introduce vtd_reset_caches() |
Date: |
Wed, 24 Oct 2018 20:52:24 -0400 |
From: Peter Xu <address@hidden>
Provide the function and use it in vtd_init(). Used to reset both
context entry cache and iotlb cache for the whole IOMMU unit.
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Eric Auger <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/intel_iommu.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 3dfada19a6..1137861a9d 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -227,6 +227,14 @@ static void vtd_reset_iotlb(IntelIOMMUState *s)
vtd_iommu_unlock(s);
}
+static void vtd_reset_caches(IntelIOMMUState *s)
+{
+ vtd_iommu_lock(s);
+ vtd_reset_iotlb_locked(s);
+ vtd_reset_context_cache_locked(s);
+ vtd_iommu_unlock(s);
+}
+
static uint64_t vtd_get_iotlb_key(uint64_t gfn, uint16_t source_id,
uint32_t level)
{
@@ -3160,10 +3168,7 @@ static void vtd_init(IntelIOMMUState *s)
s->cap |= VTD_CAP_CM;
}
- vtd_iommu_lock(s);
- vtd_reset_context_cache_locked(s);
- vtd_reset_iotlb_locked(s);
- vtd_iommu_unlock(s);
+ vtd_reset_caches(s);
/* Define registers with default values and bit semantics */
vtd_define_long(s, DMAR_VER_REG, 0x10UL, 0, 0);
--
MST
- [Qemu-devel] [PULL v2 00/28] pci, pc, virtio: fixes, features, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 02/28] intel_iommu: introduce vtd_reset_caches(),
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 01/28] virtio-blk: fix comment for virtio_blk_rw_complete, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 03/28] intel_iommu: better handling of dmar state switch, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 04/28] intel_iommu: move ce fetching out when sync shadow, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 05/28] intel_iommu: handle invalid ce for shadow sync, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 06/28] vhost-user-blk: start vhost when guest kicks, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 08/28] x86_iommu: move vtd_generate_msi_message in common file, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 07/28] x86_iommu: move the kernel-irqchip check in common code, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 09/28] x86_iommu/amd: remove V=1 check from amdvi_validate_dte(), Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 10/28] x86_iommu/amd: make the address space naming consistent with intel-iommu, Michael S. Tsirkin, 2018/10/24
- [Qemu-devel] [PULL v2 11/28] x86_iommu/amd: Prepare for interrupt remap support, Michael S. Tsirkin, 2018/10/24