summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* irq: Allocate IRQs individuallyPeter Crosthwaite2014-07-015-17/+11
| | | | | | | | | | | | | | | | | | Allocate each IRQ individually on array allocations. This prepares for QOMification of IRQs, where pointers to individual IRQs may be taken and handed around for usage as QOM Links. The g_renew() scheme used here is too fragile and would break all existing links should an IRQ list be extended. We now have to pass the IRQ count to qemu_free_irqs(). We have so few call sites however, so this change is reasonably trivial. Cc: agarcia@igalia.com Cc: mst@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Alberto Garcia <agarcia@igalia.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw: Fix qemu_allocate_irqs() leaksAndreas Färber2014-06-3014-29/+28
| | | | | | | | | | | | | | | | | | | | Replace qemu_allocate_irqs(foo, bar, 1)[0] with qemu_allocate_irq(foo, bar, 0). This avoids leaking the dereferenced qemu_irq *. Cc: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de> [PC Changes: * Applied change to instance in sh4/sh7750.c ] Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Kirill Batuzov <batuzovk@ispras.ru> [AF: Fix IRQ index in sh4/sh7750.c] Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
* sdhci: Fix misuse of qemu_free_irqs()Andreas Färber2014-06-301-2/+2
| | | | | | | | | It does a g_free() on the pointer, so don't pass a local &foo reference. Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
* qom: Remove parent pointer when unparentingPeter Crosthwaite2014-06-301-0/+1
| | | | | | | | | Certain parts of the QOM framework test this pointer to determine if an object is parented. Nuke it when the object is unparented to allow for reuse of an object after unparenting. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* Merge remote-tracking branch ↵Peter Maydell2014-06-301-115/+165
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/awilliam/tags/vfio-pci-for-qemu-20140630.0' into staging VFIO patches: MSI-X masking performance fix, Endian fixes, fix runstate on device error # gpg: Signature made Mon 30 Jun 2014 18:13:40 BST using RSA key ID 3BB08B22 # gpg: Can't check signature: public key not found * remotes/awilliam/tags/vfio-pci-for-qemu-20140630.0: vfio: use correct runstate vfio: Make BARs native endian vfio-pci: Fix MSI-X masking performance vfio-pci: Fix MSI/X debug code Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * vfio: use correct runstatePaolo Bonzini2014-06-301-1/+1
| | | | | | | | | | | | | | | | | | io-error is for block device errors; it should always be preceded by a BLOCK_IO_ERROR event. I think vfio wants to use RUN_STATE_INTERNAL_ERROR instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio: Make BARs native endianAlexey Kardashevskiy2014-06-301-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slow BAR access path is used when VFIO fails to mmap() BAR. Since this is just a transport between the guest and a device, there is no need to do endianness swapping. This changes BARs to use native endianness. Since non-ROM BARs were doing byte swapping, we need to remove it so does the patch. As the result, this eliminates cancelling byte swaps and there is no change in behavior for non-ROM BARs. ROM BARs were declared little endian too but byte swapping was not implemented for them so they never actually worked on big endian systems as there was no cancelling byte swap. This fixes endiannes for ROM BARs by declaring them native endian and only fixing access sizes as it is done for non-ROM BARs. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio-pci: Fix MSI-X masking performanceAlex Williamson2014-06-301-102/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are still old guests out there that over-exercise MSI-X masking. The current code completely sets-up and tears-down an MSI-X vector on the "use" and "release" callbacks. While this is functional, it can slow an old guest to a crawl. We can easily skip the KVM parts of this so that we keep the MSI route and irqfd setup. We do however need to switch VFIO to trigger a different eventfd while masked. Actually, we have the option of continuing to use -1 to disable the trigger, but by using another EventNotifier we can allow the MSI-X core to emulate pending bits and re-fire the vector once unmasked. MSI code gets updated as well to use the same setup and teardown structures and functions. Prior to this change, an igbvf assigned to a RHEL5 guest gets about 20Mbps and 50 transactions/s with netperf (remote or VF->PF). With this change, we get line rate and 3k transactions/s remote or 2Gbps and 6k+ transactions/s to the PF. No significant change is expected for newer guests with more well behaved MSI-X support. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * vfio-pci: Fix MSI/X debug codeAlex Williamson2014-06-301-2/+2
|/ | | | | | Use the correct MSI message function for debug info. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* Merge remote-tracking branch 'remotes/bonzini/nbd-next' into stagingPeter Maydell2014-06-304-49/+186
|\ | | | | | | | | | | | | | | | | | | | | * remotes/bonzini/nbd-next: nbd: Handle NBD_OPT_LIST option. nbd: Handle fixed new-style clients. nbd: Shutdown socket before closing. nbd: Don't validate from and len in NBD_CMD_DISC. nbd: Don't export a block device with no medium. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * nbd: Handle NBD_OPT_LIST option.Hani Benhabiles2014-06-302-0/+68
| | | | | | | | | | Signed-off-by: Hani Benhabiles <kroosec@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * nbd: Handle fixed new-style clients.Hani Benhabiles2014-06-302-49/+111
| | | | | | | | | | | | | | | | | | | | | | When this flag is set, the server tells the client that it can send another option if the server received a request with an option that it doesn't understand instead of directly closing the connection. Also add link to the most up-to-date documentation. Signed-off-by: Hani Benhabiles <kroosec@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * nbd: Shutdown socket before closing.Hani Benhabiles2014-06-302-0/+2
| | | | | | | | | | | | | | | | | | This forces finishing data sending to client before closing the socket like in exports listing or replying with NBD_REP_ERR_UNSUP cases. Signed-off-by: Hani Benhabiles <kroosec@gmail.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * nbd: Don't validate from and len in NBD_CMD_DISC.Hani Benhabiles2014-06-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These values aren't used in this case. Currently, the from field in the request sent by the nbd kernel module leading to a false error message when ending the connection with the client. $ qemu-nbd some.img -v // After nbd-client -d /dev/nbd0 nbd.c:nbd_trip():L1031: From: 18446744073709551104, Len: 0, Size: 20971520, Offset: 0 nbd.c:nbd_trip():L1032: requested operation past EOF--bad client? nbd.c:nbd_receive_request():L638: read failed Signed-off-by: Hani Benhabiles <kroosec@gmail.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * nbd: Don't export a block device with no medium.Hani Benhabiles2014-06-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device is exported with erroneous values and can't be read. Before the patch: $ sudo nbd-client localhost -p 10809 /dev/nbd0 -name floppy0 Negotiation: ..size = 17592186044415MB bs=1024, sz=18446744073709547520 bytes $ sudo mount /dev/nbd0 /mnt/tmp/ mount: block device /dev/nbd0 is write-protected, mounting read-only mount: /dev/nbd0: can't read superblock After the patch: (qemu) nbd_server_add ide0-hd0 (qemu) nbd_server_add floppy0 Device 'floppy0' has no medium Signed-off-by: Hani Benhabiles <kroosec@gmail.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'remotes/bonzini/small-fixes' into stagingPeter Maydell2014-06-306-5/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | * remotes/bonzini/small-fixes: tests/test-qmp-event: fix for GLib < 2.31 serial: poll the serial console with G_IO_HUP Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | tests/test-qmp-event: fix for GLib < 2.31Paolo Bonzini2014-06-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | On old GLib, the test needs a g_thread_init call. Reported-by: Wenchao Xia <wenchaoqemu@gmail.com> Tested-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | serial: poll the serial console with G_IO_HUPRoger Pau Monne2014-06-305-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code: http://xenbits.xen.org/people/royger/test_poll.c When executed on Linux: $ ./test_poll In callback On FreeBSD instead, the callback never gets called: $ ./test_poll So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD). Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: Michael Tokarev <mjt@tls.msk.ru> Cc: "Andreas Färber" <afaerber@suse.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: xen-devel@lists.xenproject.org [Add hw/char/cadence_uart.c too. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-cocoa-20140630' ↵Peter Maydell2014-06-301-33/+75
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging cocoa.next: * Honour -show-cursor option * Fix handling of absolute positioning devices * Cope with first surface being same as initial window size # gpg: Signature made Mon 30 Jun 2014 13:48:46 BST using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-cocoa-20140630: ui/cocoa: Honour -show-cursor command line option ui/cocoa: Fix handling of absolute positioning devices ui/cocoa: Add utility method to check if point is within window ui/cocoa: Cope with first surface being same as initial window size Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | ui/cocoa: Honour -show-cursor command line optionPeter Maydell2014-06-291-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Honour the -show-cursor command line option (which forces the mouse pointer to always be displayed even when input is grabbed) in the Cocoa UI backend. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-5-git-send-email-peter.maydell@linaro.org
| * | | ui/cocoa: Fix handling of absolute positioning devicesPeter Maydell2014-06-291-29/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix handling of absolute positioning devices, which were basically unusable for two separate reasons: (1) as soon as you pressed the left mouse button we would call CGAssociateMouseAndMouseCursorPosition(FALSE), which means that the absolute coordinates of the mouse events are never updated (2) we didn't account for MacOSX coordinate origin being bottom left rather than top right, and so all the Y values sent to the guest were inverted We fix (1) by aligning our behaviour with the SDL UI backend for absolute devices: * when the mouse moves into the window we do a grab (which means hiding the host cursor and sending special keys to the guest) * when the mouse moves out of the window we un-grab and fix (2) by doing the correct transformation in the call to qemu_input_queue_abs(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-4-git-send-email-peter.maydell@linaro.org
| * | | ui/cocoa: Add utility method to check if point is within windowPeter Maydell2014-06-291-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a utility method to check whether a point is within the current window bounds, and use it in the various places in the mouse handling code that were opencoding the check. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-3-git-send-email-peter.maydell@linaro.org
| * | | ui/cocoa: Cope with first surface being same as initial window sizePeter Maydell2014-06-291-1/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do the recalculation of the content dimensions in switchSurface if the current cdx is zero as well as if the new surface is a different size to the current window. This catches the case where the first surface registered happens to be 640x480 (our current window size), and fixes a bug where we would always display a black screen until the first surface of a different size was registered. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-2-git-send-email-peter.maydell@linaro.org
* | | Merge remote-tracking branch ↵Peter Maydell2014-06-306-37/+65
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/pmaydell/tags/pull-target-arm-20140630' into staging target-arm: * provide PL031 RTC in virt board * fix missing pxa2xx and strongarm vmstate * convert cadence_ttc to instance_init * fix libvixl format strings and README # gpg: Signature made Mon 30 Jun 2014 13:44:33 BST using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-target-arm-20140630: disas/libvixl: Fix wrong format strings disas/libvixl: Update README for version base timer: cadence_ttc: Convert to instance_init hw/arm/pxa2xx_gpio: Correct and register vmstate hw/arm/pxa2xx_gpio: Fix handling of GPSR/GPCR reads hw/arm/strongarm: Wire up missing GPIO and PPC vmstate hw/arm/strongarm: Fix handling of GPSR/GPCR reads hw/arm/virt: Provide PL031 RTC Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | disas/libvixl: Fix wrong format stringsStefan Weil2014-06-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the compiler is told to check the arguments of AppendToOutput, it reports several errors of this kind: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int64_t {aka long int}’ [-Werror=format] Fix those bugs by using the correct format strings with PRId64, PRIx64. Signed-off-by: Stefan Weil <sw@weilnetz.de> Message-id: 1403113751-19799-1-git-send-email-sw@weilnetz.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | disas/libvixl: Update README for version baseRichard Henderson2014-06-291-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Richard Henderson <rth@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | timer: cadence_ttc: Convert to instance_initAlistair Francis2014-06-291-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SysBusDevice::init is deprecated. Convert to instance_init as prescribed by QOM conventions. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Message-id: 1223f14833159b9ea5c57734dd2ffa88d4b15a83.1403583596.git.alistair.francis@xilinx.com Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/arm/pxa2xx_gpio: Correct and register vmstatePeter Maydell2014-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pxa2xx-gpio device has a VMStateDescription, but it was accidentally never actually registered, and it wasn't quite correct. Remove the 'lines' field (this is a device property, not mutable state), add the missing 'prev_level' field, and set dc->vmsd so it actually gets used. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
| * | hw/arm/pxa2xx_gpio: Fix handling of GPSR/GPCR readsPeter Maydell2014-06-291-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The PXA2xx GPIO GPSR and GPCR registers are write-only, with reads being undefined behaviour. Instead of having GPCR return 31337 and GPSR return the value last written, make both log the guest error and return 0. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
| * | hw/arm/strongarm: Wire up missing GPIO and PPC vmstatePeter Maydell2014-06-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The VMStateDescription structs for the GPIO and PPC devices were accidentally never wired up. Add missing state fields and register them via dc->vmsd. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
| * | hw/arm/strongarm: Fix handling of GPSR/GPCR readsPeter Maydell2014-06-291-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The StrongARM GPIO GPSR and GPCR registers are write-only, with reads being undefined behaviour. Instead of having GPCR return 31337 and GPSR return the value last written, make both log the guest error and return 0. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
| * | hw/arm/virt: Provide PL031 RTCPeter Maydell2014-06-291-0/+30
|/ / | | | | | | | | | | | | | | | | | | UEFI mandates that the platform must include an RTC, so provide one in 'virt', using the PL031. This is also useful for directly booting Linux kernels which would otherwise have to run ntpdate. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
* | Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2014-06-2932-282/+854
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pc,vhost,virtio fixes, enhancements virtio bi-endian support new command to resync RTC misc bugfixes and cleanups Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 29 Jun 2014 17:41:13 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: (37 commits) tests: add human format test for string output visitor vhost-net: disable when cross-endian target-ppc: enable virtio endian ambivalent support virtio-9p: use virtio wrappers to access headers virtio-serial-bus: use virtio wrappers to access headers virtio-scsi: use virtio wrappers to access headers virtio-blk: use virtio wrappers to access headers virtio-balloon: use virtio wrappers to access page frame numbers virtio-net: use virtio wrappers to access headers virtio: allow byte swapping for vring virtio: memory accessors for endian-ambivalent targets virtio: add endian-ambivalent support to VirtIODevice cpu: introduce CPUClass::virtio_is_big_endian() exec: introduce target_words_bigendian() helper virtio: add subsections to the migration stream virtio-rng: implement per-device migration calls virtio-balloon: implement per-device migration calls virtio-serial: implement per-device migration calls virtio-blk: implement per-device migration calls virtio-net: implement per-device migration calls ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | tests: add human format test for string output visitorHu Tao2014-06-291-19/+90
| | | | | | | | | | | | | | | | | | Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | vhost-net: disable when cross-endianGreg Kurz2014-06-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of today, vhost assumes guest and host have the same endianness. This is definitely not compatible with modern PPC64 and ARM that can change endianness at runtime. Let's disable vhost-net and print an error message when we detect such a case: qemu-system-ppc64: vhost-net does not support cross-endian qemu-system-ppc64: unable to start vhost net: 38: falling back on userspace virtio This way users can continue to run VMs without changing their setup and have a chance to know that performance will be impacted. Suggested-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | target-ppc: enable virtio endian ambivalent supportGreg Kurz2014-06-292-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | The device endianness is the cpu endianness at device reset time. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-9p: use virtio wrappers to access headersGreg Kurz2014-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-serial-bus: use virtio wrappers to access headersRusty Russell2014-06-291-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We also fix max_nr_ports at reset time as the device endianness may have changed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> [ pass VirtIODevice * to memory accessors, fix max_nr_ports at reset time, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-scsi: use virtio wrappers to access headersRusty Russell2014-06-291-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> [ pass VirtIODevice * to memory accessors, converted new tswap locations to virtio_tswap, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-blk: use virtio wrappers to access headersRusty Russell2014-06-291-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> [ pass VirtIODevice * to memory accessors, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-balloon: use virtio wrappers to access page frame numbersRusty Russell2014-06-291-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> [ pass VirtIODevice * to memory accessors, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: use virtio wrappers to access headersRusty Russell2014-06-291-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> [ pass VirtIODevice * to memory accessors, converted new tswap locations to virtio_tswap, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio: allow byte swapping for vringRusty Russell2014-06-291-41/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quoting original text from Rusty: "This is based on a simpler patch by Anthony Liguouri". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> [ add VirtIODevice * argument to most helpers, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio: memory accessors for endian-ambivalent targetsGreg Kurz2014-06-291-0/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the virtio-access.h header file taken from Rusty's "endian-ambivalent targets using legacy virtio" patch. It introduces helpers that should be used when accessing vring data or by drivers for data that contains headers. The virtio config space is also target endian, but the current code already handles that with the virtio_is_big_endian() helper. There is no obvious benefit at using the virtio accessors in this case. Now we have two distinct paths: a fast inline one for fixed endian targets, and a slow out-of-line one for targets that define the new TARGET_IS_BIENDIAN macro. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> [ relicensed virtio-access.h to GPLv2+ on Rusty's request, pass &address_space_memory to physical memory accessors, per-device endianness, virtio tswap16 and tswap64 helpers, faspath for fixed endian targets, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Cc: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio: add endian-ambivalent support to VirtIODeviceGreg Kurz2014-06-293-19/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some CPU families can dynamically change their endianness. This means we can have little endian ppc or big endian arm guests for example. This has an impact on legacy virtio data structures since they are target endian. We hence introduce a new property to track the endianness of each virtio device. It is reasonnably assumed that endianness won't change while the device is in use : we hence capture the device endianness when it gets reset. We migrate this property in a subsection, after the device descriptor. This means the load code must not rely on it until it is restored. As a consequence, the vring sanity checks had to be moved after the call to vmstate_load_state(). We enforce paranoia by poisoning the property at the begining of virtio_load(). Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | cpu: introduce CPUClass::virtio_is_big_endian()Greg Kurz2014-06-292-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we want to support targets that can change endianness (modern PPC and ARM for the moment), we need to add a per-CPU class method to be called from the virtio code. The virtio_ prefix in the name is a hint for people to avoid misusage (aka. anywhere but from the virtio code). The default behaviour is to return the compile-time default target endianness. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | exec: introduce target_words_bigendian() helperGreg Kurz2014-06-293-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have a virtio_is_big_endian() helper that provides the target endianness to the virtio code. As of today, the helper returns a fixed compile-time value. Of course, this will have to change if we want to support target endianness changes at run-time. Let's move the TARGET_WORDS_BIGENDIAN bits out to a new helper and have virtio_is_big_endian() implemented on top of it. This patch doesn't change any functionality. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio: add subsections to the migration streamGreg Kurz2014-06-291-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a need to add some more fields to VirtIODevice that should be migrated (broken status, endianness). The problem is that we do not want to break compatibility while adding a new feature... This issue has been addressed in the generic VMState code with the use of optional subsections. As a *temporary* alternative to port the whole virtio migration code to VMState, this patch mimics a similar subsectionning ability for virtio, using the VMState code. Since each virtio device is streamed in its own section, the idea is to stream subsections between the end of the device section and the start of the next sections. This allows an older QEMU to complain and exit when fed with subsections: Unknown savevm section type 5 load of migration failed Suggested-by: Alexander Graf <agraf@suse.de> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-rng: implement per-device migration callsGreg Kurz2014-06-291-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | While we are here, we also check virtio_load() return value. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-balloon: implement per-device migration callsGreg Kurz2014-06-291-11/+14
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
OpenPOWER on IntegriCloud