[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v4 12/57] x86-iommu: introduce "intremap" property
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v4 12/57] x86-iommu: introduce "intremap" property |
Date: |
Thu, 21 Jul 2016 19:27:01 +0300 |
From: Peter Xu <address@hidden>
Adding one property for intel-iommu devices to specify whether we should
support interrupt remapping. By default, IR is disabled. To enable it,
we should use (take Intel IOMMU as example):
-device intel_iommu,intremap=on
This property can be shared by Intel and future AMD IOMMUs.
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/x86-iommu.h | 1 +
hw/i386/x86-iommu.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h
index b2401a6..699dd06 100644
--- a/include/hw/i386/x86-iommu.h
+++ b/include/hw/i386/x86-iommu.h
@@ -43,6 +43,7 @@ struct X86IOMMUClass {
struct X86IOMMUState {
SysBusDevice busdev;
+ bool intr_supported; /* Whether vIOMMU supports IR */
};
/**
diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
index f395139..4280839 100644
--- a/hw/i386/x86-iommu.c
+++ b/hw/i386/x86-iommu.c
@@ -59,9 +59,32 @@ static void x86_iommu_class_init(ObjectClass *klass, void
*data)
dc->realize = x86_iommu_realize;
}
+static bool x86_iommu_intremap_prop_get(Object *o, Error **errp)
+{
+ X86IOMMUState *s = X86_IOMMU_DEVICE(o);
+ return s->intr_supported;
+}
+
+static void x86_iommu_intremap_prop_set(Object *o, bool value, Error **errp)
+{
+ X86IOMMUState *s = X86_IOMMU_DEVICE(o);
+ s->intr_supported = value;
+}
+
+static void x86_iommu_instance_init(Object *o)
+{
+ X86IOMMUState *s = X86_IOMMU_DEVICE(o);
+
+ /* By default, do not support IR */
+ s->intr_supported = false;
+ object_property_add_bool(o, "intremap", x86_iommu_intremap_prop_get,
+ x86_iommu_intremap_prop_set, NULL);
+}
+
static const TypeInfo x86_iommu_info = {
.name = TYPE_X86_IOMMU_DEVICE,
.parent = TYPE_SYS_BUS_DEVICE,
+ .instance_init = x86_iommu_instance_init,
.instance_size = sizeof(X86IOMMUState),
.class_init = x86_iommu_class_init,
.class_size = sizeof(X86IOMMUClass),
--
MST
- [Qemu-devel] [PULL v4 02/57] tests/prom-env-test: increase the test timeout, (continued)
- [Qemu-devel] [PULL v4 02/57] tests/prom-env-test: increase the test timeout, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 03/57] hw/alpha: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 04/57] hw/mips: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 05/57] hw/apb: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 06/57] hw/grackle: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 07/57] hw/prep: realize the PCI root bus as part of the prep init, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 08/57] hw/versatile: realize the PCI root bus as part of the versatile init, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 09/57] x86-iommu: introduce parent class, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 10/57] intel_iommu: rename VTD_PCI_DEVFN_MAX to x86-iommu, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 11/57] x86-iommu: provide x86_iommu_get_default, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 12/57] x86-iommu: introduce "intremap" property,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v4 13/57] acpi: enable INTR for DMAR report structure, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 14/57] intel_iommu: allow queued invalidation for IR, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 15/57] intel_iommu: set IR bit for ECAP register, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 16/57] acpi: add DMAR scope definition for root IOAPIC, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 17/57] intel_iommu: define interrupt remap table addr register, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 18/57] intel_iommu: handle interrupt remap enable, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 19/57] intel_iommu: define several structs for IOMMU IR, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 20/57] intel_iommu: add IR translation faults defines, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 21/57] intel_iommu: Add support for PCI MSI remap, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 22/57] q35: ioapic: add support for emulated IOAPIC IR, Michael S. Tsirkin, 2016/07/21