summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
Commit message (Collapse)AuthorAgeFilesLines
* MFC r282344: Handle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().mav2015-05-131-1/+2
|
* MFC r281766, r281767:mav2015-05-131-2/+2
| | | | | | Report link as up only if we managed to open tap device. It would be cool to report tap device status, but it has no such API.
* MFC r281764, r282563: Disable RX/TX queues notifications when not needed.mav2015-05-131-14/+15
| | | | | | This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s. Sponsored by: iXsystems, Inc.
* MFC r281782: Don't set bits that should be zero for SATA devices.mav2015-05-011-1/+0
| | | | Old value made Linux think that it is PATA device with SATA bridge.
* MFC r281700:mav2015-05-014-18/+100
| | | | | | | | | 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 r281666: Make virtual AHCI more careful with I/O lengths.mav2015-05-011-92/+84
|
* MFC r272481.neel2015-04-061-1/+4
| | | | Add new fields in the FADT, required by IASL 20140926-64.
* MFC r280154:mav2015-03-271-0/+2
| | | | Report that we may have write cache, and that we do support FLUSH.
* MFC r280133: Increase S/G list size of 32 to 33 entries.mav2015-03-272-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 r280126: Pre-allocate one extra request per processing thread.mav2015-03-271-1/+1
| | | | | Processing threads call callbacks before freeing requests. As result, new requests may arrive before old ones are freed.
* MFC r280044:mav2015-03-271-1/+3
| | | | | | 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 r280042: Close potential race on blockif_close().mav2015-03-271-0/+2
| | | | Reported by: vangyzen
* MFC r280040:mav2015-03-271-4/+16
| | | | | | | Give AHCI disk serial based on backing file path same as for virtio block. It is still not good that they may intersect on different hosts, but that is better then intersecting on the same host.
* MFC r280037:mav2015-03-272-78/+76
| | | | | | | | | | | | | | 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 r280026, r280041:mav2015-03-275-41/+41
| | | | | | | | | 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.
* MFC r280004: Give block I/O interface multiple (8) execution threads.mav2015-03-271-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 r279987: Add checksums to identify data and NCQ command error log.mav2015-03-271-0/+16
|
* MFC r279979: Slightly polish virtual AHCI CD reporting.mav2015-03-271-23/+67
|
* MFC r279977: Fix NOP and IDLE commands for virtual AHCI disks.mav2015-03-271-2/+5
|
* MFC r279976: Add support for NCQ variant of DSM TRIM for virtual AHCI disks.mav2015-03-271-4/+24
| | | | The code is not really tested yet due to lack of initiator support.
* MFC r279975: Improve NCQ errors reporting for virtual AHCI disks.mav2015-03-271-11/+53
| | | | While this implementation is still not perfect, previous was just broken.
* MFC r279968: Remove incorrect SERR register setting.mav2015-03-271-2/+0
| | | | At this point we have nothing to report through that register.
* MFC r279967: Change prdbc value reporting.mav2015-03-271-7/+6
|
* MFC r279965: Polish AHCI disk identify data and fix speed negotiation.mav2015-03-272-17/+49
|
* MFC r279960:mav2015-03-271-4/+16
| | | | | | Add support for PIO variants of READ/WRITE commands for AHCI disks. AHCI API hides all PIO specifics, so this functionality is almost free.
* MFC r279975: Use ahci_write_fis_d2h() for commands completion.mav2015-03-271-21/+11
|
* MFC r279957, r280017: Add DSM TRIM command support for virtual AHCI disks.mav2015-03-233-8/+169
| | | | | | | 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. Relnotes: yes
* MFC r280293: Add missing variable initialization.mav2015-03-231-1/+1
| | | | | Reported by: Coverity CID: 1288938
* MFC r279658, r279673, r279675:mav2015-03-192-9/+24
| | | | Implement cache flush for ahci-hd and for virtio-blk over device.
* MFC r279654: Report logical/physical sector sizes for virtual SATA disk.mav2015-03-193-3/+36
|
* MFC r279651, r279652, r279657:mav2015-03-191-12/+32
| | | | | | | 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 r273683neel2014-12-305-202/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the ACPI PM timer emulation into vmm.ko. MFC r273706 Change the type of the first argument to the I/O emulation handlers to 'struct vm *'. MFC r273710 Add a comment explaining the intent behind the I/O reservation [0x72-0x77]. MFC r273744 Add foo_genassym.c files to DPSRCS so dependencies for them are generated. This ensures these objects are rebuilt to generate an updated header of assembly constants if needed. MFC r274045 If the start bit, PxCMD.ST, is cleared and nothing is in-flight then PxCI, PxSACT, PxCMD.CCS and PxCMD.CR should be 0. MFC r274076 Improve the ability to cancel an in-flight request by using an interrupt, via SIGCONT, to force the read or write system call to return prematurely. MFC r274330 To allow a request to be submitted from within the callback routine of a completing one increase the total by 1 but don't advertise it. MFC r274931 Change the lower bound for guest vmspace allocation to 0 instead of using the VM_MIN_ADDRESS constant. MFC r275817 For level triggered interrupts clear the PIC IRR bit when the interrupt pin is deasserted. MFC r275850 Fix 8259 IRQ priority resolver. MFC r275952 Various 8259 device model improvements. MFC r275965 Emulate writes to the IA32_MISC_ENABLE MSR.
* MFC r273375neel2014-12-302-2/+117
| | | | | | | | | | | | | | | | | | | | | | Add support AMD processors with the SVM/AMD-V hardware extensions. MFC r273749 Remove bhyve SVM feature printf's now that they are available in the general CPU feature detection code. MFC r273766 Add missing 'break' pointed out by Coverity CID 1249760. MFC r276098 Allow ktr(4) tracing of all guest exceptions via the tunable "hw.vmm.trace_guest_exceptions" MFC r276392 Inject #UD into the guest when it executes either 'MONITOR' or 'MWAIT' on an AMD/SVM host. MFC r276402 Remove "svn:mergeinfo" property that was dragged along when these files were svn copied in r273375.
* MFC r270326neel2014-12-289-41/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a recursive lock acquisition in vi_reset_dev(). MFC r270434 Return the spurious interrupt vector (IRQ7 or IRQ15) if the atpic cannot find any unmasked pin with an interrupt asserted. MFC r270436 Fix a bug in the emulation of CPUID leaf 0x4. MFC r270437 Add "hw.vmm.topology.threads_per_core" and "hw.vmm.topology.cores_per_package" tunables to modify the default cpu topology advertised by bhyve. MFC r270855 Set the 'inst_length' to '0' early on before any error conditions are detected in the emulation of the task switch. If any exceptions are triggered then the guest %rip should point to instruction that caused the task switch as opposed to the one after it. MFC r270857 The "SUB" instruction used in getcc() actually does 'x -= y' so use the proper constraint for 'x'. The "+r" constraint indicates that 'x' is an input and output register operand. While here generate code for different variants of getcc() using a macro GETCC(sz) where 'sz' indicates the operand size. Update the status bits in %rflags when emulating AND and OR opcodes. MFC r271439 Initialize 'bc_rdonly' to the right value. MFC r271451 Optimize the common case of injecting an interrupt into a vcpu after a HLT by explicitly moving it out of the interrupt shadow. MFC r271888 Restructure the MSR handling so it is entirely handled by processor-specific code. MFC r271890 MSR_KGSBASE is no longer saved and restored from the guest MSR save area. This behavior was changed in r271888 so update the comment block to reflect this. MFC r271891 Add some more KTR events to help debugging. MFC r272197 mmap(2) requires either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. MFC r272395 Get rid of code that dealt with the hardware not being able to save/restore the PAT MSR on guest exit/entry. This workaround was done for a beta release of VMware Fusion 5 but is no longer needed in later versions. All Intel CPUs since Nehalem have supported saving and restoring MSR_PAT in the VM exit and entry controls. MFC r272670 Inject #UD into the guest when it executes either 'MONITOR' or 'MWAIT'. MFC r272710 Implement the FLUSH operation in the virtio-block emulation. MFC r272838 iasl(8) expects integer fields in data tables to be specified as hexadecimal values. Therefore the bit width of the "PM Timer Block" was actually being interpreted as 50-bits instead of the expected 32-bit. This eliminates an error message emitted by a Linux 3.17 guest during boot: "Invalid length for FADT/PmTimerBlock: 50, using default 32" MFC r272839 Support Intel-specific MSRs that are accessed when booting up a linux in bhyve: - MSR_PLATFORM_INFO - MSR_TURBO_RATIO_LIMITx - MSR_RAPL_POWER_UNIT MFC r273108 Emulate "POP r/m". This is needed to boot OpenBSD/i386 MP kernel in bhyve. MFC r273212 Support stopping and restarting the AHCI command list via toggling PxCMD.ST from '1' to '0' and back. This allows the driver a chance to recover if for instance a timeout occurred due to activity on the host.
* MFC r272007grehan2014-09-251-1/+1
| | | | | | | | | | | | | | | | Correct display of bhyve SMBIOS UUIDs with dmidecode by bumping the version. The mixed little/big-endianness of SMBIOS UUIDs was clarified in v2.6 of the SMBIOS spec. dmidecode uses the reported version of SMBIOS to determine the layout and what to byte-swap. bhyve's SMBIOS reported as 2.4 though it implemented the 2.6-style of memory layout. This resulted in dmidecode reporting a different UUID than one passed in via the -U option. Fix by exporting a version of 2.6. Approved by: re (gjb)
* MFC r271711:gjb2014-09-221-2/+2
| | | | | | | | Update the bhyve(8) manual to reflect that it is no longer considered 'experimental.' Approved by: re (delphij) Sponsored by: The FreeBSD Foundation
* MFC virtio-net changes.grehan2014-09-165-19/+73
| | | | | | | | | | | | | | | | | | | | Re-tested with NetBSD/amd64 5.2.2, 6.1.4 and 7-beta. r271299: Add a callback to be notified about negotiated features. r271338: Allow vtnet operation without merged rx buffers. NetBSD's virtio-net implementation doesn't negotiate the merged rx-buffers feature. To support this, check to see if the feature was negotiated, and then adjust the operation of the receive path accordingly by using a larger iovec, and a smaller rx header. In addition, ignore writes to the (read-only) status byte. Approved by: re (glebius) Obtained from: Vincenzo Maffione, Universita` di Pisa (r271299)
* MFC r267921, r267934, r267949, r267959, r267966, r268202, r268276,grehan2014-08-1921-225/+1387
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r268427, r268428, r268521, r268638, r268639, r268701, r268777, r268889, r268922, r269008, r269042, r269043, r269080, r269094, r269108, r269109, r269281, r269317, r269700, r269896, r269962, r269989. Catch bhyve up to CURRENT. Lightly tested with FreeBSD i386/amd64, Linux i386/amd64, and OpenBSD/amd64. Still resolving an issue with OpenBSD/i386. Many thanks to jhb@ for all the hard work on the prior MFCs ! r267921 - support the "mov r/m8, imm8" instruction r267934 - document options r267949 - set DMI vers/date to fixed values r267959 - doc: sort cmd flags r267966 - EPT misconf post-mortem info r268202 - use correct flag for event index r268276 - 64-bit virtio capability api r268427 - invalidate guest TLB when cr3 is updated, needed for TSS r268428 - identify vcpu's operating mode r268521 - use correct offset in guest logical-to-linear translation r268638 - chs value r268639 - chs fake values r268701 - instr emul operand/address size override prefix support r268777 - emulation for legacy x86 task switching r268889 - nested exception support r268922 - fix INVARIANTS build r269008 - emulate instructions found in the OpenBSD/i386 5.5 kernel r269042 - fix fault injection r269043 - Reduce VMEXIT_RESTARTs in task_switch.c r269080 - fix issues in PUSH emulation r269094 - simplify return values from the inout handlers r269108 - don't return -1 from the push emulation handler r269109 - avoid permanent sleep in vm_handle_hlt() r269281 - list VT-x features in base kernel dmesg r269317 - Mark AHCI fatal errors as not completed r269700 - Support PCI extended config space in bhyve r269896 - Minor cleanup r269962 - use max guest memory when creating IOMMU domain r269989 - fix interrupt mode names
* MFC r267311, r267330, r267811, r267884grehan2014-08-173-19/+8
| | | | | | | | | | | | Turn on interrupt window exiting unconditionally when an ExtINT is being injected into the guest. Add helper functions to populate VM exit information for rendezvous and astpending exits. Provide APIs to directly get 'lowmem' and 'highmem' size directly. Expose the amount of resident and wired memory from the guest's vmspace
* MFC r266933grehan2014-08-172-1/+13
| | | | | Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doing it implicitly in vmm.ko.
* MFC 266424,266476,266524,266573,266595,266626,266627,266633,266641,266642,jhb2014-07-225-50/+144
| | | | | | | | 266708,266724,266934,266935,268521: Emulation of the "ins" and "outs" instructions. Various fixes for translating guest linear addresses to guest physical addresses.
* MFC 266125:jhb2014-07-2212-61/+609
| | | | | Implement a PCI interrupt router to route PCI legacy INTx interrupts to the legacy 8259A PICs.
* MFC 264353,264509,264768,264770,264825,264846,264988,265114,265165,265365,jhb2014-07-2113-64/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | 265941,265951,266390,266550,266910: Various bhyve fixes: - Don't save host's return address in 'struct vmxctx'. - Permit non-32-bit accesses to local APIC registers. - Factor out common ioport handler code. - Use calloc() in favor of malloc + memset. - Change the vlapic timer frequency to be in the ballpark of contemporary hardware. - Allow the guest to read the TSC via MSR 0x10. - A VMCS is always inactive when it exits the vmx_run() loop. Remove redundant code and the misleading comment that suggest otherwise. - Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest. Add KTR tracepoints to annotate wrmsr and rdmsr VM exits. - Provide an alias for the userboot console and name it 'comconsole'. - Use EV_ADD to create an mevent and EV_ENABLE to enable it. - abort(3) the process in response to a VMEXIT_ABORT. - Don't include the guest memory segments in the bhyve(8) process core dump. - Make the vmx asm code dtrace-fbt-friendly. - Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in the VCPU_RUNNING state. - Enable VMX in the IA32_FEATURE_CONTROL MSR if it not enabled and the MSR isn't locked.
* MFC 263780,264516,265062,265101,265203,265364:jhb2014-07-211-20/+53
| | | | | | | | | | | | Add an ioctl to suspend a virtual machine (VM_SUSPEND). Add logic in the HLT exit handler to detect if the guest has put all vcpus to sleep permanently by executing a HLT with interrupts disabled. When this condition is detected the guest with be suspended with a reason of VM_SUSPEND_HALT and the bhyve(8) process will exit. This logic can be disabled via the tunable 'hw.vmm.halt_detection'.
* MFC 264916,267611:jhb2014-07-213-4/+86
| | | | Provide a very basic stub for the 8042 PS/2 keyboard controller.
* MFC 260847,264055,264867:jhb2014-07-214-1/+194
| | | | | | | - Add a very simple virtio_random(4) driver for FreeBSD guests to harvest entropy from hypervisors. - Add support to bhyve for the virtio RNG entropy-source device to provide entry to bhyve guests.
* MFC 263432,265366,265376:jhb2014-07-194-39/+67
| | | | | | | Fixes for vcpu management in bhyve: - Use 'cpuset_t' to represent the vcpus active in a virtual machine. - Modify the "-p" option to be more flexible when associating a 'vcpu' with a 'hostcpu'.
* MFC 262884,263236,265407:jhb2014-07-192-55/+102
| | | | | | | | Various uart fixes: - Open the uart emulation's backing tty in non-blocking mode. - Support 16-bit register access. - Disable the 'uart_drain()' callback when the emulated receive FIFO is full.
* MFC 259942,262274,263035,263054,263211,263744,264179,264324,264468,264631,jhb2014-07-198-502/+64
| | | | | 264648,264650,264651,266572,267558: Flesh out the AT PIC and 8254 PIT emulations and move them into the kernel.
* MFC 261904,261905,262143,262184,264921,265211,267169,267292,267294:jhb2014-07-198-198/+426
| | | | | | | | | | | Various PCI fixes: - Allow PCI devices to be configured on all valid bus numbers from 0 to 255. - Tweak the handling of PCI capabilities in emulated devices to remove the non-standard zero capability list terminator. - Add a check to validate that memory BARs of passthru devices are 4KB aligned. - Respect and track the enable bit in the PCI configuration address word. - Handle quad-word access to 32-bit register pairs.
OpenPOWER on IntegriCloud