[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for em
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC |
Date: |
Mon, 11 Apr 2016 22:22:18 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2016-04-11 02:19, Peter Xu wrote:
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 378e663..d963d45 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -57,6 +57,8 @@ static void ioapic_service(IOAPICCommonState *s)
> uint64_t entry;
> uint8_t dest;
> uint8_t dest_mode;
> + IntelIOMMUState *iommu = s->iommu;
> + VTDIrq irq = {0};
>
> for (i = 0; i < IOAPIC_NUM_PINS; i++) {
> mask = 1 << i;
> @@ -65,11 +67,33 @@ static void ioapic_service(IOAPICCommonState *s)
>
> entry = s->ioredtbl[i];
> if (!(entry & IOAPIC_LVT_MASKED)) {
> - trig_mode = ((entry >> IOAPIC_LVT_TRIGGER_MODE_SHIFT) & 1);
> - dest = entry >> IOAPIC_LVT_DEST_SHIFT;
> - dest_mode = (entry >> IOAPIC_LVT_DEST_MODE_SHIFT) & 1;
> - delivery_mode =
> - (entry >> IOAPIC_LVT_DELIV_MODE_SHIFT) & IOAPIC_DM_MASK;
> +
> + if (iommu && iommu->intr_enabled) {
> + /*
> + * Interrupt remapping is enabled in owner IOMMU,
> + * we need to fetch the real IRQ information via
> + * IRTE of the root mapping table
> + */
> + if (vtd_interrupt_remap_ioapic(iommu, &entry, &irq)) {
VT-d is only one of the possible IOMMUs on x86. Please introduce a
generic interface.
Look at Rita's and my patches: they translate the IOAPIC (and HPET...)
interrupts into MSI messages that are then - in a generic way -
intercepted by the respective IOMMU or directly dispatched to the APICs.
We may no longer need new memory regions for this, thanks to the region
attributes, but we also need no hard-coded hooks here.
Thanks,
Jan
- [Qemu-devel] [PATCH v2 03/13] intel_iommu: allow queued invalidation for IR, (continued)
- [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, 2016/04/11
- [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 <=
- 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
- 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/14
- Re: [Qemu-devel] [PATCH v2 12/13] intel_iommu: ioapic: IR support for emulated IOAPIC, Peter Xu, 2016/04/14