History | View | Annotate | Download (27.6 kB)
Revert "virtio: Add PCI memory BAR in addition to PIO BAR"
This reverts commit 46d95bfec7f9429d5228078219413d7e33496d65.
virtio: Add PCI memory BAR in addition to PIO BAR
Currently, virtio devices are usually presented to the guest as anemulated PCI device, virtio_pci. Although the actual IO operationsare done through system memory, the configuration of the virtio device...
hw/9pfs: Use ioeventfd for 9p
With ioeventfd:[root@qemu-img-64 storage]# dd if=/dev/zero of=/storage/testx bs=8k count=131072 oflag=direct131072+0 records in131072+0 records out1073741824 bytes (1.1 GB) copied, 26.767 s, 40.1 MB/s
Without:[root@qemu-img-64 storage]# dd if=/dev/zero of=/storage/testx bs=8k count=131072 oflag=direct...
msix: convert to memory API
The msix table is defined as a subregion, to allow for a BAR thatmixes device specific regions with the msix table.
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>...
pci: rename pci_register_bar_region() to pci_register_bar()
Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-pci: convert to memory API
except msix.
[jan: fix build][aliguori: fix build]
Merge remote-tracking branch 'mst/for_anthony' into staging
virtio-balloon: Add exit handler, fix memleaks
Add an exit handler that will free up RAM after a virtio-balloon deviceis unplugged.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
virtio-balloon: Check if balloon registration failed
Multiple balloon registrations are not allowed; check if theregistration with the qemu balloon api succeeded. If not, fail thedevice init.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>...
virtio-pci: use generic logic for command access
In practice, guests don't generate config requeststhat cross a word boundary, so the logic todetect command word access is correct becausePCI_COMMAND is 0x4. But depending on this istricky, further, it will break with guests...
virtio-blk: Turn drive serial into a qdev property
It needs to be a qdev property, because it belongs to the drive'sguest part. Precedence: commit a0fef654 and 6ced55a5.
Bonus: info qtree now shows the serial number.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
Merge remote-tracking branch 'origin/master' into pci
Conflicts: hw/virtio-pci.c
virtio-pci.c: convert to PCIDEviceInfo to initialize ids
use PCIDeviceInfo to initialize ids.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio: guard against negative vq notifies
The virtio_queue_notify() function checks that the virtqueue number isless than the maximum number of virtqueues. A signed comparison is usedbut the virtqueue number could be negative if a buggy or malicious guest...
virtio-9p: Move 9p device registration into virtio-9p.c
This patch move the 9p device registration into its own file
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
PXE: Use consistent naming for PXE ROMs
And add missing ROMs to tarbin build target.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
virtio: use generic name when possible
We have two different virtio buses: pci and s390. The abstraction pathtaken in qemu is to have generic aliases for each device type in thearchitecture specific qdev devices.
So let's make use of these aliases whenever we can and define them...
virtio-pci: fix bus master work around on load
Commit c81131db15dd1844d0db1d51f3cd7a105cfd2cf3detects old guests by comparing virtio andPCI status. It attempts to do this on load,as well, but load_config callback in a bindingis invoked too early and so the virtio status...
virtio-serial: Enable ioeventfd
Enable ioeventfd for virtio-serial devices by default. Commit25db9ebe15125deb32958c6df74996f745edf1f9 lists the benefits of usingioeventfd.
Copying a file from guest to host over a virtio-serial channel didn'tshow much difference in time or io_exit rate....
virtio-serial: Use a struct to pass config information from proxy
Instead of using a single variable to pass to the virtio_serial_initfunction, use a struct so that expanding the number of variables to bepassed on later is easier.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
vhost: force vhost off for non-MSI guests
When MSI is off, each interrupt needs to be bounced through the iothread when it's set/cleared, so vhost-net causes more context switches andhigher CPU utilization than userspace virtio which handles networking in...
ioeventfd: error handling cleanup
- Don't return status from start/stop functions where it's ignored- report errors to make debugging easier- assert on unexpected failures- don't disable notifiers on error so that we'll retry when guest driver restarts...
virtio-pci: Use ioeventfd for virtqueue notify
Virtqueue notify is currently handled synchronously in userspace virtio. Thisprevents the vcpu from executing guest code while hardware emulation codehandles the notify.
On systems that support KVM, the ioeventfd mechanism can be used to make...
virtio-pci: Rename bugs field to flags
The VirtIOPCIProxy bugs field is currently used to enable workaroundsfor older guests. Rename it to flags so that other per-device behaviorcan be tracked.
A later patch uses the flags field to remember whether ioeventfd should...
Introduce fw_name field to DeviceInfo structure.
Add "fw_name" to DeviceInfo to use in device path building. Incontrast to "name" "fw_name" should refer to functionality deviceprovides instead of particular device model like "name" does.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
virtio-pci: Convert fprintf() to error_report()
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtfs: enable MSI-X
This patch enables MSI-X for virtfs-9p-pci. It also adds acompat property to pc-0.13 which turns it of there to staycompatible to 0.13-stable.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: change set guest notifier to per-device
When using irqfd with vhost-net to inject interrupts,a single evenfd might inject multiple interrupts.Implementing this is much easier with a singleper-device callback to set guest notifiers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio-net: Introduce a new bottom half packet TX
Based on a patch from Mark McLoughlin, this patch introduces a newbottom half packet transmitter that avoids the latency imposed bythe tx_timer approach. Rather than scheduling a timer when a TXpacket comes in, schedule a bottom half to be run from the iothread....
virtio-net: Limit number of packets sent per TX flush
If virtio_net_flush_tx() is called with notification disabled, we canrace with the guest, processing packets at the same rate as theyget produced. The trouble is that this means we have no guaranteed...
virtio-net: Make tx_timer timeout configurable
Add an option to make the TX mitigation timer adjustable as a deviceoption. The 150us hard coded default used currently is reasonable,but may not be suitable for all workloads, this gives us a way toadjust it using a single binary. We can't support any random option...
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
virtio-serial: Cleanup on device hot-unplug
Free malloc'ed memory, unregister from savevm and clean up virtio-commonbits on device hot-unplug.
This was found performing a migration after device hot-unplug.
Reported-by: <lihuang@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-blk: Create exit function to unregister savevm
Otherwise we can't migrate after we've removed a virtio block device.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-pci: Check for virtio_blk_init() failure
It can't actually fail now, but the next commit will change that.
s390_virtio_blk_init() already checks for failure, butvirtio_blk_init_pci() doesn't. Fix that.
virtio-blk: Fix virtio-blk-s390 to require drive
Move the check from virtio_blk_init_pci(), where it protects onlyvirtio-blk-pci, to virtio_blk_init(). Without that, virtio-blk-s390initializes without a drive. I figure that can lead to null pointerdereferences....
pci: don't overwrite multi functio bit in pci header type.
Don't overwrite pci header type.Otherwise, multi function bit which pci_init_header_type() setsappropriately is lost.Anyway PCI_HEADER_TYPE_NORMAL is zero, so it is unnecessary to zerowhich is already zero cleared....
qdev: Decouple qdev_prop_drive from DriveInfo
Make the property point to BlockDriverState, cutting out the DriveInfomiddleman. This prepares the ground for block devices that don't havea DriveInfo.
Currently all user-defined ones have a DriveInfo, because the only way...
blockdev: Clean up automatic drive deletion
We automatically delete blockdev host parts on unplug of the guestdevice. Too much magic, but we can't change that now.
The delete happens early in the guest device teardown, before theconnection to the host part is severed. Thus, the guest part's...
virtio-pci: fix bus master bug setting on load
The comment suggests we're checking for the driver in the readystate and bus master disabled, but the code is checking that it'snot in the ready state.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
virtio-9p: Make infrastructure for the new security model.
This patch adds required infrastructure for the new security model.
- A new configure option for attr/xattr.- if CONFIG_VIRTFS will be defined if both CONFIG_LINUX and CONFIG_ATTR defined.- Defines routines related to both security models....
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-9p: Add a virtio 9p device to qemu
This patch doesn't implement the 9p protocol handlingcode. It adds a simple device which dump the protocol data.
[jvrao@linux.vnet.ibm.com: Little-Endian to host format conversion][aneesh.kumar@linux.vnet.ibm.com: Multiple-mounts support]...
virtio: add set_status callback
vhost net backend needs to be notified whenfrontend status changes. Add a callback,similar to set_features.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-pci: fill in notifier support
Support host/guest notifiers in virtio-pci.The last one only with kvm, that's okaybecause vhost relies on kvm anyway.
Note on kvm usage: kvm ioeventfd APIis implemented on non-kvm systems as well,this is the reason we don't need if (kvm_enabled())...
Don't check for bus master for old guests
Older Linux guests don't activate the bus master enable bit. So for those wecan just try to be clever and track if they set the DEVICE_OK bit even thoughbus mastering is still disabled.
Under that condition we can disable the windows safety check. With that logic...
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Move qemu_error & friends into their own header
virtio-pci: Use DEV_NVECTORS_UNSPECIFIED instead of -1 for virtio-serial
Use the named constant instead of -1.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: pci: Allow MSI to be disabled
Michael noted we don't allow disabling of MSI for the virtio-serial-pcidevice. Fix that.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: add topology qdev properties
Add three new qdev properties to export block topology information tothe guest. This is needed to get optimal I/O alignment for RAID arraysor SSDs.
The options are:
- physical_block_size to specify the physical block size of the device,...
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...
virtio-serial: Use MSI vectors for port virtqueues
This commit enables the use of MSI interrupts for virtqueuenotifications for ports. We use nr_ports + 1 (for control channel) msientries for the ports, as only the in_vq operations need an interrupt on...
virtio-pci: thinko fix
Since patch ed757e140c0ada220f213036e4497315d24ca8bct, virtio willsometimes clear all status registers on bus master disable, which losesinformation such as VIRTIO_CONFIG_S_FAILED bit. This is a result ofa patch being misapplied: code uses ! instead of ~ for bit...
virtio: rename features -> guest_features
Rename features->guest_features. This iswhat they are, avoid confusion withhost features which we also need to keep around.
virtio: add features as qdev properties
Add feature bits as properties to virtio. This makes it possible to e.g. definemachine without indirect buffer support, which is required for 0.10compatibility, or without hardware checksum support, which is required for 0.11...
Support PCI based option rom loading
Currently, we preload option roms into the option rom space in memory. Thisprevents DDIM from functioning correctly which severely limits the numberof roms we can support.
This patch introduces a pci_add_option_rom() which registers the...
pci romfiles: add property, add default to PCIDeviceInfo
This patch adds a romfile property to the pci bus. It allows to specifya romfile to load into the rom bar of the pci device. The default valuecomes from a new field in PCIDeviceInfo. The property allows to change...
virtio: verify features on load
migrating between hosts which have different featuresmight break silently, if the migration destinationdoes not support some features supported by source.
Prevent this from happening by comparing acked featurebits with the mask supported by the device....
virtio: do not reset msix state on soft reset
msix state is managed by OS, not thedriver, so it's wrong to touch iton io from driver.Mark all vectors unused instead.
pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t
This patch is preliminary for 64 bit BAR support.Introduce dedicated type, pcibus_t, to represent pci bus address/sizeinstead of uint32_t.Later this type will be changed to uint64_t....
pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h
make constants for pci base address match pci_regs.h byrenaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
virtio: use qdev properties for configuration.
qemu/pci: make pci not depend on msix
Making pci device cleanup msix automatically makes pci.c depend onmsix.c, which is IMO messy. Since devices do msix_init it's easy andnatural for them to also do msix_uninit.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-pci: return error if virtio_console_init fails
Currently only one virtio_console device is supported. Trying to addmultiple devices fails and such failure should be reported back to theqdev init functions.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
qemu: clean up target page usage in msix
Since cpu_register_phys_memory does not require size to be a multiple oftarget page size, simply make msix page size 0x1000. Do this in msix,reverting part of 5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we nolonger have to pass target page around....
qemu/virtio-pci: remove unnecessary check
it's safe to call msix_write_config if msixis disabled, so call it unconditionally onpci config write.
qemu/virtio: fix reset with device removal
virtio pci registers its own reset handler, but fails to unregister it,which will lead to crashes after device removal. Solve this problem byswitching to qdev reset handler, which is automatically unregistered....
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Compile msix only once
Get page size in device init.
VirtIO: Fix QEMU crash during Windows PNP tests
Hello,
In some cases bus driver can deassert "bus master" bit in PCI commandregister. The driver will no longer be able to update related registers inthe device. Eventually it will cause QEMU to exit in "virtqueue_num_heads"...
virtio-pci error logging
Use the new qemu_error() function for virtio-blk-pci.
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
virtio-blk: add msi support.
qdev/prop: convert virtio-pci.c to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
qdev-ify virtio-blk.
First user of the new drive property. With this patch applied hostand guest config can be specified separately, like this:
-drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1
You can set any property for virtio-blk-pci now. You can set the pci...
Remove the virtio-{blk, console}-pci-0-10 device types
These are now unused.
However, perhaps the idea is that when we add -device, they will beuseful? In that case, we should add virtio-net-pci-0-10 too.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
qdev/compat: virtio-blk-pci 0.10 compatibility.
Add class property to virtio-blk-pci allowing to specify the PCI class.Add compat property to pc-0.10 to set the old PCI class.
qdev/compat: virtio-console-pci 0.10 compatibility.
Add class property to virtio-console-pci allowing to specify the PCI class.Add compat property to pc-0.10 to set the old PCI class.
qdev/compat: virtio-net-pci 0.10 compatibility.
Add vectors property, allowing to turn off msi by setting vectors=0.Add compat property to pc-0.10 disabling msi.
cleanup: drop unused struct elements from VirtIOPCIProxy.
Change default PCI class of virtio-blk to PCI_CLASS_STORAGE_SCSI
Windows virtio driver cannot pass DTM (certification) tests while thestorage class is PCI_CLASS_STORAGE_UNKNOWN.
A new qdev type is introduced to allow devices using the old classto be created for compatibility with qemu-0.10.x....
Change default PCI class of virtio-console to PCI_CLASS_SERIAL_OTHER
We're using PCI_CLASS_DISPLAY_OTHER now, but qemu-kvm.git is usingPCI_CLASS_OTHERS because:
"As a PCI_CLASS_DISPLAY_OTHER, it reduces primary display somehow on Windows XP (possibly Windows disables acceleration since it fails...
qemu/virtio: mark msi vectors used on load
Usage of msi vectors is controlled by the guest and so needs to berestored on load. Do this for msi vectors used by the virtio device.
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunchof parameters. Also adds config_read and config_write callbacks toPCIDeviceInfo, so drivers needing these can be converted to the qdevdevice API too....
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
qemu/virtio: virtio save/load bindings
Implement bindings for virtio save/load. Use them in virtio pci.
qemu/virtio: virtio support for many interrupt vectors
Extend virtio to support many interrupt vectors, and rearrange code inpreparation for multi-vector support (mostly move reset out to bindings,because we will have to reset the vectors in transport-specific code)....
qemu/virtio: MSI-X support in virtio PCI
This enables actual support for MSI-X in virtio PCI.First user will be virtio-net.
virtio: add support for indirect ring entries
Support a new feature flag for indirect ring entries. These are ringentries which point to a table of buffer descriptors.
The idea here is to increase the ring capacity by allowing a largereffective ring size whereby the ring size dictates the number of...
Rename pci_register_io_region() to pci_register_bar()
This function is used to manage a PCI BAR, so make the more genericpci_register_io_region() available to other uses.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Hardware convenience library
The only target dependency for most hardware is sizeof(target_phys_addr_t).Build these files into a convenience library, and use that instead ofbuilding for every target.
Remove and poison various target specific macros to avoid bogus target...
Separate virtio PCI code
Split the PCI host bindings from the VRing transport implementation.
Signed-off-by: Paul Brook <paul@codesourcery.com>