Date: Tue, 27 Aug 2013 16:50:48 +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: r254965 - head/usr.sbin/bhyve Message-ID: <201308271650.r7RGomXs002115@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: neel Date: Tue Aug 27 16:50:48 2013 New Revision: 254965 URL: http://svnweb.freebsd.org/changeset/base/254965 Log: Allow single byte reads of the emulated MSI-X tables. This is not required by the PCI specification but needed to dump MMIO space from "ddb" in the guest. Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Tue Aug 27 16:49:20 2013 (r254964) +++ head/usr.sbin/bhyve/pci_emul.c Tue Aug 27 16:50:48 2013 (r254965) @@ -245,8 +245,12 @@ pci_emul_msix_tread(struct pci_devinst * int tab_index; uint64_t retval = ~0; - /* support only 4 or 8 byte reads */ - if (size != 4 && size != 8) + /* + * The PCI standard only allows 4 and 8 byte accesses to the MSI-X + * table but we also allow 1 byte access to accomodate reads from + * ddb. + */ + if (size != 1 && size != 4 && size != 8) return (retval); msix_entry_offset = offset % MSIX_TABLE_ENTRY_SIZE; @@ -263,7 +267,9 @@ pci_emul_msix_tread(struct pci_devinst * dest = (char *)(pi->pi_msix.table + tab_index); dest += msix_entry_offset; - if (size == 4) + if (size == 1) + retval = *((uint8_t *)dest); + else if (size == 4) retval = *((uint32_t *)dest); else retval = *((uint64_t *)dest);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308271650.r7RGomXs002115>