[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v3 13/55] acpi: enable INTR for DMAR report structure
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v3 13/55] acpi: enable INTR for DMAR report structure |
Date: |
Wed, 20 Jul 2016 20:45:20 +0300 |
From: Peter Xu <address@hidden>
In ACPI DMA remapping report structure, enable INTR flag when specified.
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/intel_iommu.h | 2 ++
hw/i386/acpi-build.c | 14 +++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
index 0794309..741242e 100644
--- a/include/hw/i386/intel_iommu.h
+++ b/include/hw/i386/intel_iommu.h
@@ -44,6 +44,8 @@
#define VTD_HOST_ADDRESS_WIDTH 39
#define VTD_HAW_MASK ((1ULL << VTD_HOST_ADDRESS_WIDTH) - 1)
+#define DMAR_REPORT_F_INTR (1)
+
typedef struct VTDContextEntry VTDContextEntry;
typedef struct VTDContextCacheEntry VTDContextCacheEntry;
typedef struct IntelIOMMUState IntelIOMMUState;
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 12ecf95..06682f1 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -59,6 +59,7 @@
#include "qapi/qmp/qint.h"
#include "qom/qom-qobject.h"
+#include "hw/i386/x86-iommu.h"
#include "hw/acpi/ipmi.h"
@@ -2454,6 +2455,10 @@ build_mcfg_q35(GArray *table_data, BIOSLinker *linker,
AcpiMcfgInfo *info)
build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL);
}
+/*
+ * VT-d spec 8.1 DMA Remapping Reporting Structure
+ * (version Oct. 2014 or later)
+ */
static void
build_dmar_q35(GArray *table_data, BIOSLinker *linker)
{
@@ -2461,10 +2466,17 @@ build_dmar_q35(GArray *table_data, BIOSLinker *linker)
AcpiTableDmar *dmar;
AcpiDmarHardwareUnit *drhd;
+ uint8_t dmar_flags = 0;
+ X86IOMMUState *iommu = x86_iommu_get_default();
+
+ assert(iommu);
+ if (iommu->intr_supported) {
+ dmar_flags |= 0x1; /* Flags: 0x1: INT_REMAP */
+ }
dmar = acpi_data_push(table_data, sizeof(*dmar));
dmar->host_address_width = VTD_HOST_ADDRESS_WIDTH - 1;
- dmar->flags = 0; /* No intr_remap for now */
+ dmar->flags = dmar_flags;
/* DMAR Remapping Hardware Unit Definition structure */
drhd = acpi_data_push(table_data, sizeof(*drhd));
--
MST
- [Qemu-devel] [PULL v3 03/55] hw/alpha: fix PCI bus initialization, (continued)
- [Qemu-devel] [PULL v3 03/55] hw/alpha: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 04/55] hw/mips: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 05/55] hw/apb: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 06/55] hw/grackle: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 07/55] hw/prep: realize the PCI root bus as part of the prep init, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 09/55] x86-iommu: introduce parent class, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 08/55] hw/versatile: realize the PCI root bus as part of the versatile init, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 10/55] intel_iommu: rename VTD_PCI_DEVFN_MAX to x86-iommu, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 11/55] x86-iommu: provide x86_iommu_get_default, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 12/55] x86-iommu: introduce "intremap" property, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 13/55] acpi: enable INTR for DMAR report structure,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v3 14/55] intel_iommu: allow queued invalidation for IR, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 15/55] intel_iommu: set IR bit for ECAP register, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 16/55] acpi: add DMAR scope definition for root IOAPIC, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 17/55] intel_iommu: define interrupt remap table addr register, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 18/55] intel_iommu: handle interrupt remap enable, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 19/55] intel_iommu: define several structs for IOMMU IR, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 20/55] intel_iommu: add IR translation faults defines, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 21/55] intel_iommu: Add support for PCI MSI remap, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 22/55] q35: ioapic: add support for emulated IOAPIC IR, Michael S. Tsirkin, 2016/07/20
- [Qemu-devel] [PULL v3 23/55] ioapic: introduce ioapic_entry_parse() helper, Michael S. Tsirkin, 2016/07/20