On Thu, Jan 23, 2014 at 02:24:06PM -0500, Anthony DeRobertis wrote:
> On 01/23/2014 07:37 AM, Neil Horman wrote:
> >diff --git a/drivers/iommu/intel_irq_remapping.c
> >b/drivers/iommu/intel_irq_remapping.c
> >index bab10b1..19f41ee 100644
> >--- a/drivers/iommu/intel_irq_remapping.c
> >+++ b/drivers/iommu/intel_irq_remapping.c
> >@@ -533,6 +533,8 @@ static int __init intel_irq_remapping_supported(void)
> > "contact your BIOS vendor for an update\n");
> > add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
> > disable_irq_remap = 1;
> >+ /* In case BIOS already enabled irq remapping */
> >+ disable_irq_remapping();
> > return 0;
> > }
>
> I already tried that, well, similar (you need to declare
> disable_irq_remapping above that or it won't compile). I also added
> in some printks, to see what it is doing:
>
> diff --git a/drivers/iommu/intel_irq_remapping.c
> b/drivers/iommu/intel_irq_remapping.c
> index bab10b1..8a502d7 100644
> --- a/drivers/iommu/intel_irq_remapping.c
> +++ b/drivers/iommu/intel_irq_remapping.c
> @@ -496,8 +496,13 @@ static void iommu_disable_irq_remapping(struct
> intel_iommu *iommu)
> raw_spin_lock_irqsave(&iommu->register_lock, flags);
> sts = dmar_readq(iommu->reg + DMAR_GSTS_REG);
> - if (!(sts & DMA_GSTS_IRES))
> + if (!(sts & DMA_GSTS_IRES)) {
> + printk(KERN_WARNING
> + "Not disabling interrupt remapping, was not
> enabled.\n");
> goto end;
> + } else {
> + printk(KERN_INFO "Disabling interrupt remapping.\n");
> + }
> iommu->gcmd &= ~DMA_GCMD_IRE;
> writel(iommu->gcmd, iommu->reg + DMAR_GCMD_REG);
> @@ -518,6 +523,8 @@ static int __init dmar_x2apic_optout(void)
> return dmar->flags & DMAR_X2APIC_OPT_OUT;
> }
> +static void disable_irq_remapping(void);
> +
> static int __init intel_irq_remapping_supported(void)
> {
> struct dmar_drhd_unit *drhd;
> @@ -533,6 +540,7 @@ static int __init intel_irq_remapping_supported(void)
> "contact your BIOS vendor for an update\n");
> add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
> disable_irq_remap = 1;
> + disable_irq_remapping();
> return 0;
> }
>
>
> The result. Note this is two boots, I changed to printk messages to
> something more understandable and rebooted to make sure there were
> no brown paper bag bugs. So the do_IRQ bugs logs are the first boot,
> the rest is the second boot:
>
> [ 0.063923] dmar: ATSR flags: 0x0
> [ 0.064075] This system BIOS has enabled interrupt remapping
> [ 0.064075] on a chipset that contains an erratum making that
> [ 0.064075] feature unstable. To maintain system stability
> [ 0.064075] interrupt remapping is being disabled. Please
> [ 0.064075] contact your BIOS vendor for an update
> [ 0.064226] Not disabling interrupt remapping, was not enabled.
> [ 0.064287] Not disabling interrupt remapping, was not enabled.
> [ 0.064408] Switched APIC routing to physical flat.
>
>
> anthony@Zia:~$ dmesg | grep do_IRQ # this is from the first boot
> [ 2713.768956] do_IRQ: 40 callbacks suppressed
> [ 2713.768963] do_IRQ: 0.132 No irq handler for vector (irq -1)
> [ 3914.191481] do_IRQ: 3.219 No irq handler for vector (irq -1)
> [12336.482217] do_IRQ: 3.106 No irq handler for vector (irq -1)
> [19669.277859] do_IRQ: 2.136 No irq handler for vector (irq -1)
> [31304.932672] do_IRQ: 2.204 No irq handler for vector (irq -1)
> [35867.281432] do_IRQ: 2.135 No irq handler for vector (irq -1)
> [43867.266257] do_IRQ: 1.174 No irq handler for vector (irq -1)
> [50097.592403] do_IRQ: 3.81 No irq handler for vector (irq -1)
> [55498.847866] do_IRQ: 0.92 No irq handler for vector (irq -1)
> [57560.923165] do_IRQ: 0.199 No irq handler for vector (irq -1)
> [57650.204418] do_IRQ: 0.120 No irq handler for vector (irq -1)
> [72835.450862] do_IRQ: 0.163 No irq handler for vector (irq -1)
> [76884.819496] do_IRQ: 2.68 No irq handler for vector (irq -1)
> [77687.282915] do_IRQ: 2.216 No irq handler for vector (irq -1)
> [77885.355992] do_IRQ: 2.185 No irq handler for vector (irq -1)
> [78615.309285] do_IRQ: 12 callbacks suppressed
> [78615.309291] do_IRQ: 3.45 No irq handler for vector (irq -1)
> [78735.392357] do_IRQ: 6 callbacks suppressed
> [78735.392362] do_IRQ: 2.173 No irq handler for vector (irq -1)
> [79785.646442] do_IRQ: 6 callbacks suppressed
> [79785.646449] do_IRQ: 1.53 No irq handler for vector (irq -1)
> [79965.718447] do_IRQ: 8 callbacks suppressed
> [79965.718453] do_IRQ: 0.150 No irq handler for vector (irq -1)
>
> PS: Sent Asus a support request, to see if they have anything to say
> about what the BIOS is doing with that erratum. Will let you know if
> they respond with anything useful, I mostly expect "we don't support
> Linux".
Probably, unfortunately this puts us back at square 1. The OS sees irq
remapping as disabled, so theres nothing for the OS to do here. So either the
BIOS is lying to the OS, or the symptom you see here is the result of some other
problem, but I couldn't tell you what.
Neil
> https://vip.asus.com/VIP2/Services/MailDetail/WTM20140124024244911
> ... no idea if that link works for anyone but me.
>
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu