summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add checksums to identify data and NCQ command error log.mav2015-03-141-0/+16
| | | | MFC after: 2 weeks
* Slightly polish virtual AHCI CD reporting.mav2015-03-141-23/+67
| | | | MFC after: 2 weeks
* Fix NOP and IDLE commands for virtual AHCI disks.mav2015-03-141-2/+5
| | | | MFC after: 2 weeks
* Add support for NCQ variant of DSM TRIM for virtual AHCI disks.mav2015-03-141-4/+24
| | | | | | | The code is not really tested yet due to lack of initiator support. Requested by: imp MFC after: 2 weeks
* Improve NCQ errors reporting for virtual AHCI disks.mav2015-03-141-11/+53
| | | | | | While this implementation is still not perfect, previous was just broken. MFC after: 2 weeks
* Remove incorrect SERR register setting.mav2015-03-131-2/+0
| | | | | | At this point we have nothing to report through that register. MFC after: 2 weeks
* Change prdbc value reporting.mav2015-03-131-7/+6
| | | | MFC after: 2 weeks
* Polish AHCI disk identify data and fix speed negotiation.mav2015-03-132-17/+49
| | | | MFC after: 2 weeks
* Add support for PIO variants of READ/WRITE commands for AHCI disks.mav2015-03-131-4/+16
| | | | | | AHCI API hides all PIO specifics, so this functionality is almost free. MFC after: 2 weeks
* Use ahci_write_fis_d2h() for commands completion.mav2015-03-131-21/+11
| | | | MFC after: 2 weeks
* Add DSM TRIM command support for virtual AHCI disks.mav2015-03-133-8/+166
| | | | | | | | It works only for virtual disks backed by ZVOLs and raw devices supporting BIO_DELETE. Virtual disks backed by files won't report this capability. MFC after: 2 weeks Relnotes: yes
* Add variable initialization missed by me and clang.mav2015-03-051-0/+1
| | | | | Reported by: grehan MFC after: 2 weeks
* Fix error translation broken in r279658.mav2015-03-051-6/+5
| | | | | Reported by: grehan MFC after: 2 weeks
* Implement cache flush for ahci-hd and for virtio-blk over device.mav2015-03-052-3/+18
| | | | MFC after: 2 weeks
* Add check for absent stripe size to r279652.mav2015-03-051-1/+1
| | | | MFC after: 2 weeks
* Report logical/physical sector sizes for virtual SATA disk.mav2015-03-053-3/+36
| | | | MFC after: 2 weeks
* Add support for TOPOLOGY feature of virtio block device.mav2015-03-051-12/+32
| | | | | | | 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
* Emulate MSR 0xC0011024 when running on AMD processors.neel2015-02-241-0/+9
| | | | | | | | OpenBSD guests test bit 0 of this MSR to detect whether the workaround for erratum 721 has been applied. Reported by: Jason Tubnor (jason@tubnor.net) MFC after: 1 week
* Add "-u" option to bhyve(8) to indicate that the RTC should maintain UTC time.neel2015-02-244-13/+21
| | | | | | | | | | The default remains localtime for compatibility with the original device model in bhyve(8). This is required for OpenBSD guests which assume that the RTC keeps UTC time. Reviewed by: grehan Pointed out by: Jason Tubnor (jason@tubnor.net) MFC after: 2 weeks
* Don't close a block context if it couldn't be opened,grehan2015-02-231-1/+2
| | | | | | | | for example if the backing file doesn't exist, avoiding a null deref. Reviewed by: neel MFC after: 1 week.
* Simplify instruction restart logic in bhyve.neel2015-01-184-51/+35
| | | | | | | | | | | | | | | | | | | | | | Keep track of the next instruction to be executed by the vcpu as 'nextrip'. As a result the VM_RUN ioctl no longer takes the %rip where a vcpu should start execution. Also, instruction restart happens implicitly via 'vm_inject_exception()' or explicitly via 'vm_restart_instruction()'. The APIs behave identically in both kernel and userspace contexts. The main beneficiary is the instruction emulation code that executes in both contexts. bhyve(8) VM exit handlers now treat 'vmexit->rip' and 'vmexit->inst_length' as readonly: - Restarting an instruction is now done by calling 'vm_restart_instruction()' as opposed to setting 'vmexit->inst_length' to 0 (e.g. emulate_inout()) - Resuming vcpu at an arbitrary %rip is now done by setting VM_REG_GUEST_RIP as opposed to changing 'vmexit->rip' (e.g. vmexit_task_switch()) Differential Revision: https://reviews.freebsd.org/D1526 Reviewed by: grehan MFC after: 2 weeks
* Replace bhyve's minimal RTC emulation with a fully featured one in vmm.ko.neel2014-12-301-279/+26
| | | | | | | | | | | | | | | | | | | | | The new RTC emulation supports all interrupt modes: periodic, update ended and alarm. It is also capable of maintaining the date/time and NVRAM contents across virtual machine reset. Also, the date/time fields can now be modified by the guest. Since bhyve now emulates both the PIT and the RTC there is no need for "Legacy Replacement Routing" in the HPET so get rid of it. The RTC device state can be inspected via bhyvectl as follows: bhyvectl --vm=vm --get-rtc-time bhyvectl --vm=vm --set-rtc-time=<unix_time_secs> bhyvectl --vm=vm --rtc-nvram-offset=<offset> --get-rtc-nvram bhyvectl --vm=vm --rtc-nvram-offset=<offset> --set-rtc-nvram=<value> Reviewed by: tychon Discussed with: grehan Differential Revision: https://reviews.freebsd.org/D1385 MFC after: 2 weeks
* Convert usr.sbin to LIBADDbapt2014-11-251-3/+2
| | | | Reduce overlinking
* Fix improper .Fx macro usage.trasz2014-11-191-1/+2
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1158 Reviewed by: wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* To allow a request to be submitted from within the callback routine oftychon2014-11-091-2/+2
| | | | | | a completing one increase the total by 1 but don't advertise it. Reviewed by: grehan
* Improve the ability to cancel an in-flight request by using antychon2014-11-041-24/+146
| | | | | | | interrupt, via SIGCONT, to force the read or write system call to return prematurely. Reviewed by: grehan
* If the start bit, PxCMD.ST, is cleared and nothing is in-flight thentychon2014-11-031-2/+6
| | | | | | PxCI, PxSACT, PxCMD.CCS and PxCMD.CR should be 0. Reviewed by: grehan
* Add a comment explaining the intent behind the I/O reservation [0x72-0x77].neel2014-10-261-0/+4
|
* Move the ACPI PM timer emulation into vmm.ko.neel2014-10-262-174/+0
| | | | | | | | | This reduces variability during timer calibration by keeping the emulation "close" to the guest. Additionally having all timer emulations in the kernel will ease the transition to a per-VM clock source (as opposed to using the host's uptime keep track of time). Discussed with: grehan
* IFC @r273214neel2014-10-202-25/+148
|
* Don't advertise the "OS visible workarounds" feature in cpuid.80000001H:ECX.neel2014-10-191-0/+25
| | | | | | | | | | | | | bhyve doesn't emulate the MSRs needed to support this feature at this time. Don't expose any model-specific RAS and performance monitoring features in cpuid leaf 80000007H. Emulate a few more MSRs for AMD: TSEG base address, TSEG address mask and BIOS signature and P-state related MSRs. This eliminates all the unimplemented MSRs accessed by Linux/x86_64 kernels 2.6.32, 3.10.0 and 3.17.0.
* Don't advertise the Instruction Based Sampling feature because it requiresneel2014-10-171-0/+13
| | | | | | | | emulating a large number of MSRs. Ignore writes to a couple more AMD-specific MSRs and return 0 on read. This further reduces the unimplemented MSRs accessed by a Linux guest on boot.
OpenPOWER on IntegriCloud