freebsd-dev/usr.sbin/bhyve
Chuck Tuffli 76e47b9420 Fix bhyve's NVMe queue bookkeeping
Many size / length parameters in NVMe are "0's based", meaning, a value
of 0x0 represents 1, 0x1 represents 2, etc.. While this leads to an
efficient encoding, it can lead to subtle bugs. With respect to queues,
these parameters include:
 - Maximum number of queue entries
 - Maximum number of queues
 - Number of Completion Queues
 - Number of Submission Queues

To be consistent, convert all 0's based values from the host to 1's
based value internally. Likewise, covert internal 1's based values to
0's based values when returned to the host. This fixes an off-by-one bug
when creating IO queues and simplifies some of the code. Note that this
bug is masked by another bug.

While in the neighborhood,
 - fix an erroneous queue ID check (checking CQ count when deleting SQ)
 - check for queue ID of 0x0 in a few places where this is illegal
 - clean up the Set Features, Number of Queues command and check for
   illegal values

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18702
2019-01-04 15:03:30 +00:00
..
acpi.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
acpi.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
ahci.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
atkbdc.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
atkbdc.h Import bhyve_graphics into CURRENT. Thanks to all who tested 2016-07-04 03:19:06 +00:00
bhyve.8 Allow CTL device specification in bhyve virtio-scsi. 2018-12-11 20:47:00 +00:00
bhyvegc.c When this code was introduced at r300829 the author forgot to add 2018-06-13 04:00:21 +00:00
bhyvegc.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
bhyverun.c Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32 2018-10-27 21:24:28 +00:00
bhyverun.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
block_if.c Fix resource leak, variables cp, xopts and nopt going out of scope. 2018-11-02 07:57:28 +00:00
block_if.h - Add bhyve NVMe device emulation. 2018-07-05 03:33:58 +00:00
bootrom.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
bootrom.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
console.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
console.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
consport.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
dbgport.c Improve bhyve exit(3) error code. 2018-07-11 03:23:09 +00:00
dbgport.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
fwctl.c Always treat firmware request and response sizes as unsigned. 2018-12-04 18:28:25 +00:00
fwctl.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
gdb.c Initial debug server for bhyve. 2018-05-01 15:17:46 +00:00
gdb.h Initial debug server for bhyve. 2018-05-01 15:17:46 +00:00
inout.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
inout.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
ioapic.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
ioapic.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
iov.c Fix several iov handling bugs in bhyve virtio-scsi backend. 2018-12-07 20:30:00 +00:00
iov.h Fix several iov handling bugs in bhyve virtio-scsi backend. 2018-12-07 20:30:00 +00:00
Makefile Allow the bhyve VNC server to listen on IPv6 for incoming connections. 2018-10-24 08:45:33 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mem.c While I was investigating CID 1194192 related with a resource leak on mrp memory 2018-06-13 11:49:34 +00:00
mem.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
mevent_test.c Improve bhyve exit(3) error code. 2018-07-11 03:23:09 +00:00
mevent.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
mevent.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
mptbl.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
mptbl.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pci_ahci.c Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES 2018-11-20 22:21:19 +00:00
pci_e82545.c Improve bhyve exit(3) error code. 2018-07-11 03:23:09 +00:00
pci_emul.c Add -s "help" and -l "help" to print a list of supported PCI and LPC devices. 2018-08-22 20:23:08 +00:00
pci_emul.h Add -s "help" and -l "help" to print a list of supported PCI and LPC devices. 2018-08-22 20:23:08 +00:00
pci_fbuf.c Revert my bogus attempt to silence coverity on r340045, it created 2018-11-07 04:20:29 +00:00
pci_hostbridge.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pci_irq.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pci_irq.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pci_lpc.c Add -s "help" and -l "help" to print a list of supported PCI and LPC devices. 2018-08-22 20:23:08 +00:00
pci_lpc.h Add -s "help" and -l "help" to print a list of supported PCI and LPC devices. 2018-08-22 20:23:08 +00:00
pci_nvme.c Fix bhyve's NVMe queue bookkeeping 2019-01-04 15:03:30 +00:00
pci_passthru.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pci_uart.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pci_virtio_block.c Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES 2018-11-20 22:21:19 +00:00
pci_virtio_console.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pci_virtio_net.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
pci_virtio_rnd.c Fix resource leak, variable fd going out of scope. 2018-11-02 07:59:28 +00:00
pci_virtio_scsi.c Allow CTL device specification in bhyve virtio-scsi. 2018-12-11 20:47:00 +00:00
pci_xhci.c Fix resource leak when using strdup(3). 2018-11-02 08:01:42 +00:00
pci_xhci.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pm.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
post.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
ps2kbd.c Remove printf for debug purpose forgotten on r340046. 2018-11-02 13:48:06 +00:00
ps2kbd.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
ps2mouse.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
ps2mouse.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
rfb.c Allow the bhyve VNC server to listen on IPv6 for incoming connections. 2018-10-24 08:45:33 +00:00
rfb.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
rtc.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
rtc.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
smbiostbl.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
smbiostbl.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
sockstream.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
sockstream.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
spinup_ap.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
spinup_ap.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
task_switch.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
uart_emul.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
uart_emul.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
usb_emul.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
usb_emul.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
usb_mouse.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
vga.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
vga.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
virtio.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
virtio.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
xmsr.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
xmsr.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00