summaryrefslogtreecommitdiff
path: root/sys/dev/pv
AgeCommit message (Collapse)Author
2016-01-28Older Xen dom0's don't implement setting version of Grant Table entriesMike Belopuhov
Remove leftover code that was used to set v2 of Grant Table entries. From Nathanael Rensen <nathanael at list ! polymorpheus ! com>, thanks!
2016-01-27Tighten up next reference calculation, printing fixesMike Belopuhov
2016-01-27Reimplement Grant Table metadata linking and enable dynamic allocationMike Belopuhov
Instead of pre-allocating maximum number of Grant Table frames allotted by the hypervisor we switch over to allocating them dynamically when the need arises. At the same time we no longer link metadata entries representing individual Grant Table frames as a list and use a table instead to speed up reference lookups when establishing and removing mappings.
2016-01-27xen_bus_dma_init turned out to be unnecessaryMike Belopuhov
2016-01-27shorten a few long linesMike Belopuhov
2016-01-27Add a key-value interface to pvbus(4) that allows to get or set valuesReyk Floeter
in the underlying information store of the host from the OpenBSD-VM's userspace. OpenBSD did not provide access to these stores before, mostly because we did not want to add a custom tool and interface for each hypervisor. The pvbus(4) interface provides backends for xen(4)'s XenStore and vmt(4)'s VMware Tools "guestinfo". These information stores are fairly different, XenStore is a "filesystem" while vmt is a RPC, and the key-value abstraction limits them a bit but provides the most wanted functionality. Discussed with many OK mikeb@
2016-01-26Convert membar_* operations to bus_dmamap_sync callsMike Belopuhov
2016-01-26Rewrite tx path to use flat transmit ring without fragment chainsMike Belopuhov
Xen doesn't provide transmit fragment chains so initially they were emulated but amount of grant table entries wasted in the process was astronomical (9 times more than after this change). So while code readability was sacrificed a bit, the change comes with a very nice transmit performance improvement and taxes grant table references much less than before.
2016-01-26Rename _{req,rsp}_evt descriptor structure members to _{prod,cons}_eventMike Belopuhov
Setting rxr_ and/or txr_cons_event value allows domU to delay completion notification for receive and/or transmit ring to specified values of consumer index. rxr_ and txr_prod_event values are updated by dom0 and don't seem to hold any significance for us.
2016-01-26No need to take a grant table entry mutex in xen_grant_table_{enter,remove}Mike Belopuhov
Grant table API is constructed in a way that once allocated grant table entries are marked as used and cannot be given away again to some other user. At the same time xen_grant_table_enter and _remove do not operate on the same grant reference at the same time, so there's no need for a lock here. Guard flag operations with memory fences to ensure correct store/load order. This provides some decent performance improvement as well.
2016-01-26Add a grant table reference invalidation spin out checkMike Belopuhov
This debugging check has been helpful in identifying and fixing a few issues already. Subject to removal in the future however.
2016-01-26Implement a rather conservative bus_dmamap_sync APIMike Belopuhov
2016-01-26Make sure to use locked atomic operations even on the SP kernelMike Belopuhov
When executed under the hypervisor we need to make sure that CAS and other atomic operations are executed while locking the bus. Problem reported by Imre Oolberg <imre at auul ! pri ! ee>, thanks!
2016-01-25Don't count the total number of Xen upcallsMike Belopuhov
2016-01-25Revert the minimum number of Rx ring slots back to 32Mike Belopuhov
Figured out the hard way by Jonathon Sisson <openbsd at j3z ! org>, thanks!
2016-01-23Fix some uses of sizeof where the size of a struct was intended, notJonathan Gray
the size of the pointer to a struct. ok mikeb@
2016-01-22Setup interface features based on capabilities provided by the backendMike Belopuhov
Instead of just setting bits that we think we need, do a better job of figuring out what's supported by the backend and what's not and what do we really need. The following improvements were implemented: o fallback for when scatter gather I/O is not supported by Dom0; o tcp/udp checksum offloading; o larger mtu up to 9000: an experimental feature; o stop requesting multicast control feature that we don't support.
2016-01-22Set minimum number of slots on the receive ring to 18Mike Belopuhov
After some experimentation, discussions with Xen folks and pondering Linux source code, it became clear that most versions of Xen require at least 18 slots available on the receive ring to send an event.
2016-01-22To facilitate reading make sure to use a GTF_invalid flag by nameMike Belopuhov
2016-01-22Convert membar_* calls into virtio_membar_sync where it mattersMike Belopuhov
membar_* functions are defined only as compiler barriers on !MP kernels, while we're trying to be conservative in our use of the barriers. Barriers are placed only where loads and stores might get reordered and it matters at the same time. Shared info page operations are using atomic instructions on Linux, so they get barriers as well.
2016-01-20Don't bump output errors when when tx ring is fullMike Belopuhov
Reported by Jonathon Sisson <openbsd at j3z ! org>, thanks!
2016-01-19Mask interrupts on boot, masking/unmasking is handled by stop/initMike Belopuhov
2016-01-19Fix a few issues in the xnf transmit pathMike Belopuhov
A crash reported by Jonathon Sisson is caused by incorrect calculation of available descriptors on the tx ring. While here, split the mbuf chain so that we won't unload the whole thing in the txeof before removing grant table references from transmit descriptors.
2016-01-19Cast evtchn_mask to a char pointer for an isset operationMike Belopuhov
When testing evtchn_mask bits we need to treat the array as a bit matrix for an isset macro to test correct bits. Reported by reyk@ some time ago, Wei Liu <wei ! liu2 at citrix !com> figured out how to reproduce the problem. Thanks!
2016-01-18Log unhandled interruptsMike Belopuhov
2016-01-18Provide a Xen v3 API compatible fallback for event channel hypercallsMike Belopuhov
2016-01-18Fixup a hang while performing a read operation on XenStoreMike Belopuhov
Reyk has reported an issue that turned out to be an incorrect calculation of bytes available for reading. This diff also places missed semaphore releases in the xs_start and makes 'left' a size_t in xs_ring_{get,put}.
2016-01-15Cleanup dmesg output, disable debugging; prodding and suggestions from reyk@Mike Belopuhov
2016-01-15Detach emulated network devices if Netfront driver is enabledMike Belopuhov
Xen doesn't provide a way for a guest to decide which model of the interface is selected in the VM configuration and therefore there's no simple way for Netfront and emulated devices to co- exist on the same system. Emulated em(4) or re(4) drivers will take over if xnf(4) driver is disabled or not compiled in. Idea and OK reyk
2016-01-14Fixup a merge errorMike Belopuhov
2016-01-13Bump number of tx fragments to the stock value of 18Mike Belopuhov
2016-01-13Implement transmit watchdog for testing purposesMike Belopuhov
2016-01-13spacing typosMike Belopuhov
2016-01-13Create rx and tx fragment maps with a page size boundary restrictionMike Belopuhov
We need to ensure that rx and tx fragments do not cross page boundary since grant table reference can only point to a complete page. Add a couple of kernel assertions in the dma map loading code to catch these problems early in the future.
2016-01-12A couple of unused variables have sneaked in from the debug codeMike Belopuhov
2016-01-12Convert XenStore code to free running producer/consumer indicesMike Belopuhov
After some hair pulling while implementing xnf(4) I've realised that Xen uses free running producer/consumer indices wrapping with their type (unsigned 32 bit integer). Later I've confirmed it with free chapters of the "The Definitive Guide to the Xen Hypervisor" by David Chisnall available online.
2016-01-11xs_cmd should always return errno(2) codesMike Belopuhov
2016-01-11Do not fail when receiving an empty reply (or directory node) inReyk Floeter
xs_intr() but put an empty message in the queue. This prevents xs_reply() from being stuck in an endless loop because it expectes a message in the queue to break out of it. Depends on mikeb@'s previous commit because it would otherwise panic on trying to cleanup the empty message. OK mikeb@
2016-01-11Handle zero lenght messages in the xs_parse by returning an empty stringMike Belopuhov
Problem was reported and analyzed by reyk@
2016-01-08mikeb@ doesn't like RCS ids, so I add the OpenBSD one for him.Reyk Floeter
2016-01-07Xen virtual networking interface (Netfront) driver.Mike Belopuhov
Encouragement from deraadt@, ok reyk
2016-01-05Move over to the v1 of Grant Table entriesMike Belopuhov
In spite of comments in the Xen source code encouraging use of v2 entries in the new code, there's no benefit for us to do so at the moment. While v1 entries support only full page mappings, they're half the size of their newer counterparts, increasing the number of available grant table references from 8000 to 16000 within the same allotment of grant table frames (up to 32).
2016-01-05Memorize the DMA segment's data offset within the pageMike Belopuhov
Grant table references don't convey the information about an actual offset of the data within the page, however Xen needs to know it. We (ab)use bus_dma_segment's _ds_boundary member to store it and can get away with not restoring it's original value atm because neither i386 nor amd64 bus_dmamap_unload(9) code needs it.
2016-01-04Skip "suspend" device node during probingMike Belopuhov
2016-01-04Include the node name into the error messageMike Belopuhov
2016-01-04Preallocate Grant Table frames to simplify the code for nowMike Belopuhov
2015-12-22Make xs_setprop a bit more useful by removing property nodesMike Belopuhov
when NULL or zero length value was specified.
2015-12-22Implement a bus_dma(9) abstraction on top of Grant Table APIMike Belopuhov
2015-12-21Introduce xen_intr_mask and xen_intr_unmask primitivesMike Belopuhov
Mask the event port during xen_intr_establish, but don't set the masked flag in the intsrc. By providing mask and unmask routines we allow the device to decide when to perform these actions. The port will still be unmasked during xen_intr_enable. This allows netfront to fulfil the intr_barrier pattern requirements fairly easily and at the same time should be sufficient for diskfront that doesn't need to fiddle with interrupt masking.
2015-12-21Cleanup hypercall subsystem type definesMike Belopuhov