summaryrefslogtreecommitdiff
path: root/sys/dev/pv
AgeCommit message (Collapse)Author
2017-06-04update link to Ken Kato's vmware backdoor protocol documentationJonathan Matthew
from Seth Jackson
2017-06-03vioblk/virtio: Re-arrange some struct membersStefan Fritsch
This reduces holes/padding and makes the structs smaller.
2017-06-02Perform grant table page allocation outside of the table mutexMike Belopuhov
witness(4) has found that km_alloc will trigger an rw_enter via uvm_map and vm_map_lock. While rw_enter is called with RW_SLEEPFAIL, there's also an msleep in there, so it's easier to avoid getting in the middle of that.
2017-05-31Optimize virtio_enqueue_trim() a bit by nuking unneededKenneth R Westerback
re-initializations of statically set fields. Move a common chunk out of both clauses of if/else. No intentional functional change. ok sf@
2017-05-30More minor virtio tweaksStefan Fritsch
* add some comments about virtio_enqueue_trim * include mutex.h explicitly * make VIRTIO_DEBUG == 1 less verbose in vioblk ok krw@
2017-05-30Replace nifty DBGPRINT() with a more familiar DPRINTF() and adjustKenneth R Westerback
the formats to add in the __func__ and "\n" being magically added by DBGPRINT(). Fixes a few botches by certain devs who assumed DBGPRINT() must be just like DPRINTF. ok sf@ reyk@ on earlier version
2017-05-30Statically allocate resource to requests, and only create requestsKenneth R Westerback
that there will be resources for. Protect request list with a mutex. Makes everything much more scsi-like. Fewer splbio() dances. Uses less memory and eliminates superfluous freeing and acquiring of the same resources over and over. ok sf@
2017-05-30virtio: Put entries in freelist in reverse orderStefan Fritsch
This avoids breaking krw@'s ongoing work on improving virtio_enqueue_trim().
2017-05-30virtio: Do LIFO in the freelistStefan Fritsch
Use a SLIST instead of a SIMPLEQ and use LIFO instead of FIFO. This should improve cache usage.
2017-05-27virtio: remove unused vq_maxsegsizeStefan Fritsch
2017-05-27virtio: Remove MINSEG_INDIRECTStefan Fritsch
Remove MINSEG_INDIRECT as a tweakable define. Always use indirect descriptors if we have more than 1 segment. Add a comment to document the way if_vio.c uses maxnsegs in virtio_alloc_vq() to disable indirect descriptors for a queue. Based on a diff from krw@
2017-05-27Move error path to end of function where god intended itKenneth R Westerback
to be. goto'ing upwards into an 'if' statement block is weird. ok sf@
2017-05-26virtio: minor tweakStefan Fritsch
use qe_desc_base instead of calculating the address again
2017-05-26vioblk: set VIOBLK_DONE from vioblk_vq_done1Stefan Fritsch
If the device needs to be reset due to a poll timeout, we need accurate information which requests are already completed. Otherwise, there will be a panic "scsi_done called twice on xs", as found out by mpi@
2017-05-26Move vioblk and vioscsi more fully into the world of iopool andKenneth R Westerback
'modern' scsi. Eliminates use of XS_NO_CCB. Resource optimization to follow. ok sf@, "makes sense" dlg@ earlier version
2017-05-15vioscsi: Fix allocation of segmentsStefan Fritsch
Port the logic to calculate the number of segments in virtqueue and dmamaps from vioblk. This fixes the virtqueue indirect descriptors being two entries too small the dmamaps being much larger than necessary. If the device does not support the required number of segments, refuse to use it.
2017-05-14Align vioscsi's bus_dma* dancing with vioblk. EliminatesKenneth R Westerback
creating/destroying maps on each i/o. ok sf@, "makes sense" dlg@ as part of larger diff.
2017-05-02Resynchronize the guest RTC via vmmci(4) on host resume from zzz/ZZZMike Larkin
(kernel part) This feature is for OpenBSD guests only. ok reyk, kettenis
2017-03-26Add a #define needed for an upcoming vmd commit (to reflect a failureMike Larkin
when an operation was requested from vioblk host devices that is not supported except on qemu).
2017-03-19Improve comments slightlyMike Belopuhov
2017-03-19Fixup starting block number calculation for bounced transfersMike Belopuhov
From Nathanael Rensen, thanks!
2017-03-19Fixup return values to properly handle transfer submission errorsMike Belopuhov
From Nathanael Rensen, thanks!
2017-03-16vioscsi: Negotiate features during attachStefan Fritsch
While vioscsi does not support any virtio-scsi features, we need to call virtio_negotiate_features() in order to negotiate device-independent features like VIRTIO_F_RING_INDIRECT_DESC.
2017-03-16vioscsi: return XS_NO_CCB if out of spaceStefan Fritsch
If there is not enough space in the vring, don't return XS_DRIVER_STUFFUP but XS_NO_CCB, so that the operation will be retried later.
2017-03-16vioscsi: Don't call virtio_dequeue_commit on not-queued slotsStefan Fritsch
Also, add some debug asserts all over the place.
2017-03-15Improve vmmci(4) shutdown and reboot.Reyk Floeter
This change handles various cases to power off the VM, even if it is unresponsive, stuck in ddb, or when the shutdown was initiated from the VM guest side. Usage of timeout and VM ACKs make sure that the VM is really turned off at some point. OK mlarkin@
2017-03-13Fixup format strings in debug messages found by cppcheckMike Belopuhov
2017-03-13Fixup format string and type issues found by cppcheckMike Belopuhov
2017-03-09Fix an off by one when updating the TX consumer event indexMike Belopuhov
The transmit completion notification is posted when the consumer index becomes equal to the consumer event index. The code attempted to save up on an update if the current value of the consumer index was below its event index, but incorrectly handled the situation when they were equal: the consumer event index wouldn't be advanced and the ring would stall. With help from Jan Schreiber who asked some good questions.
2017-02-24Update licenseMike Belopuhov
Some final touches before the release, increase the maximum number of CAS iterations before we declare the grant table entry lost forever. This happens on older Xen 3.x versions as reported by Kirill Miazine.
2017-02-23Add missing mtx_leave() calls in two hypervic error pathsJonathan Gray
ok mikeb@
2017-02-12Remove incorrect if statementMike Belopuhov
Pointed out by jsg@ and Nathanael Rensen, <nathanael at list ! polymorpheus ! com>, thanks!
2017-02-08Improve error handling for poll timeoutsMike Belopuhov
2017-02-08Specify the read/write DMA flag for bounce buffersMike Belopuhov
2017-02-08Cleanup the device removal pathMike Belopuhov
When destroying the ring all transfers should be already gone so there should be no need to repeat ourselves after xbf_stop has done its work. Get rid of the yield() that was probably masking some issues that have been since fixed.
2017-02-08Switch to Xen interrupt barrier and improve state transitionsMike Belopuhov
2017-02-08Abort transactions with non-retriable error when device is stoppedMike Belopuhov
2017-02-08Switch to Xen interrupt barrierMike Belopuhov
2017-02-08Introduce Xen interrupt barriersMike Belopuhov
intr_barrier(9) is useful to make sure that after an interrupt is masked, the interrupt handler for the device has finished executing before proceeding with further device configuration. However, since Xen interrupt handlers run in the thread context, we need to make sure that they have finished as well. By scheduling a xen_barrier_task modelled after (or rather copied ;) ifq_barrier_task we can ensure that the interrupt handler is no longer running.
2017-02-08Fixup incorrect test when allocating grant table entriesMike Belopuhov
An xnf & xbf attach/detach loop has revealed that sometimes when we're about to free a grant table entry that is still in use which is a grave mistake code wise. Turned out we could allocate an entry twice because of an incorrect test that took flags value into account when making the decision regarding availability of a given entry. At the same time, upon releasing the entry we explicitly CAS in 0 into the flags making this check bogus. While here be explicit about starting flags by initializing them to 0 and always panic when the "double free" condition is encountered. rzalamena@ has lent me his eyes and has double-checked the condition.
2017-02-07Make the 'incomplete header' message debug onlyMike Belopuhov
2017-02-06Add proper locking for the interrupt source listMike Belopuhov
Now that we can attach and detach devices, we need to make sure we can do so while interrupts are running. Thankfully, in the meantime the refcnt_init(9) API came around to help us out.
2017-02-06XST_POLL turned out to be pretty useless since it's only set when coldMike Belopuhov
2017-02-06Fixup a few errors, make detaching more robustMike Belopuhov
2017-02-06Use separate compile time debug flags for xen, xnf and xbfMike Belopuhov
2017-02-03yasuoka@ reported that a "guest shutdown" resulted in a reboot insteadJonathan Gray
of a shutdown. Correct a mistake in rev 1.11 to make this trigger a shutdown again. ok reyk@
2017-01-31Issue a pause instruction in the busy-wait loop on SP kernels as wellMike Belopuhov
2017-01-24add support for multiple transmit ifqueues per network interface.David Gwynne
an ifq to transmit a packet is picked by the current traffic conditioner (ie, priq or hfsc) by providing an index into an array of ifqs. by default interfaces get a single ifq but can ask for more using if_attach_queues(). the vast majority of our drivers still think there's a 1:1 mapping between interfaces and transmit queues, so their if_start routines take an ifnet pointer instead of a pointer to the ifqueue struct. instead of changing all the drivers in the tree, drivers can opt into using an if_qstart routine and setting the IFXF_MPSAFE flag. the stack provides a compatability wrapper from the new if_qstart handler to the previous if_start handlers if IFXF_MPSAFE isnt set. enabling hfsc on an interface configures it to transmit everything through the first ifq. any other ifqs are left configured as priq, but unused, when hfsc is enabled. getting this in now so everyone can kick the tyres. ok mpi@ visa@ (who provided some tweaks for cnmac).
2017-01-22define virtio in conf/filesReyk Floeter
This unbreaks build on archs that are non-pv but PCI because I moved virtio out of files.pci but kept a virtio dependency for the virtio_pci driver. Issue report and fix suggested by visa@ and miod@
2017-01-22move counting if_opackets next to counting if_obytes in if_enqueue.David Gwynne
this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@