diff options
author | 2019-05-30 22:03:14 +0000 | |
---|---|---|
committer | 2019-05-30 22:03:14 +0000 | |
commit | 912ed164483036b004d13acaa49c0b8e29cc2459 (patch) | |
tree | 64d2f81ed3cf7ee4aacc11218c2df35da0e19436 | |
parent | Fix definitions of PCI_MSIX_MAU32 and add a define for the MSI-X function (diff) | |
download | wireguard-openbsd-912ed164483036b004d13acaa49c0b8e29cc2459.tar.xz wireguard-openbsd-912ed164483036b004d13acaa49c0b8e29cc2459.zip |
Use two 32-bit writes instead of a single 64-bit write to write the
message address into an MSI-X table entry. The RTL8168/RTL8111 hardware
does not respond to 64-bit access (reads return all-ones, writes are
ignored) and the PCI specification documents separate 32-bit "DWORD"
fields for message address and message upper address.
ok mlarkin@, jmatthew@
-rw-r--r-- | sys/arch/amd64/pci/pci_machdep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index 4e58376aff5..976ef2d3b6b 100644 --- a/sys/arch/amd64/pci/pci_machdep.c +++ b/sys/arch/amd64/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.69 2018/08/19 08:23:47 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.70 2019/05/30 22:03:14 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -475,7 +475,8 @@ msix_addroute(struct pic *pic, struct cpu_info *ci, int pin, int vec, int type) _bus_space_map(memt, base + offset, tblsz * 16, 0, &memh)) panic("%s: cannot map registers", __func__); - bus_space_write_8(memt, memh, PCI_MSIX_MA(entry), addr); + bus_space_write_4(memt, memh, PCI_MSIX_MA(entry), addr); + bus_space_write_4(memt, memh, PCI_MSIX_MAU32(entry), 0); bus_space_write_4(memt, memh, PCI_MSIX_MD(entry), vec); bus_space_barrier(memt, memh, PCI_MSIX_MA(entry), 16, BUS_SPACE_BARRIER_WRITE); |