Date: Mon, 11 Mar 2013 17:36:37 +0000 (UTC) From: Neel Natu <neel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248171 - head/usr.sbin/bhyve Message-ID: <201303111736.r2BHabAD026602@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: neel Date: Mon Mar 11 17:36:37 2013 New Revision: 248171 URL: http://svnweb.freebsd.org/changeset/base/248171 Log: Convert the offset into the bar that contains the MSI-X table to an offset into the MSI-X table before using it to calculate the table index. In the common case where the MSI-X table is located at the begining of the BAR these two offsets are identical and thus the code was working by accident. This change will fix the case where the MSI-X table is located in the middle or at the end of the BAR that contains it. Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Mon Mar 11 17:29:09 2013 (r248170) +++ head/usr.sbin/bhyve/pci_passthru.c Mon Mar 11 17:36:37 2013 (r248171) @@ -279,6 +279,7 @@ msix_table_read(struct passthru_softc *s int index; pi = sc->psc_pi; + offset -= pi->pi_msix.table_offset; index = offset / MSIX_TABLE_ENTRY_SIZE; if (index >= pi->pi_msix.table_count) @@ -323,6 +324,8 @@ msix_table_write(struct vmctx *ctx, int int error, index; pi = sc->psc_pi; + offset -= pi->pi_msix.table_offset; + index = offset / MSIX_TABLE_ENTRY_SIZE; if (index >= pi->pi_msix.table_count) return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303111736.r2BHabAD026602>