Download raw body.
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
On Mon, Oct 07, 2024 at 11:42:33AM +0900, Yuichiro NAITO wrote: > From: Jonathan Gray <jsg@jsg.id.au> > Subject: Re: PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation > Date: Mon, 7 Oct 2024 13:29:06 +1100 > > > On Mon, Oct 07, 2024 at 10:54:14AM +0900, Yuichiro NAITO wrote: > >> Hi, this patch sets 'PCI_FLAGS_MSI_ENABLED' if the kernel runs on a QEMU > >> virtual machine with i440fx chipset emulation. The i440fx is the default > >> chipset on the QEMU so users will use it first. > >> And then ixv(4) and iavf(4) will fail because MSI-X interrupts are not > >> supported by the kernel. > >> > >> The i440fx is quite old and the ACPI table is revision 1. We cannot know > >> if it has MSI capability from the ACPI table. So I add the flag as a quirk. > > > > i440fx was released in 1996. Why not use the q35/ich9 machine? > > That hardware had MSI. > > Because the QEMU default chipset emulation is still i440fx. > Many users forget to configure q35 chipset and I was asked > so many times for the ixv(4) driver. MSI isn't enabled because of the ACPI table, so why not put the workaround next to that check? Untested diff for that below. But really, qemu should not allow emulating an amd64 machine with devices from 1996. > > > If networking is configured, non-default options are already set. > > Sorry, what do you mean by the 'non-default options'? > Would you tell me more details for my understanding? At least one option was specified. So more options can be added. Index: sys/arch/amd64/pci/acpipci.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/pci/acpipci.c,v diff -u -p -U5 -r1.8 acpipci.c --- sys/arch/amd64/pci/acpipci.c 13 May 2024 01:15:50 -0000 1.8 +++ sys/arch/amd64/pci/acpipci.c 7 Oct 2024 06:36:01 -0000 @@ -192,10 +192,15 @@ acpipci_attach_bus(struct device *parent /* Enable MSI in ACPI 2.0 and above, unless we're told not to. */ if (sc->sc_acpi->sc_fadt->hdr.revision >= 2 && (sc->sc_acpi->sc_fadt->iapc_boot_arch & FADT_NO_MSI) == 0) pba.pba_flags |= PCI_FLAGS_MSI_ENABLED; + /* Enable MSI for hypervisors claiming ACPI 1.0. */ + if (sc->sc_acpi->sc_fadt->hdr.revision == 1 && + cpu_ecxfeature & CPUIDECX_HV) + pba.pba_flags |= PCI_FLAGS_MSI_ENABLED; + /* * Don't enable MSI on chipsets from low-end manufacturers * like VIA and SiS. We do this by looking at the host * bridge, which should be device 0 function 0. */
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation
PCI amd64: Enables MSI/MSI-X interrupts on QEMU i440fx chipset emulation