diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-10-10 05:51:24 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-10-10 05:51:24 +0000 |
commit | a2422e4ff660b7ecccdaccf12aea1f90065fd74c (patch) | |
tree | 5c0d7e406cca4fbc315a08f0bf566801ccb3f43b /sys/arch/amd64 | |
parent | 6aee5b88ac7411323736b14b9162f8bf4ad407d8 (diff) |
allow MSI with the QEMU default pc-i440fx machine
This makes it possible to use MSI for virtual functions of Intel network
devices without having to specify the q35 machine.
QEMU is detected by testing for the Qumranet pci subsystem vendor id,
suggested by sf@. MSI previously wasn't enabled as i440fx models a machine
from 1996 with ACPI 1.0, and MSI is only enabled for ACPI >= 2.0.
Initial patch from Yuichiro NAITO. ok yasuoka@ sf@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/pci/acpipci.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/amd64/pci/acpipci.c b/sys/arch/amd64/pci/acpipci.c index 52e2bc504d4..51cd1360383 100644 --- a/sys/arch/amd64/pci/acpipci.c +++ b/sys/arch/amd64/pci/acpipci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipci.c,v 1.8 2024/05/13 01:15:50 jsg Exp $ */ +/* $OpenBSD: acpipci.c,v 1.9 2024/10/10 05:51:23 jsg Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -194,12 +194,18 @@ acpipci_attach_bus(struct device *parent, struct acpipci_softc *sc) (sc->sc_acpi->sc_fadt->iapc_boot_arch & FADT_NO_MSI) == 0) pba.pba_flags |= PCI_FLAGS_MSI_ENABLED; + /* Enable MSI for QEMU claiming ACPI 1.0 */ + tag = pci_make_tag(pba.pba_pc, sc->sc_bus, 0, 0); + id = pci_conf_read(pba.pba_pc, tag, PCI_SUBSYS_ID_REG); + if (sc->sc_acpi->sc_fadt->hdr.revision == 1 && + PCI_VENDOR(id) == PCI_VENDOR_QUMRANET) + 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. */ - tag = pci_make_tag(pba.pba_pc, sc->sc_bus, 0, 0); id = pci_conf_read(pba.pba_pc, tag, PCI_ID_REG); class = pci_conf_read(pba.pba_pc, tag, PCI_CLASS_REG); if (PCI_CLASS(class) == PCI_CLASS_BRIDGE && |