Re: [EXTERNAL] PROBLEM: commit f36a74b9345a leads to not booting system with AMD 2990WX

From: David Woodhouse
Date: Mon Jan 04 2021 - 19:20:51 EST


On Tue, 2021-01-05 at 00:05 +0100, Johnathan Smithinovic wrote:
> commit f36a74b9345a leads to not booting system with AMD 2990WX
>
>
> When trying to boot 5.11-rc2 as usual the messages of the bootloader stay on my
> screen and not much appears to happen (fans run a bit slower than in GRUB,
> devices don't seem to get accessed). Without this commit everything seems to
> work as usual.
>
> (In the hope that it is helpful I appended messages mentioning "IO APIC"
> from 5.11-rc2 with the mentioned commit reverted (and the kernel parameter
> apic=debug added).
> I'm sorry that I can't provide more details: I'm unsure how I can gather
> more information since my Motherboard (ASUS ROG ZENITH EXTREME) does not have
> any documented serial ports and USB devices don't seem to get turned on.)

No problem, that was enough to reproduce it in qemu just by simulating
the same BIOS bug which causes it to *start* enabling, then abort, the
IRQ remapping. Thanks for the report.

Does this fix it?

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 7e2c445a1fae..f0adbc48fd17 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3854,6 +3854,9 @@ static int irq_remapping_select(struct irq_domain *d, struct irq_fwspec *fwspec,
struct amd_iommu *iommu;
int devid = -1;

+ if (!amd_iommu_irq_remap)
+ return 0;
+
if (x86_fwspec_is_ioapic(fwspec))
devid = get_ioapic_devid(fwspec->param[0]);
else if (x86_fwspec_is_hpet(fwspec))

Attachment: smime.p7s
Description: S/MIME cryptographic signature