summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
Commit message (Collapse)AuthorAgeFilesLines
* Add simple (no-op) emulations for the CHECK_POWER_MODE,grehan2015-08-171-0/+6
| | | | | | READ_VERIFY and READ_VERIFY_EXT commands. Reviewed by: mav
* Another small typo.mav2015-08-111-1/+1
| | | | MFC after: 3 days
* Fix minor typo.mav2015-08-111-1/+1
| | | | MFC after: 3 days
* Manpage cleanup.brueffer2015-08-071-12/+23
| | | | | | | | | - new sentence -> new line - fix manpage references - fix macro usage - fix a typo MFC after: 1 week
* Always assert DCD and DSR in bhyve's uart emulation.neel2015-07-061-17/+34
| | | | | | | | | | | | | | | | | The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows: ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure The initial terminal type passed to getty(8) is "3wire" which sets the CLOCAL flag. However reset(1) clears this flag and any programs that try to open the terminal will hang waiting for DCD to be asserted. Fix this by always asserting DCD and DSR in the emulated uart. The following discussion on virtualization@ has more details: https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html Reported by: jmg Discussed with: grehan
* Updated dependssjg2015-07-031-0/+22
|
* add SO_REUSEADDR when starting debug port, lets you still bind whenjmg2015-06-201-0/+9
| | | | | | | a TIME_WAIT socket is still around... Reviewed by: grehan Review: https://reviews.freebsd.org/D2875
* Restructure memory allocation in bhyve to support "devmem".neel2015-06-188-24/+283
| | | | | | | | | | | | | | | | | | | | | devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer where doing a trap-and-emulate for every access is impractical. devmem is a hybrid of system memory (sysmem) and emulated device models. devmem is mapped in the guest address space via nested page tables similar to sysmem. However the address range where devmem is mapped may be changed by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is usually mapped RO or RW as compared to RWX mappings for sysmem. Each devmem segment is named (e.g. "bootrom") and this name is used to create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom). The device node supports mmap(2) and this decouples the host mapping of devmem from its mapping in the guest address space (which can change). Reviewed by: tychon Discussed with: grehan Differential Revision: https://reviews.freebsd.org/D2762 MFC after: 4 weeks
* Fix non-deterministic delays when accessing a vcpu that was in "running" orneel2015-05-281-1/+13
| | | | | | | "sleeping" state. This is done by forcing the vcpu to transition to "idle" by returning to userspace with an exit code of VM_EXITCODE_REQIDLE. MFC after: 2 weeks
* The 'hostbridge' device exists to allow guests to infer msi/msixtychon2015-05-211-1/+1
| | | | | | | | | | capablity by advertising pcie capability. Since the 'hostbridge' device isn't a true pci-to-pci bridge, and doesn't actaully use the bridge configuration space layout, change the header-type from type 1 to type 0 to avoid confusion. Reviewed by: neel
* Temporarily revert r282922 which bumped the max descriptors.grehan2015-05-211-1/+1
| | | | | | | | | | | | | | | While there is no issued with the number of descriptors in a virtio indirect descriptor, it's a guest's choice as to whether indirect descriptors are used. For the case where they aren't, the virtio block ring size is still 64 which is less than the now reported max_segs of 67. This results in an assertion in recent Linux guests even though it was benign since they were using indirect descs. The intertwined relationship between virtio ring size, max seg size and blockif queue size will be addressed in an upcoming commit, at which point the max descriptors will again be bumped up to 67.
* Bump the size of the blockif scatter-gather list to 67.grehan2015-05-141-1/+1
| | | | | | | | | | | | 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. No objection from: mav Reviewed by: neel Reported and tested by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks
* Set the subvendor field in config space to the vendor ID.grehan2015-05-133-0/+3
| | | | | | | | This is required by the Windows virtio drivers to correctly match a device. Submitted by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks
* Allow configuration of the sector size advertised to the guest.neel2015-05-122-26/+69
| | | | | | | | | | | | | | | The default behavior is to infer the logical and physical sector sizes from the block device backend. However older versions of Windows only work with specific logical/physical combinations: - Vista and Windows 7: 512/512 - Windows 7 SP1: 512/512 or 512/4096 For this reason allow the sector size to be specified using the following block device option: sectorsize=logical[/physical] Reported by: Leon Dang (ldang@nahannisys.com) Reviewed by: grehan MFC after: 2 weeks
* Handling indirect descriptors is a capability of the host andgrehan2015-05-111-1/+1
| | | | | | | | | | | | | not one that needs to be negotiated. Use the host capabilities field and not the negotiated field when verifying that indirect descriptors are supported. Found with the Redhat Windows viostor driver, which clears the indirect capability in the negotiated caps and then starts using them. Reported and tested by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks
* Allow byte reads of AHCI registers.neel2015-05-071-4/+9
| | | | | | | | | | This is needed to support Windows guests that use byte reads to access certain AHCI registers (e.g. PxTFD.Status and PxTFD.Error). Reviewed by: grehan, mav Reported by: Leon Dang (ldang@nahannisys.com) Differential Revision: https://reviews.freebsd.org/D2469 MFC after: 2 weeks
* Add memory barrier to r281764.mav2015-05-061-14/+11
| | | | | | | While race at this point may cause only a single packet delay and so was not really reproduced, it is better to not have it at all. MFC after: 1 week
* Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup().neel2015-05-062-78/+81
| | | | | | | | | | | | | | | | | | Prior to this change both functions returned 0 for success, -1 for failure and +1 to indicate that an exception was injected into the guest. The numerical value of ERESTART also happens to be -1 so when these functions returned -1 it had to be translated to a positive errno value to prevent the VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce bugs when writing emulation code. Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if an exception was delivered to the guest. The return value is 0 or EFAULT so no additional translation is needed. Reviewed by: tychon MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D2428
* Reimplement queue freeze on error, added in r282429:mav2015-05-061-3/+9
| | | | | | | It is not required to use CLO to recover from task file error, it should be enough to do only stop/start, that does not clear the PxTFD.STS.ERR. MFC after: 13 days
* Implement in-order execution of non-NCQ commands.mav2015-05-041-6/+15
| | | | | | | | Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. This can be a performance penalization for non-NCQ commands, but it is required for proper error recovery and standard compliance. MFC after: 2 weeks
* Implement basic PxTFD.STS.BSY reporting.mav2015-05-031-13/+38
| | | | MFC after: 2 weeks
* Initialize PxCMD on reset and make its read-only bits such.mav2015-05-021-2/+16
| | | | MFC after: 2 weeks
* Handle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().mav2015-05-021-1/+2
| | | | MFC after: 1 week
* Advertise an additional memory BAR in the "dummy" device emulation.neel2015-05-021-15/+23
| | | | | | | This is useful for testing the MOVS emulation when both the source and destination addresses are in the MMIO space. MFC after: 1 week
* Implement the century byte in the RTC. Some guests require this field to beneel2015-04-281-1/+1
| | | | | | | properly set. Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks
* Don't allow guest to modify readonly bits in the PCI config 'status' register.neel2015-04-241-38/+49
| | | | | Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks
* Reassign copyright statements on several files from Advancedjhb2015-04-235-5/+5
| | | | | | | Computing Technologies LLC to Hudson River Trading LLC. Approved by: Hudson River Trading LLC (who owns ACT LLC) MFC after: 1 week
* Don't set bits that should be zero for SATA devices.mav2015-04-201-1/+0
| | | | | | Old value made Linux think that it is PATA device with SATA bridge. MFC after: 2 weeks
* Report link as up if tap device is not specified (black hole).mav2015-04-201-1/+1
| | | | MFC after: 2 weeks
* Report link as up only if we managed to open tap device.mav2015-04-201-2/+2
| | | | | | It would be cool to report tap device status, but it has no such API. MFC after: 2 weeks
* Disable RX/TX queues notifications when not needed.mav2015-04-201-0/+4
| | | | | | | This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* Workaround bhyve virtual disks operation on top of GEOM providers.mav2015-04-184-18/+100
| | | | | | | | | 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
* Make virtual AHCI more careful with I/O lengths.mav2015-04-171-92/+84
| | | | MFC after: 2 weeks
* If the number of guest vcpus is less than '1' then flag it as an error.neel2015-04-161-0/+5
| | | | MFC after: 1 week
* Prior to aborting due to an ioport error, it is always interesting totychon2015-04-151-2/+4
| | | | | | see what the guest's %rip is. Reviewed by: grehan
* Fix overlinking in bhyve:bapt2015-04-091-1/+1
| | | | libvmmapi is actually needed to be linked to libutil, not bhyve nor bhyveload
* Prior to aborting due to an instruction emulation error, it is alwaystychon2015-04-011-7/+12
| | | | | | interesting to see what the guest's %rip and instruction bytes are. Reviewed by: grehan
* Move legacy interrupt allocation for virtio devices to common code.grehan2015-03-273-4/+5
| | | | | | | | | | | | | | 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
* Add missing variable initialization.mav2015-03-201-1/+1
| | | | | | Reported by: Coverity CID: 1288938 MFC after: 3 days
* Report that we may have write cache, and that we do support FLUSH.mav2015-03-161-0/+2
| | | | | | 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.mav2015-03-162-8/+6
| | | | | | | 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
* Pre-allocate one extra request per processing thread.mav2015-03-151-1/+1
| | | | | | | Processing threads call callbacks before freeing requests. As result, new requests may arrive before old ones are freed. MFC after: 2 weeks
* According to Linux and QEMU, s/n equal to buffer is not zero-terminated.mav2015-03-151-1/+3
| | | | | | This makes same s/n reported for both virtio and AHCI drivers. MFC after: 2 weeks
* Close potential race on blockif_close().mav2015-03-151-0/+2
| | | | | Reported by: vangyzen MFC after: 2 weeks
* Fix networking problem after r280026.mav2015-03-153-2/+17
| | | | | | | | I've missed that network driver sometimes returns taken request back to available queue without processing. Add new helper function for that case. Reported by: flo MFC after: 2 weeks
* Give AHCI disk serial based on backing file path same as for virtio block.mav2015-03-151-4/+16
| | | | | | | It is still not good that they may intersect on different hosts, but that is better then intersecting on the same host. MFC after: 2 weeks
* Rewrite virtio block device driver to work asynchronously and use the blockmav2015-03-152-78/+76
| | | | | | | | | | | | | | | 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.mav2015-03-155-39/+24
| | | | | | | 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.
* Block delete capability for read-only devices.mav2015-03-152-2/+5
| | | | | Submitted by: neel MFC after: 2 weeks
* Give block I/O interface multiple (8) execution threads.mav2015-03-141-53/+76
| | | | | | | | | | | | On parallel random I/O this allows better utilize wide storage pools. To not confuse prefetcher on linear I/O, consecutive requests are executed sequentially, following the same logic as was earlier implemented in CTL. Benchmarks of virtual AHCI 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. MFC after: 2 weeks
OpenPOWER on IntegriCloud