[Qemu-devel] [PATCH v3 2/4] bootdevice: check boot order argument validation before vm running

2015-02-06 Thread arei.gonglei
From: Gonglei Either 'once' option or 'order' option can take effect for -boot at the same time, that is say initial startup processing can check only one. And pc.c's set_boot_dev() fails when its boot order argument is invalid. This patch provide a solution fix this problem: 1. If "once" is gi

[Qemu-devel] [PATCH v3 1/4] bootdevice: remove the check about boot_set_handler

2015-02-06 Thread arei.gonglei
From: Gonglei The reset logic can be done by both machine reset and boot handler. So we shouldn't return error when the boot handler callback don't be set. Signed-off-by: Gonglei Reviewed-by: Alexander Graf --- bootdevice.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) dif

[Qemu-devel] [PATCH v3 0/4] bootdevcie: change the boot order validation logic

2015-02-06 Thread arei.gonglei
From: Gonglei The reset logic can be done by both machine reset and boot handler. So we shouldn't return error when the boot handler callback don't be set in patch 1. Patch 2 check boot order argument validation before vm running. Patch 3 passing &error_abort instead of NULL. Patch 4 update boo

[Qemu-devel] [PATCH v3 4/4] bootdevice: update boot_order in MachineState

2015-02-06 Thread arei.gonglei
From: Dinar Valeev on sPAPR we need to update boot_order in MachineState in case it got changed on reset. Signed-off-by: Dinar Valeev Reviewed-by: Alexey Kardashevskiy Signed-off-by: Gonglei --- bootdevice.c | 4 1 file changed, 4 insertions(+) diff --git a/bootdevice.c b/bootdevice.c

[Qemu-devel] [PATCH v3 3/4] bootdevice: add check in restore_boot_order()

2015-02-06 Thread arei.gonglei
From: Gonglei qemu_boot_set() can't fail in restore_boot_order(), then simply assert it doesn't fail, by passing &error_abort. Signed-off-by: Gonglei --- bootdevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootdevice.c b/bootdevice.c index 52d3f9e..d3d4277 100644 -

[Qemu-devel] Where do I get Kernel/Initrd image to Reproduce Bug: 495566

2015-02-06 Thread Azizul Hakim
Hi, I want to reproduce https://bugs.launchpad.net/qemu/+bug/495566 But I don't understand where do I get the Kernel and Initrd images. The Test images do not include those. Is there any source for these image or do I've to make those myself? Thanks Muhammad Azizul Hakim

Re: [Qemu-devel] [RFC PATCH v2 09/11] hw/arm/virt-acpi-build: Generate XSDT table

2015-02-06 Thread Shannon Zhao
On 2015/2/4 0:51, Laszlo Ersek wrote: > On 02/03/15 17:19, Igor Mammedov wrote: >> On Thu, 29 Jan 2015 16:37:11 +0800 >> Shannon Zhao wrote: >> >>> XDST points to other tables except FACS & DSDT. >> Is there any reason to use XSDT instead of RSDT? >> If ACPI tables are below 4Gb which probably wou

Re: [Qemu-devel] [PATCH v3 0/3] vfio: free data and unmap BARs in instance_finalize

2015-02-06 Thread Alex Williamson
On Fri, 2015-02-06 at 22:15 +0100, Paolo Bonzini wrote: > Mostly the same as v2; We've got something screwy going on with MemoryListeners, I did some hotplug testing with this and I hit the following segfault: Program received signal SIGSEGV, Segmentation fault. 0x7ff7bd8f7416 in memory_liste

[Qemu-devel] [PATCH v2] Rudimentary Intel Restricted Transactional Memory Support.

2015-02-06 Thread trent . tong
From: Xin Tong A better looking patch generated by git format-patch. Implement a rudimentary support for intel RTM. Xbegin always fails to fallback code path. Handle Xbegin, Xend, Xtest, Xabort described in Intel ISA extension manual @ http://www.intel.com/content/dam/www/public/us/en/documents

[Qemu-devel] [PATCH v1] Rudimentary Intel Restricted Transactional Memory Support.

2015-02-06 Thread trent . tong
Implement a rudimentary support for intel RTM. Xbegin always fails to fallback code path. Handle Xbegin, Xend, Xtest, Xabort described in Intel ISA extension manual @ http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-manual-325462.pdf

[Qemu-devel] [PATCH] vfio: Use vfio type1 v2 IOMMU interface

2015-02-06 Thread Alex Williamson
The difference between v1 and v2 is fairly subtle, simply more deterministic behavior for unmaps. The v1 interface allows the user to attempt to unmap sub-regions of previous mappings, returning success with zero size if unable to comply. This was a reflection of the underlying IOMMU API. The v2

Re: [Qemu-devel] [PATCH 12/21] block: Use BlockBackend more

2015-02-06 Thread Max Reitz
On 2015-01-29 at 20:12, Eric Blake wrote: On 01/26/2015 12:27 PM, Max Reitz wrote: Replace bdrv_drain_all(), bdrv_commmit_all(), bdrv_flush_all(), bdrv_invalidate_cache_all(), bdrv_next() and occurrences of bdrv_states by their BlockBackend equivalents. Signed-off-by: Max Reitz --- block.c

