Parent Directory
|
Revision Log
| Links to HEAD: | (view) (download) (annotate) |
| Sticky Revision: |
MFC r360229, r363255 MFS r365614 r360229: Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend This will advertise support for TRIM to the guest virtio-blk driver and perform the DIOCGDELETE ioctl on the backing storage if it supports it. Thanks to Jason King and others at Joyent and illumos for expanding on my original patch, adding improvements including better error handling and making sure to following the virtio spec. r363255: Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver If the hypervisor advertises support for the DISCARD command then the guest can perform TRIM commands, freeing space on the backing store. If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE Tested with FreeBSD guests on bhyve and KVM Approved by: re (gjb) Relnotes: yes Sponsored by: Klara Inc.
- Copy stable/12@r365545 to releng/12.2 as part of the 12.2-RELEASE cycle. - Update from PRERELEASE to BETA1. - Set the default pkg(7) repository to 'quarterly'. - Bump __FreeBSD_version. - Prune svn:mergeinfo from the new branch. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com)
MFC r356523 bhyve: add wrapper for debug printf statements Add printf() wrapper to use CR/CRLF terminators depending on whether stdio is mapped to a tty open in raw mode. Try to use the wrapper everywhere. For now we leave the custom DPRINTF/WPRINTF defined by device models, but we may remove them in the future. Reviewed by: grehan, jhb Differential Revision: https://reviews.freebsd.org/D22657
MFC 347033: Increase the VirtIO segment count to support modern Windows guests. The Windows virtio driver ignores the advertized seg_max field and assumes the host can accept up to 67 segments in indirect descriptors, triggering an assert in the bhyve process. This brings back r282922 but with a couple of changes: - It raises the block interface segment limit to 128 instead of 67. - Linux's virtio driver assumes that the segment limit is no larger than the ring size. To avoid breaking Linux guests, raise the VirtIO ring size to 128, and cap the VirtIO segment limit at ring size - 2 (effectively 126).
MFC r340707: Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES to avoid buffer accessed out of bounds, also switch to snprintf(3). PR: 200859 Submitted by: Caglar <caglar@10ur.org> Obtained from: https://github.com/mist64/xhyve/pull/24
Copy head@r339432 to stable/12 as part of the 12.0-RELEASE cycle. Additional post-branch commits will follow. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
Fix style(9) space and tab.
More style(9) fixes, space vs tab.
various: general adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended.
bhyve: replace uninitialized variable "offset". Use io->io_req.br_offset instead. Suggested by: grehan CID: 1288937
Set the subvendor field in config space to the vendor ID. This is required by the Windows virtio drivers to correctly match a device. Submitted by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks
Workaround bhyve virtual disks operation on top of GEOM providers. GEOM does not support scatter/gather lists in its I/Os. Such requests are cut in pieces by physio(), that may be problematic, if those pieces are not multiple of provider's sector size. If such case is detected, move the data through temporary sequential buffer. MFC after: 2 weeks
Move legacy interrupt allocation for virtio devices to common code. There are a number of assumptions about legacy interrupts always being available in virtio so don't allow back-ends to make the decision to support them. This fixes the issue seen with virtio-rnd on OpenBSD. MSI-x vectors were not being used, and the virtio-rnd backend wasn't allocating a legacy interrupt resulting in a bhyve assert and guest exit. Reported by: Julian Hsiao, madoka at nyanisore dot net Reviewed by: neel MFC after: 1 week
Report that we may have write cache, and that we do support FLUSH. FreeBSD guest driver does not use that legacy flag, but Linux seems does. MFC after: 2 weeks
Increase S/G list size of 32 to 33 entries. 32 entries are not enough for the worst case of misaligned 128KB request, that made FreeBSD to chunk large quests in odd pieces. MFC after: 2 weeks
According to Linux and QEMU, s/n equal to buffer is not zero-terminated. This makes same s/n reported for both virtio and AHCI drivers. MFC after: 2 weeks
Rewrite virtio block device driver to work asynchronously and use the block I/O interface. Asynchronous operation, based on r280026 change, allows to not block virtual CPU during I/O processing, that on slow/busy storage can take seconds. Use of recently improved block I/O interface allows to process multiple requests same time, that improves random I/O performance on wide storages. Benchmarks of virtual disk, backed by ZVOL on RAID10 pool of 4 HDDs, show ~3.5 times random read performance improvements, while no degradation on linear I/O. Guest CPU usage during test dropped from 100% to almost zero. MFC after: 2 weeks
Modify virtqueue helpers added in r253440 to allow queuing. Original virtqueue design allows queued and out-of-order processing, but helpers added in r253440 suppose only direct blocking in-order one. It could be fine for network, etc., but it is a huge limitation for storage devices.
Add variable initialization missed by me and clang. Reported by: grehan MFC after: 2 weeks
Fix error translation broken in r279658. Reported by: grehan MFC after: 2 weeks
Implement cache flush for ahci-hd and for virtio-blk over device. MFC after: 2 weeks
Add check for absent stripe size to r279652. MFC after: 2 weeks
Add support for TOPOLOGY feature of virtio block device. Passing through physical block size/offset from underlying storage allows guest to manage proper data and I/O alignment to improve performance. MFC after: 2 weeks
Implement the FLUSH operation in the virtio-block emulation. This gets rid of the following error message during FreeBSD guest bootup: "vtbd0: hard error cmd=flush fsbn 0" Reported by: rodrigc Reviewed by: grehan
Add a callback to be notified about negotiated features. Submitted by: luigi Obtained from: Vincenzo Maffione, Universita` di Pisa MFC after: 3 days
Use MIN(a,b) from <sys/param.h> instead of rolling our own version. Pointed out by: grehan
Use calloc() in favor of malloc + memset. Reviewed by: neel
Enhance the support for PCI legacy INTx interrupts and enable them in the virtio backends. - Add a new ioctl to export the count of pins on the I/O APIC from vmm to the hypervisor. - Use pins on the I/O APIC >= 16 for PCI interrupts leaving 0-15 for ISA interrupts. - Populate the MP Table with I/O interrupt entries for any PCI INTx interrupts. - Create a _PRT table under the PCI root bridge in ACPI to route any PCI INTx interrupts appropriately. - Track which INTx interrupts are in use per-slot so that functions that share a slot attempt to distribute their INTx interrupts across the four available pins. - Implicitly mask INTx interrupts if either MSI or MSI-X is enabled and when the INTx DIS bit is set in a function's PCI command register. Either assert or deassert the associated I/O APIC pin when the state of one of those conditions changes. - Add INTx support to the virtio backends. - Always advertise the MSI capability in the virtio backends. Submitted by: neel (7) Reviewed by: neel MFC after: 2 weeks
Export the block size capability to guests. - Use #defines for capability bits - Export the VTBLK_F_BLK_SIZE capability - Fix bug in calculating capacity: it is in 512-byte units, not the underlying sector size This allows virtio-blk to have backing devices with non 512-byte sector sizes e.g. /dev/cd0, and 4K-block harddrives. Reviewed by: neel MFC after: 3 days
Changes required for OpenBSD/amd64: - Allow a hostbridge to be created with AMD as a vendor. This passes the OpenBSD check to allow the use of MSI on a PCI bus. - Enable the i/o interrupt section of the mptable, and populate it with unity ISA mappings. This allows the 'legacy' IRQ mappings of the PCI serial port to be set up. Delete unused print routine that was obscuring code. - Use the '-W' option to enable virtio single-vector MSI rather than an environment variable. Update the virtio net/block drivers to query this flag when setting up interrupts.: bhyverun.c - Fix the arithmetic used to derive the century byte in RTC CMOS, as well as encoding it in BCD. Reviewed by: neel MFC after: 3 days
Implement the virtio block 'get-ident' operation. This eliminates the annoying verbose boot error of the form g_handleattr: vtbd0 bio_length 24 len 28 -> EFAULT The ident returned by bhyve is a text string 'BHYVE-XXXX-XXXX', where the X's are the first bytes of the md5 hash of the backing filename. Reviewed by: neel Approved by: re (gjb)
Fix incorrect assertion on the minimum side. ZFS would trigger this. Reported by: Chris Torek, Allan Jude Approved by: re@ (blanket)
Fix off-by-1 error in assert. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
Major rework of the virtio code. Split out common parts, and modify the net/block devices accordingly. Submitted by: Chris Torek torek at torek dot net Reviewed by: grehan
Teach the virtio block device to deal with direct as well as indirect descriptors. Prior to this change the device would only work with guests that chose to use indirect descriptors. Modify the device reset callback to actually reset the device state. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
Simplify the assignment of memory to virtual machines by requiring a single command line option "-m <memsize in MB>" to specify the memory size. Prior to this change the user needed to explicitly specify the amount of memory allocated below 4G (-m <lowmem>) and the amount above 4G (-M <highmem>). The "-M" option is no longer supported by 'bhyveload' and 'bhyve'. The start of the PCI hole is fixed at 3GB and cannot be directly changed using command line options. However it is still possible to change this in special circumstances via the 'vm_set_lowmem_limit()' API provided by libvmmapi. Submitted by: Dinakar Medavaram (initial version) Reviewed by: grehan Obtained from: NetApp
Simplify virtio ring num-available calculation. Submitted by: Chris Torek, torek at torek dot net
Specify the length of the mapping requested from 'paddr_guest2host()'. This seems prudent to do in its own right but it also opens up the possibility of not having to mmap the entire guest address space in the 'bhyve' process context. Discussed with: grehan Obtained from: NetApp
Ignore the BARRIER flag in the virtio block header. This capability is not advertised by the host so ignore it even if the guest insists on setting the flag. Reviewed by: grehan Obtained from: NetApp
Add support for MSI-X interrupts in the virtio block device and make that the default. The current behavior of advertising a single MSI vector can be requested by setting the environment variable "BHYVE_USE_MSI" to "yes". The use of MSI is not compliant with the virtio specification and will be eventually phased out. Submitted by: Gopakumar T Obtained from: NetApp
Add svn properties to the recently merged bhyve source files. The pre-commit hook will not allow any commits without the svn:keywords property in head.
Merge projects/bhyve to head. 'bhyve' was developed by grehan@ and myself at NetApp (thanks!). Special thanks to Peter Snyder, Joe Caradonna and Michael Dexter for their support and encouragement. Obtained from: NetApp
Rename fbsdrun.* -> bhyverun.* bhyve is intended to be a generic hypervisor, and not FreeBSD-specific. (renaming internal routines will come later) Reviewed by: neel Obtained from: NetApp
Determine the correct length and sector size for raw devices. Obtained from: NetApp Tested by: Michael Dexter with iscsi LUNs
Rework how guest MMIO regions are dealt with. - New memory region interface. An RB tree holds the regions, with a last-found per-vCPU cache to deal with the common case of repeated guest accesses to MMIO registers in the same page. - Support memory-mapped BARs in PCI emulation. mem.c/h - memory region interface instruction_emul.c/h - remove old region interface. Use gpa from EPT exit to avoid a tablewalk to determine operand address. Determine operand size and use when calling through to region handler. fbsdrun.c - call into region interface on paging exit. Distinguish between instruction emul error and region not found pci_emul.c/h - implement new BAR callback api. Split BAR alloc routine into routines that require/don't require the BAR phys address. ioapic.c pci_passthru.c pci_virtio_block.c pci_virtio_net.c pci_uart.c - update to new BAR callback i/f Reviewed by: neel Obtained from: NetApp
Allow access to the device's config area with any size i/o access at any offset. This is now spec-compliant.
First cut to port bhyve, vmmctl, and libvmmapi to HEAD.
Import of bhyve hypervisor and utilities, part 1. vmm.ko - kernel module for VT-x, VT-d and hypervisor control bhyve - user-space sequencer and i/o emulation vmmctl - dump of hypervisor register state libvmm - front-end to vmm.ko chardev interface bhyve was designed and implemented by Neel Natu. Thanks to the following folk from NetApp who helped to make this available: Joe CaraDonna Peter Snyder Jeff Heller Sandeep Mann Steve Miller Brian Pawlowski
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| ViewVC Help | |
| Powered by ViewVC 1.1.27 |