[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/13] ioapic-common: add iommu for IOAPICCommonS
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH v2 10/13] ioapic-common: add iommu for IOAPICCommonState |
Date: |
Mon, 11 Apr 2016 17:19:20 +0800 |
When IR is enabled for IOMMU, each IOAPIC will belong to a specific
intel IOMMU. This pointer will store the owner of current IOAPIC, which
is always the default IOMMU device.
Signed-off-by: Peter Xu <address@hidden>
---
hw/intc/ioapic_common.c | 2 ++
include/hw/i386/ioapic_internal.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index 1b7ec5e..f5b6417 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -137,6 +137,8 @@ static void ioapic_common_realize(DeviceState *dev, Error
**errp)
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->io_memory);
ioapic_no++;
+
+ s->iommu = vtd_iommu_get();
}
static const VMStateDescription vmstate_ioapic_common = {
diff --git a/include/hw/i386/ioapic_internal.h
b/include/hw/i386/ioapic_internal.h
index 797ed47..41fc282 100644
--- a/include/hw/i386/ioapic_internal.h
+++ b/include/hw/i386/ioapic_internal.h
@@ -25,6 +25,7 @@
#include "hw/hw.h"
#include "exec/memory.h"
#include "hw/sysbus.h"
+#include "hw/i386/intel_iommu.h"
#define MAX_IOAPICS 1
@@ -101,6 +102,8 @@ struct IOAPICCommonState {
uint8_t ioregsel;
uint32_t irr;
uint64_t ioredtbl[IOAPIC_NUM_PINS];
+ /* IOMMU pointer that this IOAPIC belongs. */
+ IntelIOMMUState *iommu;
};
void ioapic_reset_common(DeviceState *dev);
--
2.4.3
- [Qemu-devel] [PATCH v2 00/13] IOMMU: Enable interrupt remapping for Intel IOMMU, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 01/13] q35: add "int-remap" flag to enable intr, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 02/13] acpi: enable INTR for DMAR report structure, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 03/13] intel_iommu: allow queued invalidation for IR, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 04/13] intel_iommu: set IR bit for ECAP register, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 05/13] acpi: add DMAR scope definition for root IOAPIC, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 06/13] intel_iommu: define interrupt remap table addr register, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 07/13] intel_iommu: handle interrupt remap enable, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 08/13] intel_iommu: define several structs for IOMMU IR, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 09/13] intel_iommu: provide helper function vtd_get_iommu, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 10/13] ioapic-common: add iommu for IOAPICCommonState,
Peter Xu <=
- [Qemu-devel] [PATCH v2 11/13] intel_iommu: add IR translation faults defines, Peter Xu, 2016/04/11
- [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Peter Xu, 2016/04/11
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Jan Kiszka, 2016/04/12
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Peter Xu, 2016/04/12
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Jan Kiszka, 2016/04/12
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Peter Xu, 2016/04/12
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Jan Kiszka, 2016/04/12
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Peter Xu, 2016/04/13
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Peter Xu, 2016/04/13
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Jan Kiszka, 2016/04/13