summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-21qom/cpu: Add MemoryRegion propertyPeter Crosthwaite3-1/+18
Add a MemoryRegion property, which if set is used to construct the CPU's initial (default) AddressSpace. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [PMM: code is moved from qom/cpu.c to exec.c to avoid having to make qom/cpu.o be a non-common object file; code to use the MemoryRegion and to default it to system_memory added.] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21memory: Add address_space_init_shareable()Peter Crosthwaite2-0/+45
This will either create a new AS or return a pointer to an already existing equivalent one, if we have already created an AS for the specified root memory region. The motivation is to reuse address spaces as much as possible. It's going to be quite common that bus masters out in device land have pointers to the same memory region for their mastering yet each will need to create its own address space. Let the memory API implement sharing for them. Aside from the perf optimisations, this should reduce the amount of redundant output on info mtree as well. Thee returned value will be malloced, but the malloc will be automatically freed when the AS runs out of refs. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [PMM: dropped check for NULL root as unused; added doc-comment; squashed Peter C's reference-counting patch into this one; don't compare name string when deciding if we can share ASes; read as->malloced before the unref of as->root to avoid possible read-after-free if as->root was the owner of as] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec.c: Use correct AddressSpace in watch_mem_read and watch_mem_writePeter Maydell1-6/+10
In the watchpoint access routines watch_mem_read and watch_mem_write, find the correct AddressSpace to use from current_cpu and the memory transaction attributes, rather than always assuming address_space_memory. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec.c: Use cpu_get_phys_page_attrs_debugPeter Maydell1-5/+13
Use cpu_get_phys_page_attrs_debug() when doing virtual-to-physical conversions in debug related code, so that we can obtain the right address space index and thus select the correct AddressSpace, rather than always using cpu->as. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec.c: Add cpu_get_address_space()Peter Maydell2-0/+15
Add a function to return the AddressSpace for a CPU based on its numerical index. (Callers outside exec.c don't have access to the CPUAddressSpace struct so can't just fish it out of the CPUState struct directly.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec.c: Pass MemTxAttrs to iotlb_to_region so it uses the right ASPeter Maydell4-7/+10
Pass the MemTxAttrs for the memory access to iotlb_to_region(); this allows it to determine the correct AddressSpace to use for the lookup. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21cputlb.c: Use correct address space when looking up MemoryRegionSectionPeter Maydell3-6/+8
When looking up the MemoryRegionSection for the new TLB entry in tlb_set_page_with_attrs(), use cpu_asidx_from_attrs() to determine the correct address space index for the lookup, and pass it into address_space_translate_for_iotlb(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21cpu: Add new asidx_from_attrs() methodPeter Maydell1-0/+20
Add a new method to CPUClass which the memory system core can use to obtain the correct address space index to use for a memory access with a given set of transaction attributes, together with the wrapper function cpu_asidx_from_attrs() which implements the default behaviour ("always use asidx 0") for CPU classes which don't provide the method. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21cpu: Add new get_phys_page_attrs_debug() methodPeter Maydell1-2/+34
Add a new optional method get_phys_page_attrs_debug() to CPUClass. This is like the existing get_phys_page_debug(), but also returns the memory transaction attributes to use for the access. This will be necessary for CPUs which have multiple address spaces and use the attributes to select the correct address space. We provide a wrapper function cpu_get_phys_page_attrs_debug() which falls back to the existing get_phys_page_debug(), so we don't need to change every target CPU. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec-all.h: Document tlb_set_page_with_attrs, tlb_set_pagePeter Maydell1-3/+31
Add documentation comments for tlb_set_page_with_attrs() and tlb_set_page(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec.c: Allow target CPUs to define multiple AddressSpacesPeter Maydell5-10/+23
Allow multiple calls to cpu_address_space_init(); each call adds an entry to the cpu->ases array at the specified index. It is up to the target-specific CPU code to actually use these extra address spaces. Since this multiple AddressSpace support won't work with KVM, add an assertion to avoid confusing failures. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21exec.c: Don't set cpu->as until cpu_address_space_initPeter Maydell4-9/+39
Rather than setting cpu->as unconditionally in cpu_exec_init (and then having target-i386 override this later), don't set it until the first call to cpu_address_space_init. This requires us to initialise the address space for both TCG and KVM (KVM doesn't need the AS listener but it does require cpu->as to be set). For target CPUs which don't set up any address spaces (currently everything except i386), add the default address_space_memory in qemu_init_vcpu(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21misc: zynq-xadc: Fix off-by-onePeter Crosthwaite1-1/+1
This bounds check was off-by-one. Fix. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: 1453101737-11255-1-git-send-email-crosthwaite.peter@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21xlnx-ep108: Connect the SPI FlashAlistair Francis1-0/+16
Connect the sst25wf080 SPI flash to the EP108 board. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> [PMM: free string when finished with it] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21xlnx-zynqmp: Connect the SPI devicesAlistair Francis2-0/+34
Connect the Xilinx SPI devices to the ZynqMP model. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> [ PC changes * Use QOM alias for bus connectivity on SoC level ] Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> [PMM: free the g_strdup_printf() string when finished with it] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21xilinx_spips: Separate the state struct into a headerAlistair Francis2-42/+76
Separate out the XilinxSPIPS struct into a separate header file. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21ssi: Move ssi.h into a separate directoryAlistair Francis18-21/+23
Move the ssi.h include file into the ssi directory. While touching the code also fix the typdef lines as checkpatch complains. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21m25p80.c: Add sst25wf080 SPI flash deviceAlistair Francis1-0/+1
Add the sst25wf080 SPI flash device. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21qdev: get_child_bus(): Use QOM lookup if availablePeter Crosthwaite1-0/+6
qbus_realize() adds busses as a QOM child of the device in addition to adding it to the qdev bus list. Change get_child_bus() to use the QOM child if it is available. This takes priority over the bus-list, but the child object is checked for type correctness. This prepares support for aliasing of buses. The use case is SoCs, where a SoC container needs to present buses to the board level, but the buses are implemented by controller IP we already model as self contained qbus-containing devices. Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Acked-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell88-155/+390
Block layer patches # gpg: Signature made Wed 20 Jan 2016 15:37:57 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: iotests: Test that throttle values ranges blockdev: Error out on negative throttling option values vmdk: Create streamOptimized as version 3 qcow2: Make image inaccessible after failed qcow2_invalidate_cache() qcow2: Fix BDRV_O_INACTIVE handling in qcow2_invalidate_cache() qcow2: Implement .bdrv_inactivate block: Inactivate BDS when migration completes block: Rename BDRV_O_INCOMING to BDRV_O_INACTIVE block: Fix error path in bdrv_invalidate_cache() block: Assert no write requests under BDRV_O_INCOMING qcow2: Write full header on image creation qcow2: Write feature table only for v3 images block: Clean up includes qemu-iotests: Reduce racy output in 028 qemu-img: Speed up comparing empty/zero images block/raw-posix: avoid bogus fixup for cylinders on DASD disks block: Fix .bdrv_open flags Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21Merge remote-tracking branch ↵Peter Maydell6-29/+44
'remotes/berrange/tags/pull-io-next-2016-01-20-1' into staging I/O channels fixes 2016/01/20 v1 # gpg: Signature made Wed 20 Jan 2016 11:31:47 GMT using RSA key ID 15104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" * remotes/berrange/tags/pull-io-next-2016-01-20-1: io: use memset instead of { 0 } for initializing array io: fix description of @errp parameter initialization io: some fixes to handling of /dev/null when running commands io: increment counter when killing off subcommand io: fix sign of errno value passed to error report Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21Merge remote-tracking branch 'remotes/kraxel/tags/pull-socket-20160120-1' ↵Peter Maydell4-203/+177
into staging Convert qemu-socket to use QAPI exclusively, update MAINTAINERS. # gpg: Signature made Wed 20 Jan 2016 06:49:07 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-socket-20160120-1: vnc: distiguish between ipv4/ipv6 omitted vs set to off sockets: remove use of QemuOpts from socket_dgram sockets: remove use of QemuOpts from socket_connect sockets: remove use of QemuOpts from socket_listen sockets: remove use of QemuOpts from header file add MAINTAINERS entry for qemu socket code Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-21Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160119.0' ↵Peter Maydell4-3/+45
into staging VFIO updates 2016-01-19 - Performance fix for devices with poorly placed MSI-X PBA regions - Quirk fix for hosts with broken MMCONFIG access # gpg: Signature made Tue 19 Jan 2016 19:00:21 GMT using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>" * remotes/awilliam/tags/vfio-update-20160119.0: vfio/pci: Lazy PBA emulation vfio/pci-quirks: Only quirk to size of PCI config space Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-20iotests: Test that throttle values rangesFam Zheng3-0/+96
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-20blockdev: Error out on negative throttling option valuesFam Zheng3-11/+10
extract_common_blockdev_options() uses qemu_opt_get_number() to parse the bps/iops numbers to uint64_t, then converts to double and stores in ThrottleConfig. The actual parsing is done by strtoull() in parse_option_number(). Negative numbers are wrapped to large positive ones, and stored. We used to reject negative numbers since 7d81c1413c9, but this regressed when the option parsing code was changed later. Now fix this again. This time, define an arbitrary large upper limit (1e15), and check the values so both negative and impractically big numbers are caught and reported. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-20vmdk: Create streamOptimized as version 3Fam Zheng1-1/+7
VMware products accept only version 3 for streamOptimized, let's bump the version. Reported-by: Radoslav Gerganov <rgerganov@vmware.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-20qcow2: Make image inaccessible after failed qcow2_invalidate_cache()Kevin Wolf1-0/+3
If qcow2_invalidate_cache() fails, we are in a state where qcow2_close() has already been completed, but the image hasn't been reopened yet. Calling into any qcow2 function for an image in this state will cause crashes. The real solution would be to get rid of the close/open pair and instead do an atomic reset of the involved data structures, but this isn't trivial, so let's just make the image inaccessible for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20qcow2: Fix BDRV_O_INACTIVE handling in qcow2_invalidate_cache()Kevin Wolf1-1/+2
What qcow2_invalidate_cache() should do is close the image with BDRV_O_INACTIVE set and reopen it with the flag cleared. In fact, it used to do exactly the opposite: qcow2_close() relied on bs->open_flags, which is already updated to have cleared BDRV_O_INACTIVE at this point, whereas qcow2_open() was called with s->flags, which has the flag still set. Fix this. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20qcow2: Implement .bdrv_inactivateKevin Wolf1-17/+28
The callback has to ensure that closing or flushing the image afterwards wouldn't cause a write access to the image files. This means that just the caches have to be written out, which is part of the existing .bdrv_close implementation. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20block: Inactivate BDS when migration completesKevin Wolf5-0/+55
So far, live migration with shared storage meant that the image is in a not-really-ready don't-touch-me state on the destination while the source is still actively using it, but after completing the migration, the image was fully opened on both sides. This is bad. This patch adds a block driver callback to inactivate images on the source before completing the migration. Inactivation means that it goes to a state as if it was just live migrated to the qemu instance on the source (i.e. BDRV_O_INACTIVE is set). You're then supposed to continue either on the source or on the destination, which takes ownership of the image. A typical migration looks like this now with respect to disk images: 1. Destination qemu is started, the image is opened with BDRV_O_INACTIVE. The image is fully opened on the source. 2. Migration is about to complete. The source flushes the image and inactivates it. Now both sides have the image opened with BDRV_O_INACTIVE and are expecting the other side to still modify it. 3. One side (the destination on success) continues and calls bdrv_invalidate_all() in order to take ownership of the image again. This removes BDRV_O_INACTIVE on the resuming side; the flag remains set on the other side. This ensures that the same image isn't written to by both instances (unless both are resumed, but then you get what you deserve). This is important because .bdrv_close for non-BDRV_O_INACTIVE images could write to the image file, which is definitely forbidden while another host is using the image. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2016-01-20block: Rename BDRV_O_INCOMING to BDRV_O_INACTIVEKevin Wolf6-14/+14
Instead of covering only the state of images on the migration destination before the migration is completed, the flag will also cover the state of images on the migration source after completion. This common state implies that the image is technically still open, but no writes will happen and any cached contents will be reloaded from disk if and when the image leaves this state. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20block: Fix error path in bdrv_invalidate_cache()Kevin Wolf1-0/+2
We can only clear BDRV_O_INCOMING if the caches were actually invalidated. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20block: Assert no write requests under BDRV_O_INCOMINGKevin Wolf1-0/+2
As long as BDRV_O_INCOMING is set, the image file is only opened so we have a file descriptor for it. We're definitely not supposed to modify the image, it's still owned by the migration source. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20qcow2: Write full header on image creationKevin Wolf5-0/+39
When creating a qcow2 image, we didn't necessarily call qcow2_update_header(), but could end up with the basic header that qcow2_create2() created manually. One thing that this basic header lacks is the feature table. Let's make sure that it's always present. This requires a few updates to test cases as well. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20qcow2: Write feature table only for v3 imagesKevin Wolf3-49/+26
Version 2 images don't have feature bits, so writing a feature table to those images is kind of pointless. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-20block: Clean up includesPeter Maydell70-34/+70
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-20qemu-iotests: Reduce racy output in 028Eric Blake2-5/+4
On my machine, './check -qcow2 028' was failing about 80% of the time, due to a race in how many times the repeated attempts to run 'info block-jobs' could occur before the job was done, showing up as a failure of fewer '(qemu) ' prompts than in the expected output. Silence the output during the repetitions, then add a final clean command to keep the expected output useful; once patched, I was finally able to run the test 20 times in a row with no failures. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-20qemu-img: Speed up comparing empty/zero imagesFam Zheng1-15/+30
Two empty raw files are always compared by actually reading data even if there is no data, because BDRV_BLOCK_ZERO is considered "allocated" in bdrv_is_allocated_above(). That is inefficient. Use bdrv_get_block_status_above() for more information, and skip the consecutive zero sectors. This brings a huge speed up in comparing sparse/empty raw images: $ qemu-img create a 1G $ time ~/build/master/bin/qemu-img compare a a Images are identical. real 0m6.583s user 0m0.191s sys 0m6.367s $ time qemu-img compare a a Images are identical. real 0m0.033s user 0m0.003s sys 0m0.031s Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-20io: use memset instead of { 0 } for initializing arrayDaniel P. Berrange1-1/+5
Some versions of GCC on OS-X complain about CMSG_SPACE not being constant size, which prevents use of { 0 } io/channel-socket.c: In function 'qio_channel_socket_writev': io/channel-socket.c:497:18: error: variable-sized object may not be initialized char control[CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS)] = { 0 }; The compiler is at fault here, but it is nicer to avoid tickling this compiler bug by using memset instead. Reviewed-By: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-01-20io: fix description of @errp parameter initializationDaniel P. Berrange4-21/+21
The "Error **errp" parameters must be NULL initialized not uninitialized. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-01-20io: some fixes to handling of /dev/null when running commandsDaniel P. Berrange1-6/+16
The /dev/null file handle was leaked in a couple of places. There is also the possibility that both readfd and writefd point to the same /dev/null file handle, so care must be taken not to close the same file handle twice. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-01-19vfio/pci: Lazy PBA emulationAlex Williamson3-0/+42
The PCI spec recommends devices use additional alignment for MSI-X data structures to allow software to map them to separate processor pages. One advantage of doing this is that we can emulate those data structures without a significant performance impact to the operation of the device. Some devices fail to implement that suggestion and assigned device performance suffers. One such case of this is a Mellanox MT27500 series, ConnectX-3 VF, where the MSI-X vector table and PBA are aligned on separate 4K pages. If PBA emulation is enabled, performance suffers. It's not clear how much value we get from PBA emulation, but the solution here is to only lazily enable the emulated PBA when a masked MSI-X vector fires. We then attempt to more aggresively disable the PBA memory region any time a vector is unmasked. The expectation is then that a typical VM will run entirely with PBA emulation disabled, and only when used is that emulation re-enabled. Reported-by: Shyam Kaushik <shyam.kaushik@gmail.com> Tested-by: Shyam Kaushik <shyam.kaushik@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2016-01-19vfio/pci-quirks: Only quirk to size of PCI config spaceAlex Williamson1-3/+3
For quirks that support the full PCIe extended config space, limit the quirk to only the size of config space available through vfio. This allows host systems with broken MMCONFIG regions to still make use of these quirks without generating bad address faults trying to access beyond the end of config space exposed through vfio. This may expose direct access to the mirror of extended config space, only trapping the sub-range of standard config space, but allowing this makes the quirk, and thus the device, functional. We expect that only device specific accesses make use of the mirror, not general extended PCI capability accesses, so any virtualization in this space is likely unnecessary anyway, and the device is still IOMMU isolated, so it should only be able to hurt itself through any bogus configurations enabled by this space. Link: https://www.redhat.com/archives/vfio-users/2015-November/msg00192.html Reported-by: Ronnie Swanink <ronnie@ronnieswanink.nl> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2016-01-19block/raw-posix: avoid bogus fixup for cylinders on DASD disksChristian Borntraeger1-7/+0
large volume DASD that have > 64k cylinders do claim to have 0xFFFE cylinders as special value in the old 16 bit field. We want to pass this "token" along to the guest, instead of calculating the real number. Otherwise qemu might fail with "cyls must be between 1 and 65535" Cc: qemu-stable@nongnu.org Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-01-19block: Fix .bdrv_open flagsKevin Wolf1-6/+7
bdrv_common_open() modified bs->open_flags after inferring the set of options to pass to the driver's .bdrv_open callback. This means that the cache options were correctly set in bs->open_flags (and therefore correctly displayed in 'info block'), but the image would actually be opened with the default cache mode instead. This patch removes the flags parameter to bdrv_common_open() (except for BDRV_O_NO_BACKING it's the same as bs->open_flags anyway, and having two names for the same thing is confusing), and moves the assignment of open_flags down to immediately before calling into the block drivers. In all other places, bs->open_flags is now used consistently. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-01-19vnc: distiguish between ipv4/ipv6 omitted vs set to offDaniel P. Berrange1-6/+12
The VNC code for interpreting QemuOpts does not currently distinguish between ipv4/ipv6 being omitted, and being set to 'off', because historically the 'ipv4' and 'ipv6' options were just flags which did not accept a value. The upshot is that if someone runs $QEMU -vnc localhost:1,ipv6=off QEMU still uses PF_UNSPEC and thus may still bind to IPv6, when it should use PF_INET. This is another instance of the problem previously fixed for chardevs in commit b77e7c8e99f9ac726c4eaa2fc3461fd886017dc0 Author: Paolo Bonzini <pbonzini@redhat.com> Date: Mon Oct 12 15:35:16 2015 +0200 qemu-sockets: fix conversion of ipv4/ipv6 JSON to QemuOpts Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1452518225-11751-6-git-send-email-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-19sockets: remove use of QemuOpts from socket_dgramDaniel P. Berrange2-76/+24
The socket_dgram method accepts a QAPI SocketAddress object which it then turns into QemuOpts before calling the inet_dgram_opts helper method. By converting the latter to use QAPI SocketAddress directly, the QemuOpts conversion step can be eliminated. This removes the very last use of QemuOpts from the sockets code, so the socket_optslist[] array is also removed. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1452518225-11751-5-git-send-email-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-19sockets: remove use of QemuOpts from socket_connectDaniel P. Berrange1-55/+36
The socket_connect method accepts a QAPI SocketAddress object which it then turns into QemuOpts before calling the inet_connect_opts/unix_connect_opts helper methods. By converting the latter to use QAPI SocketAddress directly, the QemuOpts conversion step can be eliminated Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1452518225-11751-4-git-send-email-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-19sockets: remove use of QemuOpts from socket_listenDaniel P. Berrange1-57/+97
The socket_listen method accepts a QAPI SocketAddress object which it then turns into QemuOpts before calling the inet_listen_opts/unix_listen_opts helper methods. By converting the latter to use QAPI SocketAddress directly, the QemuOpts conversion step can be eliminated Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1452518225-11751-3-git-send-email-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-19sockets: remove use of QemuOpts from header fileDaniel P. Berrange2-20/+11
There are no callers of the sockets methods which accept QemuOpts any more. Make all the QemuOpts related functions static to avoid new callers being added, in preparation for removal of all QemuOpts usage, in favour of QAPI SocketAddress. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1452518225-11751-2-git-send-email-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>