Module Name: src Committed By: martin Date: Wed Nov 20 16:36:47 UTC 2019
Modified Files: src/sys/arch/x86/pci [netbsd-8]: msipic.c Log Message: Pull up following revision(s) (requested by hikaru in ticket #1453): sys/arch/x86/pci/msipic.c: revision 1.19 Disable MSI-X before writing the MSI-X table. That fixes MSI-X interrupt lost on VMware ESXi 6.7 PCI passthrough devices. ok knakahara@ To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.2.1 src/sys/arch/x86/pci/msipic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/pci/msipic.c diff -u src/sys/arch/x86/pci/msipic.c:1.10 src/sys/arch/x86/pci/msipic.c:1.10.2.1 --- src/sys/arch/x86/pci/msipic.c:1.10 Thu Jun 1 02:45:08 2017 +++ src/sys/arch/x86/pci/msipic.c Wed Nov 20 16:36:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: msipic.c,v 1.10 2017/06/01 02:45:08 chs Exp $ */ +/* $NetBSD: msipic.c,v 1.10.2.1 2019/11/20 16:36:47 martin Exp $ */ /* * Copyright (c) 2015 Internet Initiative Japan Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.10 2017/06/01 02:45:08 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.10.2.1 2019/11/20 16:36:47 martin Exp $"); #include "opt_intrdebug.h" @@ -538,6 +538,11 @@ msix_addroute(struct pic *pic, struct cp err = pci_get_capability(pc, tag, PCI_CAP_MSIX, &off, NULL); KASSERT(err != 0); + /* Disable MSI-X before writing MSI-X table */ + ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL); + ctl &= ~PCI_MSIX_CTL_ENABLE; + pci_conf_write(pc, tag, off + PCI_MSIX_CTL, ctl); + entry_base = PCI_MSIX_TABLE_ENTRY_SIZE * msix_vec; /*