Re: [Qemu-devel] [PATCH v3] blkdebug: fix "once" rule

2015-02-06 Thread Max Reitz
On 2015-02-06 at 16:26, John Snow wrote: Background: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the forthcoming action, provided

[Qemu-devel] [PATCH v3] blkdebug: fix "once" rule

2015-02-06 Thread John Snow
Background: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the forthcoming action, provided the events and state numbers match. Then

[Qemu-devel] [PATCH 1/3] vfio: cleanup vfio_get_device error path, remove vfio_populate_device callback

2015-02-06 Thread Paolo Bonzini
Now that vfio_put_base_device is called unconditionally at instance_finalize time, it can be called twice if vfio_populate_device fails. This works but it is slightly harder to follow. Change vfio_get_device to not touch the vbasedev struct until it will definitely succeed, moving the vfio_popula

Re: [Qemu-devel] [PATCH v2] blkdebug: fix "once" rule

2015-02-06 Thread John Snow
On 02/06/2015 04:15 PM, Max Reitz wrote: On 2015-02-06 at 13:23, John Snow wrote: Background: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to

[Qemu-devel] [PATCH 3/3] vfio: unmap and free BAR data in instance_finalize

2015-02-06 Thread Paolo Bonzini
In the case of VFIO, the unrealize callback is too early to munmap the BARs. The munmap must be delayed until memory accesses are complete. To do this, split vfio_unmap_bars in two. The removal step, now called vfio_unregister_bars, remains in vfio_exitfn. The reclamation step is vfio_unmap_bars

[Qemu-devel] [PATCH v3 0/3] vfio: free data and unmap BARs in instance_finalize

2015-02-06 Thread Paolo Bonzini
Mostly the same as v2; - patch 1 makes the error paths of vfio_get_device a bit simpler - patch 2 introduces instance_finalize - patch 3 makes the freeing of BARs RCU-friendly Changes from v2: 1) not removing anymore the NULL assignment in vfio_put_base_device 2) patch 1 should "goto out_put"

[Qemu-devel] [PATCH 2/3] vfio: free dynamically-allocated data in instance_finalize

2015-02-06 Thread Paolo Bonzini
In order to enable out-of-BQL address space lookup, destruction of devices needs to be split in two phases. Unrealize is the first phase; once it complete no new accesses will be started, but there may still be pending memory accesses can still be completed. The second part is freeing the device,

Re: [Qemu-devel] [PATCH v2] blkdebug: fix "once" rule

2015-02-06 Thread Max Reitz
On 2015-02-06 at 13:23, John Snow wrote: Background: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the forthcoming action, provided

[Qemu-devel] [PATCH v2 3/3] iotests: Add test for drive-mirror with NBD target

2015-02-06 Thread Max Reitz
When the drive-mirror block job is completed, it will call bdrv_swap() on the source and the target BDS; this should obviously not result in a segmentation fault. Signed-off-by: Max Reitz Reviewed-by: Paolo Bonzini --- tests/qemu-iotests/094 | 81

[Qemu-devel] [PATCH v2 1/3] nbd: Drop BDS backpointer

2015-02-06 Thread Max Reitz
Before this patch, the "opaque" pointer in an NBD BDS points to a BDRVNBDState, which contains an NbdClientSession object, which in turn contains a pointer to the BDS. This pointer may become invalid due to bdrv_swap(), so drop it, and instead pass the BDS directly to the nbd-client.c functions whi

[Qemu-devel] [PATCH v2 2/3] iotests: Add "wait" functionality to _cleanup_qemu

2015-02-06 Thread Max Reitz
The qemu process does not always need to be killed, just waiting for it can be fine, too. This introduces a way to do so. Signed-off-by: Max Reitz Reviewed-by: Paolo Bonzini --- tests/qemu-iotests/common.qemu | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests

[Qemu-devel] [PATCH v2 0/3] nbd: Drop BDS backpointer

2015-02-06 Thread Max Reitz
Right now, bdrv_swap() on NBD BDSs results in a segmentation fault pretty much all of the time. This series fixes this. Note that this is not a common case, as bdrv_swap() is generally only performed on root BDSs (there are exceptions, though) and NBD BDSs normally have a format BDS above them. Ho

Re: [Qemu-devel] [PATCH 1/7] softfloat: Fix sNaN handling in FP conversion operations

2015-02-06 Thread Maciej W. Rozycki
On Fri, 6 Feb 2015, Peter Maydell wrote: > > What I think would make sense here is instead of say `float32_to_float64' > > making a call to `float64_maybe_silence_nan' directly, we'd have a static > > inline function or a macro called say `float64_convert_silence_nan' > > invoked where the former

Re: [Qemu-devel] [PATCH v3 0/7] cpu: add device_add foo-x86_64-cpu support

2015-02-06 Thread Jeff King
On Thu, Feb 05, 2015 at 12:17:15PM -0800, Junio C Hamano wrote: > > Would "length() > 1" be enough[1]? Or are people really typing "yes" and > > not just "y"? > > > > I cannot imagine a charset name that is smaller than two characters. It > > may be that there are none smaller than 4, and we could

[Qemu-devel] X86 cpuid reported feature

2015-02-06 Thread Xin Tong
I am wondering why QEMU requires host CPU to support a feature for a emulated CPU to support the same feature. say i want to support intel transactional memory. I put the CPUID_7_0_EBX_RTM flag in the haswell cpu feature list. However, why do i need to put the same flag into TCG_7_0_EBX_FEATURES in

[Qemu-devel] [PATCH v2] blkdebug: fix "once" rule

2015-02-06 Thread John Snow
Background: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the forthcoming action, provided the events and state numbers match. Then

[Qemu-devel] [PATCH 2/3] guest agent: guest-file-open: refactoring

2015-02-06 Thread Denis V. Lunev
From: Simon Zolin Moved the code that sets non-blocking flag on fd into a separate function. Signed-off-by: Simon Zolin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Michael Roth CC: Eric Blake --- qga/commands-posix.c | 31 +++ 1 file changed, 23 i

[Qemu-devel] [PATCH 3/3] qga: implement file commands for Windows guest

2015-02-06 Thread Denis V. Lunev
From: Olga Krishtal The following commands are implemented: - guest_file_open - guest_file_close - guest_file_write - guest_file_read - guest_file_seek - guest_file_flush Motivation is quite simple: Windows guests should be supported with the same set of features as Linux one. Also this patch is

[Qemu-devel] [PATCH 1/3] utils: drop strtok_r from envlist_parse

2015-02-06 Thread Denis V. Lunev
From: Olga Krishtal The problem is that mingw 4.9.1 fails to compile the code with the following warning: /mingw/include/string.h:88:9: note: previous declaration of 'strtok_r' was here char *strtok_r(char * __restrict__ _Str, const char * __restrict__ _Delim,

[Qemu-devel] [PATCH 0/3] qemu guest agent: support guest-file-* command for Windows

2015-02-06 Thread Denis V. Lunev
This was a part of patchset implemented guest-exec command. It was suggested to submit it separately by Michael. The set contains small refactoring to fix mingw 4.9.1 compilation and safe part of the rework of posix file interface plus main Windows file commands implementation. Changes from previ

Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings

2015-02-06 Thread Peter Maydell
On 6 February 2015 at 17:37, Eric Blake wrote: > On 02/06/2015 07:34 AM, Peter Maydell wrote: > HACKING already implies we assume sane 2's complement behavior of shifts > (maybe it's worth another line for this particular case of shifting into > the signed bit of a signed result, and figuring out

[Qemu-devel] [PATCH 2/2] block: align bounce buffers to page

2015-02-06 Thread Denis V. Lunev
The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4096); performs 5% better if buf is aligned to 4096 bytes. The difference is quite reliable. On the other hand we do not want at the moment to enforce

[Qemu-devel] [PATCH 1/2] block, raw-posix: replace 512/4096 constants with proper macros/values

2015-02-06 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Kevin Wolf --- block.c | 10 +- block/raw-posix.c | 16 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block.c b/block.c index d45e4dd..e98d651 100644 --- a/block.c +++ b/block.c @@ -225,8 +

Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings

2015-02-06 Thread Eric Blake
On 02/06/2015 07:34 AM, Peter Maydell wrote: > This patchset fixes a collection of warnings emitted by the clang > undefined behaviour sanitizer in the course of booting an AArch64 > Linux guest to a shell prompt. These are all various kinds of bad > shift (shifting into the sign bit, left shifting

[Qemu-devel] [PULL v2 47/47] block/raw-posix.c: Fix raw_getlength() on Mac OS X block devices

2015-02-06 Thread Kevin Wolf
From: Programmingkid This patch replaces the dummy code in raw_getlength() for block devices on OS X, which always returned LLONG_MAX, with a real implementation that returns the actual block device size. Signed-off-by: John Arbuckle Reviewed-by: Stefan Hajnoczi Tested-by: Peter Maydell Signe

[Qemu-devel] [PATCH v4 0/1] block: enforce minimal 4096 alignment in qemu_blockalign

2015-02-06 Thread Denis V. Lunev
The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4096); iperforms 5% better if buf is aligned to 4096 bytes rather then to 512 bytes. I have used the following program to test #define _GNU_SOURCE #inc

[Qemu-devel] [PULL v2 43/47] blockdev: Give find_block_job() an Error ** parameter

2015-02-06 Thread Kevin Wolf
From: Markus Armbruster When find_block_job() fails, all its callers build the same Error object. Build it in find_block_job() instead. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-id: 1422524221-8566-2-git-send-email-arm...@redhat.com Reviewed-by: Max Reitz Signed-off-by

[Qemu-devel] [PULL v2 46/47] block: Eliminate silly QERR_ macros used for encryption keys

2015-02-06 Thread Kevin Wolf
From: Markus Armbruster The QERR_ macros are leftovers from the days of "rich" error objects. They're used with error_set() and qerror_report(), and expand into the first *two* arguments. This trickiness has become pointless. Clean up QERR_DEVICE_ENCRYPTED and QERR_DEVICE_NOT_ENCRYPTED. Signed

[Qemu-devel] [PULL v2 00/47] Block patches

2015-02-06 Thread Kevin Wolf
[ Posting only the new patches in v2 as replies, see v1 for the rest ] The following changes since commit cebbae86b4f7ee3d3dd9df906b97d269e70d9cc7: Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging (2015-02-06 14:35:52 +) are available in the git repositor

[Qemu-devel] [PULL v2 45/47] block: New bdrv_add_key(), convert monitor to use it

2015-02-06 Thread Kevin Wolf
From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-id: 1422524221-8566-4-git-send-email-arm...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block.c | 29 + blockdev.c| 24 ++-

[Qemu-devel] [PULL v2 44/47] blockdev: Eliminate silly QERR_BLOCK_JOB_NOT_ACTIVE macro

2015-02-06 Thread Kevin Wolf
From: Markus Armbruster The QERR_ macros are leftovers from the days of "rich" error objects. They're used with error_set() and qerror_report(), and expand into the first *two* arguments. This trickiness has become pointless. Clean this one up. Signed-off-by: Markus Armbruster Reviewed-by: Er

Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings

2015-02-06 Thread Richard Henderson
On 02/06/2015 08:43 AM, Peter Maydell wrote: > On 6 February 2015 at 16:20, Richard Henderson wrote: >> It should be enough to simply add the unsigned suffix to the integers as they >> are, forcing the underlying type to be unsigned. > > I can't see anything in the C99 spec that justifies this >

Re: [Qemu-devel] [PATCH v5 0/4] ARM: Add support for a generic PCI Express host bridge

2015-02-06 Thread Peter Maydell
On 6 February 2015 at 17:04, Alexander Graf wrote: > Linux implements a nice binding to describe a "generic" PCI Express host > bridge > using only device tree. > > This patch set adds enough emulation logic to expose the parts that are > "generic" as a simple sysbus device and maps it into ARM's

Re: [Qemu-devel] [PATCH v8] block/raw-posix.c: Fix raw_getlength() on Mac OS X for CD

2015-02-06 Thread Kevin Wolf
Am 19.01.2015 um 23:12 hat Programmingkid geschrieben: > Subject was: > Re: [PATCH v7] block/raw-posix.c: Fixes raw_getlength() > on Mac OS X so that it reports the correct length of a real CD > > This patch allows Mac OS X to use a real CDROM disc in QEMU. > Testing this patch will require usin

[Qemu-devel] [PATCH v5 1/4] pci: Allocate PCIe host bridge PCI ID

2015-02-06 Thread Alexander Graf
We are going to introduce a PCIe host controller that doesn't exist that way in real hardware, but still needs to expose some PCIe root device which has PCI IDs. Allocate a PCI ID in the Red Hat space that we use for other devices of this kind. Signed-off-by: Alexander Graf --- include/hw/pci/p

[Qemu-devel] [PATCH v5 0/4] ARM: Add support for a generic PCI Express host bridge

2015-02-06 Thread Alexander Graf
Linux implements a nice binding to describe a "generic" PCI Express host bridge using only device tree. This patch set adds enough emulation logic to expose the parts that are "generic" as a simple sysbus device and maps it into ARM's virt machine. With this patch set, we can finally spawn PCI de

Re: [Qemu-devel] [RFC PATCH v3] tests: rtl8139: test timers and interrupt

2015-02-06 Thread Frediano Ziglio
2015-02-06 16:54 GMT+00:00 Stefan Hajnoczi : > On Thu, Jan 08, 2015 at 06:38:23PM +, Frediano Ziglio wrote: >> Test behaviour of timers and interrupts related to timeouts. >> >> Signed-off-by: Frediano Ziglio >> --- >> tests/Makefile | 2 +- >> tests/rtl8139-test.c | 181 >> +

Re: [Qemu-devel] [PATCH v11 12/13] qemu-iotests: Add tests for drive-backup sync=dirty-bitmap

2015-02-06 Thread John Snow
On 02/06/2015 09:23 AM, Vladimir Sementsov-Ogievskiy wrote: On 12.01.2015 19:31, John Snow wrote: From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: John Snow --- tests/qemu-iotests/056| 33 ++--- tests/qemu-iotests/056.out| 4 ++-- tests/q

[Qemu-devel] [PATCH 2/9] exec: make iotlb RCU-friendly

2015-02-06 Thread Paolo Bonzini
After the previous patch, TLBs will be flushed on every change to the memory mapping. This patch augments that with synchronization of the MemoryRegionSections referred to in the iotlb array. With this change, it is guaranteed that iotlb_to_region will access the correct memory map, even once the

[Qemu-devel] [PATCH 6/9] exec: protect mru_block with RCU

2015-02-06 Thread Paolo Bonzini
Hence, freeing a RAMBlock has to be switched to call_rcu. Signed-off-by: Paolo Bonzini --- exec.c | 52 +++--- include/exec/cpu-all.h | 2 ++ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/exec.c b/exec.c index a423de

[Qemu-devel] [PATCH 4/9] rcu: prod call_rcu thread when calling synchronize_rcu

2015-02-06 Thread Paolo Bonzini
call_rcu operates on the principle that either there is a steady stream of incoming RCU callbacks, or it is not worthwhile to wake up and process the few that are there. This however makes it hard to assert in testcases that all RCU callbacks are processed. To avoid this, make call_rcu also proce

[Qemu-devel] [PATCH 9/9] Convert ram_list to RCU

2015-02-06 Thread Paolo Bonzini
From: Mike Day Allow "unlocked" reads of the ram_list by using an RCU-enabled QLIST. The ramlist mutex is kept, because call_rcu callbacks are not run within the iothread lock. Thus, writers still need to take the ramlist mutex, but they no longer need to assume that the iothread lock is taken.

[Qemu-devel] [PATCH 8/9] exec: convert ram_list to QLIST

2015-02-06 Thread Paolo Bonzini
From: Mike Day QLIST has RCU-friendly primitives, so switch to it. Signed-off-by: Mike Day Signed-off-by: Paolo Bonzini --- arch_init.c | 19 exec.c | 52 +--- include/exec/cpu-all.h | 4 ++-

[Qemu-devel] [PATCH 5/9] rcu: introduce RCU-enabled QLIST

2015-02-06 Thread Paolo Bonzini
From: Mike Day Add RCU-enabled variants on the existing bsd DQ facility. Each operation has the same interface as the existing (non-RCU) version. Also, each operation is implemented as macro. Using the RCU-enabled QLIST, existing QLIST users will be able to convert to RCU without using a differe

[Qemu-devel] [PATCH v5 4/4] pci: Move PCI VGA to pci.mak

2015-02-06 Thread Alexander Graf
Every platform that supports PCI can also spawn the Bochs VGA PCI adapter. Move it to pci.mak to enable it for everyone. Signed-off-by: Alexander Graf --- default-configs/alpha-softmmu.mak| 2 -- default-configs/i386-softmmu.mak | 2 -- default-configs/mips-softmmu.mak | 2 -- defaul

Re: [Qemu-devel] [RFC PATCH v3] tests: rtl8139: test timers and interrupt

2015-02-06 Thread Stefan Hajnoczi
On Thu, Jan 08, 2015 at 06:38:23PM +, Frediano Ziglio wrote: > Test behaviour of timers and interrupts related to timeouts. > > Signed-off-by: Frediano Ziglio > --- > tests/Makefile | 2 +- > tests/rtl8139-test.c | 181 > +++ > 2 files

[Qemu-devel] [PATCH v3 0/9] RCUification of the memory API, part 2

2015-02-06 Thread Paolo Bonzini
Part 2 converts ram_list to RCU. It is enough of a base for Stefan's work on thread-safe migration bitmaps. Part 3 (not yet posted because it won't be in 2.3 anyway) will separate removal and reclamation of device data. Part 4 will switch KVM MMIO and PIO to unlocked lookup and convert a single

[Qemu-devel] [PATCH 3/9] exec: RCUify AddressSpaceDispatch

2015-02-06 Thread Paolo Bonzini
Note that even after this patch, most callers of address_space_* functions must still be under the big QEMU lock, otherwise the memory region returned by address_space_translate can disappear as soon as address_space_translate returns. This will be fixed in the next part of this series. Reviewed-

[Qemu-devel] [PATCH v5 2/4] pci: Add generic PCIe host bridge

2015-02-06 Thread Alexander Graf
With simple exposure of MMFG, ioport window, mmio window and an IRQ line we can successfully create a workable PCIe host bridge that can be mapped anywhere and only needs to get described to the OS using whatever means it likes. This patch implements such a "generic" host bridge. It handles 4 lega

Re: [Qemu-devel] [PATCH] net: synchronize net_host_device_remove with host_net_remove_completion

2015-02-06 Thread Stefan Hajnoczi
On Fri, Feb 06, 2015 at 03:46:42PM +0100, Paolo Bonzini wrote: > > > On 06/02/2015 14:54, Stefan Hajnoczi wrote: > > On Mon, Jan 19, 2015 at 12:27:11PM +0100, Paolo Bonzini wrote: > >> On 02/01/2015 17:20, Paolo Bonzini wrote: > > > > The assert can be dropped completely since the code al

[Qemu-devel] [PULL 36/42] iotests: Fix 100 for nbd

2015-02-06 Thread Kevin Wolf
From: Max Reitz In case of NBD, _make_test_img starts a new NBD server. Therefore, _cleanup_test_img (which shuts that server down) has to be invoked before the next _make_test_img call in order to make 100 work for NBD. Signed-off-by: Max Reitz Reviewed-by: Paolo Bonzini Signed-off-by: Kevin

Re: [Qemu-devel] Google Summer of Code 2015 - Implement Mac OS 9 support

2015-02-06 Thread Programmingkid
On Feb 6, 2015, at 11:14 AM, Stefan Hajnoczi wrote: > On Thu, Feb 05, 2015 at 11:07:40AM -0500, Programmingkid wrote: >> Implement support for Mac OS 9 in QEMU. >> >> QEMU has gone a long way in emulating a Macintosh. But we can still improve. >> Adding support for Mac OS 9 would be a great imp

[Qemu-devel] [PATCH v5 3/4] arm: Add PCIe host bridge in virt machine

2015-02-06 Thread Alexander Graf
Now that we have a working "generic" PCIe host bridge driver, we can plug it into ARM's virt machine to always have PCIe available to normal ARM VMs. I've successfully managed to expose a Bochs VGA device, XHCI and an e1000 into an AArch64 VM with this and they all lived happily ever after. Signe

Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings

2015-02-06 Thread Peter Maydell
On 6 February 2015 at 16:20, Richard Henderson wrote: > It should be enough to simply add the unsigned suffix to the integers as they > are, forcing the underlying type to be unsigned. I can't see anything in the C99 spec that justifies this as a fix... In fact, 6.7.2.2 para 3 says "The identifie

[Qemu-devel] [PULL 35/42] iotests: Fix 083

2015-02-06 Thread Kevin Wolf
From: Max Reitz As of 8f9e835fd2e687d2bfe936819c3494af4343614d, probing should be disabled in the qemu-iotests (at least when using qemu-io). This broke 083's reference output (which consisted mostly of "Could not read image for determining its format"). This patch fixes it. Note that one case

[Qemu-devel] [PULL 39/42] block: introduce BDRV_REQUEST_MAX_SECTORS

2015-02-06 Thread Kevin Wolf
From: Peter Lieven we check and adjust request sizes at several places with sometimes inconsistent checks or default values: INT_MAX INT_MAX >> BDRV_SECTOR_BITS UINT_MAX >> BDRV_SECTOR_BITS SIZE_MAX >> BDRV_SECTOR_BITS This patches introdocues a macro for the maximal allowed sectors per requ

[Qemu-devel] [PULL 42/42] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-06 Thread Kevin Wolf
From: Max Reitz qcow2_alloc_bytes() is a function with insufficient error handling and an unnecessary goto. This patch rewrites it. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 78 +- 1 file changed, 39 inserti

[Qemu-devel] [PULL 40/42] nbd: fix max_discard/max_transfer_length

2015-02-06 Thread Kevin Wolf
From: "Denis V. Lunev" nbd_co_discard calls nbd_client_session_co_discard which uses uint32_t as the length in bytes of the data to discard due to the following definition: struct nbd_request { uint32_t magic; uint32_t type; uint64_t handle; uint64_t from; uint32_t len; <-- t

[Qemu-devel] [PULL 38/42] nbd: Improve error messages

2015-02-06 Thread Kevin Wolf
From: Max Reitz This patch makes use of the Error object for nbd_receive_negotiate() so that errors during negotiation look nicer. Furthermore, this patch adds an additional error message if the received magic was wrong, but would be correct for the other protocol version, respectively: So if an

[Qemu-devel] [PULL 30/42] block/dmg: support bzip2 block entry types

2015-02-06 Thread Kevin Wolf
From: Peter Wu This patch adds support for bzip2-compressed block entries as introduced with OS X 10.4 (source: https://en.wikipedia.org/wiki/Apple_Disk_Image). It was tested against a 5.2G "OS X Yosemite" installation image which stores the BLXX block in the XML property list (instead of resour

[Qemu-devel] [PATCH 7/9] cosmetic changes preparing for the following patches

2015-02-06 Thread Paolo Bonzini
From: Mike Day Signed-off-by: Mike Day Signed-off-by: Paolo Bonzini --- arch_init.c| 9 +++--- exec.c | 86 +- include/exec/cpu-all.h | 1 + 3 files changed, 62 insertions(+), 34 deletions(-) diff --git a/arch_init.

[Qemu-devel] [PULL 41/42] block: Give always priority to unused entries in the qcow2 L2 cache

2015-02-06 Thread Kevin Wolf
From: Alberto Garcia The current algorithm to replace entries from the L2 cache gives priority to newer hits by dividing the hit count of all existing entries by two everytime there is a cache miss. However, if there are several cache misses the hit count of the existing entries can easily go do

[Qemu-devel] [PULL 33/42] qemu-iotests: add 116 invalid QED input file tests

2015-02-06 Thread Kevin Wolf
From: Stefan Hajnoczi These tests exercise error code paths in the QED image format. The tests are very simple, they just prove that the error path exits cleanly. Signed-off-by: Stefan Hajnoczi Message-id: 1421065893-18875-3-git-send-email-stefa...@redhat.com Reviewed-by: Kevin Wolf Signed-of

[Qemu-devel] [PATCH 1/9] exec: introduce cpu_reload_memory_map

2015-02-06 Thread Paolo Bonzini
This for now is a simple TLB flush. This can change later for two reasons: 1) an AddressSpaceDispatch will be cached in the CPUState object 2) it will not be possible to do tlb_flush once the TCG-generated code runs outside the BQL. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- cpu

[Qemu-devel] [PULL 34/42] block: fix off-by-one error in qcow and qcow2

2015-02-06 Thread Kevin Wolf
From: Jeff Cody This fixes an off-by-one error introduced in 9a29e18. Both qcow and qcow2 need to make sure to leave room for string terminator '\0' for the backing file, so the max length of the non-terminated string is either 1023 or PATH_MAX - 1. Reported-by: Kevin Wolf Signed-off-by: Jeff

[Qemu-devel] [PULL 27/42] block/dmg: fix sector data offset calculation

2015-02-06 Thread Kevin Wolf
From: Peter Wu This patch addresses two issues: - The data fork offset was not taken into account, resulting in failure to read an InstallESD.dmg file (5164763151 bytes) which had a non-zero DataForkOffset field. - The offset of the previous block ("partition") was unconditionally add

[Qemu-devel] [PULL 24/42] block/dmg: validate chunk size to avoid overflow

2015-02-06 Thread Kevin Wolf
From: Peter Wu Previously the chunk size was not checked, allowing for a large memory allocation. This patch checks whether the chunks size is within the resource fork length, and whether the resource fork is below the trailer of the dmg file. Signed-off-by: Peter Wu Reviewed-by: John Snow Mes

Re: [Qemu-devel] [PATCH V3 2/2] target-arm: Guest cpu endianness determination for virtio KVM ARM/ARM64

2015-02-06 Thread Pranavkumar Sawargaonkar
Hi PMM, On 5 February 2015 at 17:18, Peter Maydell wrote: > On 5 February 2015 at 11:43, Peter Maydell wrote: >> On 5 February 2015 at 09:59, Pranavkumar Sawargaonkar >> wrote: >>> + >>> +/* In 32bit guest endianess is determined by looking at CPSR's E bit */ >>> +if (!is_a64(env)) { >>

[Qemu-devel] [PULL 32/42] qed: check for header size overflow

2015-02-06 Thread Kevin Wolf
From: Stefan Hajnoczi Header size is denoted in clusters. The maximum cluster size is 64 MB but there is no limit on header size. Check for uint32_t overflow in case the header size field has a whacky value. Signed-off-by: Stefan Hajnoczi Message-id: 1421065893-18875-2-git-send-email-stefa...

[Qemu-devel] [PULL 25/42] block/dmg: process XML plists

2015-02-06 Thread Kevin Wolf
From: Peter Wu The format is simple enough to avoid using a full-blown XML parser. It assumes that all BLKX items begin with the "mish" magic word, therefore it is not a problem if other values get matched which are not a BLKX block. The offsets are based on the description at http://newosxbook.

[Qemu-devel] [PULL 19/42] block: add event when disk usage exceeds threshold

2015-02-06 Thread Kevin Wolf
From: Francesco Romani Managing applications, like oVirt (http://www.ovirt.org), make extensive use of thin-provisioned disk images. To let the guest run smoothly and be not unnecessarily paused, oVirt sets a disk usage threshold (so called 'high water mark') based on the occupation of the device

[Qemu-devel] [PULL 31/42] block/dmg: improve zeroes handling

2015-02-06 Thread Kevin Wolf
From: Peter Wu Disk images may contain large all-zeroes gaps (1.66k sectors or 812 MiB is seen in the real world). These blocks (type 2) do not need to be extracted into a temporary buffer, there is no need to allocate memory for these blocks nor to check its length. (For the test image, the max

[Qemu-devel] [PULL 37/42] iotests: Fix 104 for NBD

2015-02-06 Thread Kevin Wolf
From: Max Reitz _make_test_img sets up an NBD server, _cleanup_test_img shuts it down; thus, _cleanup_test_img has to be called before _make_test_img is invoked another time. Furthermore, the pipe through _filter_test_img was unnecessary; _make_test_img already takes care of that. And finally,

[Qemu-devel] [PULL 16/42] virtio-blk: add a knob to disable request merging

2015-02-06 Thread Kevin Wolf
From: Peter Lieven this adds a knob to disable request merging for debugging or benchmarks if dedired. Signed-off-by: Peter Lieven Signed-off-by: Kevin Wolf --- hw/block/virtio-blk.c | 5 - include/hw/virtio/virtio-blk.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) di

[Qemu-devel] [PULL 12/42] block: add accounting for merged requests

2015-02-06 Thread Kevin Wolf
From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Eric Blake Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block.c| 2 ++ block/accounting.c | 7 +++ block/qapi.c | 2 ++ hmp.c | 6 +- include/block/a

[Qemu-devel] [PULL 29/42] block/dmg: factor out block type check

2015-02-06 Thread Kevin Wolf
From: Peter Wu In preparation for adding bzip2 support, split the type check into a separate function. Make all offsets relative to the begin of a chunk such that it is easier to recognize the position without having to add up all offsets. Some comments are added to describe the fields. There is

[Qemu-devel] [PULL 13/42] hw/virtio-blk: add a constant for max number of merged requests

2015-02-06 Thread Kevin Wolf
From: Peter Lieven As it was not obvious (at least for me) where the 32 comes from; add a constant for it. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- hw/block/virtio-blk.c | 2 +- include/hw/virtio/virtio-blk.h | 4 +++-

[Qemu-devel] [PULL 17/42] qemu-iotests: Fix supported_oses check

2015-02-06 Thread Kevin Wolf
From: Fam Zheng There is a bug in the recently added sys.platform test, and we no longer run python tests, because "linux2" is the value to compare here. So do a prefix match. According to python doc [1], the way to use sys.platform is "unless you want to test for a specific system version, it is

[Qemu-devel] [PULL 28/42] block/dmg: use SectorNumber from BLKX header

2015-02-06 Thread Kevin Wolf
From: Peter Wu Previously the sector table parsing relied on the previous offset of the DMG file. Now it uses the sector number from the BLKX header (see http://newosxbook.com/DMG.html). The implementation of dmg2img (from vu1tur) does not base the output sector on the location of the terminator

[Qemu-devel] [PULL 22/42] block/dmg: extract processing of resource forks

2015-02-06 Thread Kevin Wolf
From: Peter Wu Besides the offset, also read the resource length. This length is now used in the extracted function to verify the end of the resource fork against "count" from the resource fork. Instead of relying on the value of offset to conclude whether the resource fork is available or not (

[Qemu-devel] [PULL 23/42] block/dmg: process a buffer instead of reading ints

2015-02-06 Thread Kevin Wolf
From: Peter Wu As the decoded plist XML is not a pointer in the file, dmg_read_mish_block must be able to process a buffer instead of a file pointer. Since the full buffer must be processed, let's change the return value again to just a success flag. Signed-off-by: Peter Wu Reviewed-by: John Sn

[Qemu-devel] [PULL 06/42] block: use fallocate(FALLOC_FL_ZERO_RANGE) in handle_aiocb_write_zeroes

2015-02-06 Thread Kevin Wolf
From: "Denis V. Lunev" This efficiently writes zeroes on Linux if the kernel is capable enough. FALLOC_FL_ZERO_RANGE correctly handles all cases, including and not including file expansion. CC: Kevin Wolf CC: Stefan Hajnoczi CC: Peter Lieven CC: Fam Zheng Signed-off-by: Denis V. Lunev Revie

[Qemu-devel] [PULL 11/42] qed: Really remove unused field QEDAIOCB.finished

2015-02-06 Thread Kevin Wolf
From: Fam Zheng The commit 533ffb17a that removed qed_aiocb_info.cancel said to remove this but didn't do it. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/qed.h | 1 - 1 file changed, 1 deletion(-) diff --git a/block/qed.h b/block/qed.h index d3934a0..615e676 100644 --- a/blo

[Qemu-devel] [PULL 20/42] block/dmg: properly detect the UDIF trailer

2015-02-06 Thread Kevin Wolf
From: Peter Wu DMG files have a variable length with a UDIF trailer at the end of a file. This UDIF trailer is essential as it describes the contents of the image. At the moment however, the start of this trailer is almost always incorrect as bdrv_getlength() returns a multiple of the block size

[Qemu-devel] [PULL 21/42] block/dmg: extract mish block decoding functionality

2015-02-06 Thread Kevin Wolf
From: Peter Wu Extract the mish block decoder such that this can be used for other formats in the future. A new DmgHeaderState struct is introduced to share state while decoding. The code is kept unchanged as much as possible, a "fail" label is added for example where a simple return would proba

[Qemu-devel] [PULL 04/42] block/raw-posix: create do_fallocate helper

2015-02-06 Thread Kevin Wolf
From: "Denis V. Lunev" The pattern do { if (fallocate(s->fd, mode, offset, len) == 0) { return 0; } } while (errno == EINTR); ret = translate_err(-errno); will be commonly useful in next patches. Create helper for it. CC: Kevin Wolf CC: Stefan Hajnoczi C

[Qemu-devel] [PULL 09/42] block: change default for discard and write zeroes to INT_MAX

2015-02-06 Thread Kevin Wolf
From: Peter Lieven do not trim requests if the driver does not supply a limit through BlockLimits. For write zeroes we still keep a limit for the unsupported path to avoid allocating a big bounce buffer. Suggested-by: Kevin Wolf Suggested-by: Denis V. Lunev Signed-off-by: Peter Lieven Signed-

[Qemu-devel] [PULL 26/42] block/dmg: set virtual size to a non-zero value

2015-02-06 Thread Kevin Wolf
From: Peter Wu Right now the virtual size is always reported as zero which makes it impossible to convert between formats. After this patch, the number of sectors will be read from the trailer ("koly" block). To verify the behavior, the output of `dmg2img foo.dmg foo.img` was compared against `

  1   2   3   >