Re: [Qemu-devel] [PATCH 2/2] build: Use $(AS) for optionrom explicitly

2016-07-08 Thread Alex Bennée
Richard Henderson writes: > For clang before 3.5, -fno-integrated-as does not exist, > so the workaround in 5f6f0e27fb24 fails to build. > > Use clang's default assembler for linux-user/safe-syscall.S, > and explicitly change to use the system assembler for the > option roms. > > Signed-off-by:

Re: [Qemu-devel] [PATCH v2] ppc: Fix support for odd MSR combinations

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 13:41 +1000, Benjamin Herrenschmidt wrote: > MacOS uses an architecturally illegal MSR combination that > seems nonetheless supported by 32-bit processors, which is > to have MSR[PR]=1 and one or more of MSR[DR/IR/EE]=0. > > This adds support for it. To work properly we need

[Qemu-devel] [PATCH v2] ppc: Fix support for odd MSR combinations

2016-07-08 Thread Benjamin Herrenschmidt
MacOS uses an architecturally illegal MSR combination that seems nonetheless supported by 32-bit processors, which is to have MSR[PR]=1 and one or more of MSR[DR/IR/EE]=0. This adds support for it. To work properly we need to also properly include support for PR=1,{I,D}R=0 to the MMU index used by

Re: [Qemu-devel] [PATCH] ppc: Fix support for odd MSR combinations

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 13:22 +1000, Benjamin Herrenschmidt wrote: > MacOS uses an architecturally illegal MSR combination that > seems nonetheless supported by 32-bit processors, which is > to have MSR[PR]=1 and one or more of MSR[DR/IR/EE]=0. > > This adds support for it. To work properly we need

[Qemu-devel] [PATCH] ppc: Fix support for odd MSR combinations

2016-07-08 Thread Benjamin Herrenschmidt
MacOS uses an architecturally illegal MSR combination that seems nonetheless supported by 32-bit processors, which is to have MSR[PR]=1 and one or more of MSR[DR/IR/EE]=0. This adds support for it. To work properly we need to also properly include support for PR=1,{I,D}R=0 to the MMU index used by

Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 13:00 +1000, Benjamin Herrenschmidt wrote: > > Additionally, hreg_compute_mem_idx() will treat PR=1 as DR=1/IR=1 > > as well ! That means that if those old processors allow PR=1 and IR > > or DR=0 and MacOS uses it, we do have a TLB coherency problem in > > qemu. > > Wow, yes

Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 12:52 +1000, Benjamin Herrenschmidt wrote: >  > Additionally, hreg_compute_mem_idx() will treat PR=1 as DR=1/IR=1 > as well ! That means that if those old processors allow PR=1 and IR > or DR=0 and MacOS uses it, we do have a TLB coherency problem in > qemu. Wow, yes indeed,

Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 12:46 +1000, Benjamin Herrenschmidt wrote: > On Sat, 2016-07-09 at 01:43 +0100, Mark Cave-Ayland wrote: > > On 01/07/16 07:41, David Gibson wrote: > > > > > From: Benjamin Herrenschmidt  > > > > > > The architecture specifies that any instruction that sets MSR:PR > > > will

Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Benjamin Herrenschmidt
On Sat, 2016-07-09 at 01:43 +0100, Mark Cave-Ayland wrote: > On 01/07/16 07:41, David Gibson wrote: > > > From: Benjamin Herrenschmidt > > > > The architecture specifies that any instruction that sets MSR:PR will also > > set MSR:EE, IR and DR. .../... > Unfortunately this patch causes a regr

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 05:59:16PM -0700, Richard Henderson wrote: > On 07/08/2016 04:36 PM, Eduardo Habkost wrote: > > -#elif defined(TARGET_X86_64) > > -#define TARGET_PHYS_ADDR_SPACE_BITS 42 > > -#elif defined(TARGET_I386) > > -#define TARGET_PHYS_ADDR_SPACE_BITS 36 > > [...] > > --- a

Re: [Qemu-devel] [PULL 03/36] hw/pci: delay bus_master_enable_region initialization

2016-07-08 Thread Mark Cave-Ayland
On 04/07/16 17:46, Michael S. Tsirkin wrote: > From: Marcel Apfelbaum > > Skip bus_master_enable region creation on PCI device init > in order to be sure the IOMMU device (if present) would > be created in advance. Add this memory region at machine_done time. > > Signed-off-by: Marcel Apfelbaum

Re: [Qemu-devel] [PATCH v5 4/4] block: ignore flush requests when storage is clean

2016-07-08 Thread Evgeny Yakovlev
On 08.07.2016 02:04, Eric Blake wrote: On 07/04/2016 08:38 AM, Denis V. Lunev wrote: From: Evgeny Yakovlev Some guests (win2008 server for example) do a lot of unnecessary flushing when underlying media has not changed. This adds additional overhead on host when calling fsync/fdatasync. Thi

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Richard Henderson
On 07/08/2016 04:36 PM, Eduardo Habkost wrote: -#elif defined(TARGET_X86_64) -#define TARGET_PHYS_ADDR_SPACE_BITS 42 -#elif defined(TARGET_I386) -#define TARGET_PHYS_ADDR_SPACE_BITS 36 [...] --- a/target-i386/cpu.h +++ b/target-i386/cpu.h [...] +#ifdef TARGET_X86_64 +#define TARGE

Re: [Qemu-devel] [Qemu-ppc] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set

2016-07-08 Thread Mark Cave-Ayland
On 01/07/16 07:41, David Gibson wrote: > From: Benjamin Herrenschmidt > > The architecture specifies that any instruction that sets MSR:PR will also > set MSR:EE, IR and DR. > > Signed-off-by: Benjamin Herrenschmidt > Signed-off-by: Cédric Le Goater > Signed-off-by: David Gibson > --- > tar

Re: [Qemu-devel] [PATCH v4 0/5] x86: Physical address limit patches

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 04:01:34PM +0100, Dr. David Alan Gilbert (git) wrote: [...] > Dr. David Alan Gilbert (5): > x86: Provide TCG_PHYS_ADDR_BITS > x86: Allow physical address bits to be set > x86: Mask mtrr mask based on CPU physical address limits > x86: fill high bits of mtrr mask Pat

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 04:01:36PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Currently QEMU sets the x86 number of physical address bits to the > magic number 40. This is only correct on some small AMD systems; > Intel systems tend to have 36, 39, 46 bits, a

Re: [Qemu-devel] [PATCH v4 5/5] x86: Set physical address bits based on host

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 04:01:39PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Add the host-phys-bits boolean property, if true, take phys-bits > from the hosts physical bits value, overriding either the default > or the user specified value. > > We can also u

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 08:25:32PM +0100, Dr. David Alan Gilbert wrote: > > > +return; > > > +} > > > > > > +if (env->features[FEAT_1_EDX] & CPUID_PSE36) { > > > +cpu->phys_bits = 36; > > > +} else { > > > +cpu->phys_bits = 32; > > > >

Re: [Qemu-devel] [PATCH v4 4/5] x86: fill high bits of mtrr mask

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 04:01:38PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Fill the bits between 51..number-of-physical-address-bits in the > MTRR_PHYSMASKn variable range mtrr masks so that they're consistent > in the migration stream irrespective of the p

[Qemu-devel] [PATCH v2 4/6] nbd: Rely on block layer to break up large requests

2016-07-08 Thread Eric Blake
Now that the block layer will honor max_transfer, we can simplify our code to rely on that guarantee. The readv code can call directly into nbd-client, just as the writev code has done since commit 52a4650. Interestingly enough, while qemu-io 'w 0 40m' splits into a 32M and 8M transaction, 'w -z

[Qemu-devel] [PATCH v2 5/6] nbd: Drop unused offset parameter

2016-07-08 Thread Eric Blake
Now that NBD relies on the block layer to fragment things, we no longer need to track an offset argument for which fragment of a request we are actually servicing. While at it, use true and false instead of 0 and 1 for a bool parameter. Signed-off-by: Eric Blake Reviewed-by: Fam Zheng --- v2:

[Qemu-devel] [PATCH v2 3/6] block: Fragment writes to max transfer length

2016-07-08 Thread Eric Blake
Drivers should be able to rely on the block layer honoring the max transfer length, rather than needing to return -EINVAL (iscsi) or manually fragment things (nbd). We already fragment write zeroes at the block layer; this patch adds the fragmentation for normal writes, after requests have been al

[Qemu-devel] [PATCH v2 6/6] iscsi: Rely on block layer to break up large requests

2016-07-08 Thread Eric Blake
Now that the block layer honors max_request, we don't need to bother with an EINVAL on overlarge requests, but can instead assert that requests are well-behaved. Signed-off-by: Eric Blake Reviewed-by: Fam Zheng --- block/iscsi.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions

[Qemu-devel] [PATCH v2 2/6] raw_bsd: Don't advertise flags not supported by protocol layer

2016-07-08 Thread Eric Blake
The raw format layer supports all flags via passthrough - but it only makes sense to pass through flags that the lower layer actually supports. The next patch gives stronger reasoning for why this is correct. At the moment, the raw format layer ignores the max_transfer limit of its protocol layer,

[Qemu-devel] [PATCH v2 1/6] block: Fragment reads to max transfer length

2016-07-08 Thread Eric Blake
Drivers should be able to rely on the block layer honoring the max transfer length, rather than needing to return -EINVAL (iscsi) or manually fragment things (nbd). This patch adds the fragmentation in the block layer, after requests have been aligned (fragmenting before alignment would lead to mu

[Qemu-devel] [PATCH v2 0/6] Auto-fragment large transactions at the block layer

2016-07-08 Thread Eric Blake
We have max_transfer documented in BlockLimits, but while we honor it during pwrite_zeroes, we were blindly ignoring it during pwritev and preadv, leading to multiple drivers having to implement fragmentation themselves. This series moves fragmentation to the block layer, then fixes the NBD and is

Re: [Qemu-devel] [Qemu-block] [PULL 19/32] commit: Fix use of error handling policy

2016-07-08 Thread Eric Blake
On 07/08/2016 11:21 AM, Kevin Wolf wrote: > Commit implemented the 'enospc' policy as 'ignore' if the error was not Was there supposed to be a commit id in this sentence? > ENOSPC. The QAPI documentation promises that it's treated as 'stop'. > Using the common block job error handling function fi

Re: [Qemu-devel] [PATCH 3/3] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump()

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 22:24, Sergey Fedorov wrote: > I remember, I've just found that we discussed it in this thread: > > http://thread.gmane.org/gmane.comp.emulators.qemu/401723/focus=406852 > > I was thinking of just doing 'tb_jmp_cache' lookup out of the lock, not > tb_find_physical(). Now thanks to

[Qemu-devel] [PULL 4/4] translate-all: Fix user-mode self-modifying code in 2 page long TB

2016-07-08 Thread Richard Henderson
From: Stanislav Shmarov In user-mode emulation Translation Block can consist of 2 guest pages. In that case QEMU also mprotects 2 host pages that are dedicated for guest memory, containing instructions. QEMU detects self-modifying code with SEGFAULT signal processing. In case if instruction in 1

[Qemu-devel] [PULL 2/4] cputlb: Add address parameter to VICTIM_TLB_HIT

2016-07-08 Thread Richard Henderson
From: Samuel Damashek [rth: Split out from the original patch.] Signed-off-by: Samuel Damashek Message-Id: <20160706182652.16190-1-samuel.damas...@invincea.com> Signed-off-by: Richard Henderson --- cputlb.c | 4 ++-- softmmu_template.h | 10 +- 2 files changed, 7 insertions

[Qemu-devel] [PULL 0/4] tlb fixes for self-modifying code

2016-07-08 Thread Richard Henderson
4f4a9ca4a4386c137301b3662faba076455ff15a: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160707' into staging (2016-07-07 14:49:38 +0100) are available in the git repository at: git://github.com/rth7680/qemu.git tags/pull-tcg-20160708 for you to fetch cha

[Qemu-devel] [PULL 1/4] cputlb: Move VICTIM_TLB_HIT out of line

2016-07-08 Thread Richard Henderson
There are currently 22 invocations of this function, and we're about to increase that number. Signed-off-by: Richard Henderson --- cputlb.c | 29 + softmmu_template.h | 25 - 2 files changed, 29 insertions(+), 25 deletions(-) diff --

[Qemu-devel] [PULL 3/4] cputlb: Fix for self-modifying writes across page boundaries

2016-07-08 Thread Richard Henderson
From: Samuel Damashek As it currently stands, QEMU does not properly handle self-modifying code when the write is unaligned and crosses a page boundary. The procedure for handling a write to the current translation block is to write-protect the current translation block, catch the write, split up

Re: [Qemu-devel] [PATCH 3/3] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump()

2016-07-08 Thread Sergey Fedorov
On 08/07/16 23:18, Paolo Bonzini wrote: > > On 08/07/2016 21:55, Sergey Fedorov wrote: >> On 08/07/16 17:07, Paolo Bonzini wrote: >>> On 08/07/2016 14:32, Sergey Fedorov wrote: I think we can do even better. One option is using a separate tiny lock to protect direct jump set/reset

Re: [Qemu-devel] [PATCH 3/3] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump()

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 21:55, Sergey Fedorov wrote: > On 08/07/16 17:07, Paolo Bonzini wrote: >> >> On 08/07/2016 14:32, Sergey Fedorov wrote: >>> I think we can do even better. One option is using a separate tiny lock >>> to protect direct jump set/reset instead of tb_lock. > If you have to u

Re: [Qemu-devel] [PATCH v2 3/6] tcg: cpu-exec: remove tb_lock from the hot-path

2016-07-08 Thread Sergey Fedorov
On 05/07/16 19:18, Alex Bennée wrote: > Lock contention in the hot path of moving between existing patched > TranslationBlocks is the main drag in multithreaded performance. This > patch pushes the tb_lock() usage down to the two places that really need > it: > > - code generation (tb_gen_code) >

Re: [Qemu-devel] [PATCH 3/3] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump()

2016-07-08 Thread Sergey Fedorov
On 08/07/16 17:07, Paolo Bonzini wrote: > > On 08/07/2016 14:32, Sergey Fedorov wrote: >> I think we can do even better. One option is using a separate tiny lock >> to protect direct jump set/reset instead of tb_lock. If you have to use a separate tiny lock, you don't gain anything com

[Qemu-devel] [PATCH] linux-user: define missing sparc syscalls

2016-07-08 Thread Laurent Vivier
NR_lookup_dcookie, NR_fadvise64, NR_fadvise64_64 Signed-off-by: Laurent Vivier --- linux-user/sparc/syscall_nr.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/sparc/syscall_nr.h b/linux-user/sparc/syscall_nr.h index 732b105..e713c9d 100644 --- a/linux-user/sparc/syscall_nr.h

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Dr. David Alan Gilbert
* Eduardo Habkost (ehabk...@redhat.com) wrote: > On Fri, Jul 08, 2016 at 04:01:36PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Currently QEMU sets the x86 number of physical address bits to the > > magic number 40. This is only correct on some small AMD

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 20:59, Eduardo Habkost wrote: > > +if (env->features[FEAT_1_EDX] & CPUID_PSE36) { > > +cpu->phys_bits = 36; > > +} else { > > +cpu->phys_bits = 32; > > But TCG_PHYS_ADDR_BITS is still 36. Does this mean TCG > reserved-bit handling is broken i

Re: [Qemu-devel] [PATCH v4 2/5] x86: Allow physical address bits to be set

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 04:01:36PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Currently QEMU sets the x86 number of physical address bits to the > magic number 40. This is only correct on some small AMD systems; > Intel systems tend to have 36, 39, 46 bits, a

Re: [Qemu-devel] [PATCH v5 4/4] block: ignore flush requests when storage is clean

2016-07-08 Thread John Snow
On 07/04/2016 10:38 AM, Denis V. Lunev wrote: > From: Evgeny Yakovlev > > Some guests (win2008 server for example) do a lot of unnecessary > flushing when underlying media has not changed. This adds additional > overhead on host when calling fsync/fdatasync. > > This change introduces a write

Re: [Qemu-devel] [PATCH v4 1/5] x86: Provide TCG_PHYS_ADDR_BITS

2016-07-08 Thread Eduardo Habkost
On Fri, Jul 08, 2016 at 04:01:35PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Provide a constant for the number of address bits supported under TCG. > > Signed-off-by: Dr. David Alan Gilbert > Suggested-by: Eduardo Habkost Reviewed-by: Eduardo Habkost >

Re: [Qemu-devel] [PATCH v2 3/6] tcg: cpu-exec: remove tb_lock from the hot-path

2016-07-08 Thread Sergey Fedorov
On 08/07/16 21:03, Alex Bennée wrote: > Sergey Fedorov writes: > >> On 07/07/16 17:18, Sergey Fedorov wrote: >>> On 05/07/16 19:18, Alex Bennée wrote: Lock contention in the hot path of moving between existing patched TranslationBlocks is the main drag in multithreaded performance. This

Re: [Qemu-devel] [PATCH v11 00/28] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-07-08 Thread Radim Krčmář
2016-07-08 18:36+0200, Paolo Bonzini: > On 08/07/2016 18:01, Radim Krčmář wrote: >> The patchset doesn't work with if you have 16 APICs with IDs 0-15 and >> then some more, because KVM has hacked x2APIC support that translates >> logical interrupt with destination 0xff (first cluster of 16 VCPUs) i

Re: [Qemu-devel] [PATCH v2 3/6] tcg: cpu-exec: remove tb_lock from the hot-path

2016-07-08 Thread Sergey Fedorov
On 07/07/16 17:18, Sergey Fedorov wrote: > On 05/07/16 19:18, Alex Bennée wrote: >> Lock contention in the hot path of moving between existing patched >> TranslationBlocks is the main drag in multithreaded performance. This >> patch pushes the tb_lock() usage down to the two places that really need

[Qemu-devel] hw/misc/pci-testdev.c write access does not work

2016-07-08 Thread Alexander Gordeev
Hi all, Looks like hw/misc/pci-testdev.c does not work for wildcard-eventfd and datamatch-eventfd tests (more precisely - for any non no-eventfd tests). Test writes to pci-testdev's addresses (reported by PCITestDevHdr::offset field) do not cause invocations of MemoryRegionOps::write() callback.

Re: [Qemu-devel] [PATCH v8 11/12] vfio: register aer resume notification handler for aer resume

2016-07-08 Thread Alex Williamson
On Fri, 8 Jul 2016 09:38:50 +0800 Zhou Jie wrote: > Hi Alex, > > > The following code will be modified. > > 1. vfio_pci_ioctl > >add a flag in vfio_device_info for workable_state support > >return workable_state in "struct vfio_pci_device" when user get info > > >

Re: [Qemu-devel] [PATCH v2 3/6] tcg: cpu-exec: remove tb_lock from the hot-path

2016-07-08 Thread Alex Bennée
Sergey Fedorov writes: > On 07/07/16 17:18, Sergey Fedorov wrote: >> On 05/07/16 19:18, Alex Bennée wrote: >>> Lock contention in the hot path of moving between existing patched >>> TranslationBlocks is the main drag in multithreaded performance. This >>> patch pushes the tb_lock() usage down to

[Qemu-devel] [PULL 31/32] hmp: use snapshot name to determine whether a snapshot is 'fully available'

2016-07-08 Thread Kevin Wolf
From: Lin Ma Currently qemu uses snapshot id to determine whether a snapshot is fully available, It causes incorrect output in some scenario. For instance: (qemu) info block drive_image1 (#block113): /opt/vms/SLES12-SP1-JeOS-x86_64-GM/disk0.qcow2 (qcow2) Cache mode: writeback drive_im

[Qemu-devel] [PULL 25/32] qemu-io: Use correct range limitations

2016-07-08 Thread Kevin Wolf
From: Max Reitz create_iovec() has a comment lamenting the lack of SIZE_T_MAX. Since there actually is a SIZE_MAX, use it. Two places use INT_MAX for checking the upper bound of a sector count that is used as an argument for a blk_*() function (blk_discard() and blk_write_compressed(), respectiv

[Qemu-devel] [PULL 30/32] qemu-iotests: Test naming of throttling groups

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia Throttling groups are named using the 'group' parameter of the block_set_io_throttle command and the throttling.group command-line option. If that parameter is unspecified the groups get the name of the block device. This patch adds a new test to check the naming of throttli

Re: [Qemu-devel] hw/misc/pci-testdev.c write access does not work

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 19:46, Alexander Gordeev wrote: > Hi all, > > Looks like hw/misc/pci-testdev.c does not work for wildcard-eventfd and > datamatch-eventfd tests (more precisely - for any non no-eventfd tests). > > Test writes to pci-testdev's addresses (reported by PCITestDevHdr::offset > field) d

[Qemu-devel] [PULL 23/32] qemu-img: Use strerror() for generic resize error

2016-07-08 Thread Kevin Wolf
From: Max Reitz Emitting the plain error number is not very helpful. Use strerror() instead. Signed-off-by: Max Reitz Message-id: 20160615153630.2116-2-mre...@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[Qemu-devel] [PULL 27/32] Improve block job rate limiting for small bandwidth values

2016-07-08 Thread Kevin Wolf
From: Sascha Silbe ratelimit_calculate_delay() previously reset the accounting every time slice, no matter how much data had been processed before. This had (at least) two consequences: 1. The minimum speed is rather large, e.g. 5 MiB/s for commit and stream. Not sure if there are real-world

Re: [Qemu-devel] [PATCH v5 00/15] backup compression

2016-07-08 Thread Denis V. Lunev
On 07/04/2016 03:28 PM, Denis V. Lunev wrote: The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it. These patches add the ability to compress data during backup. This functionality is imple

[Qemu-devel] [PULL 24/32] qcow2: Avoid making the L1 table too big

2016-07-08 Thread Kevin Wolf
From: Max Reitz We refuse to open images whose L1 table we deem "too big". Consequently, we should not produce such images ourselves. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz Message-id: 20160615153630.2116-3-mre...@redhat.com Reviewed-by: Eric Blake [mreitz: Added QEMU_BUILD_BUG_ON

[Qemu-devel] [PULL 26/32] qcow2: Fix qcow2_get_cluster_offset()

2016-07-08 Thread Kevin Wolf
From: Max Reitz Recently, qcow2_get_cluster_offset() has been changed to work with bytes instead of sectors. This invalidated some assertions and introduced a possible integer multiplication overflow. This could be reproduced using e.g. $ qemu-img create -f qcow2 -o cluster_size=1M blub.qcow2 8

[Qemu-devel] [PULL 16/32] coroutine: move entry argument to qemu_coroutine_create

2016-07-08 Thread Kevin Wolf
From: Paolo Bonzini In practice the entry argument is always known at creation time, and it is confusing that sometimes qemu_coroutine_enter is used with a non-NULL argument to re-enter a coroutine (this happens in block/sheepdog.c and tests/test-coroutine.c). So pass the opaque value at creatio

[Qemu-devel] [PULL 32/32] hmp: show all of snapshot info on every block dev in output of 'info snapshots'

2016-07-08 Thread Kevin Wolf
From: Lin Ma Currently, the output of 'info snapshots' shows fully available snapshots. It's opaque, hides some snapshot information to users. It's not convenient if users want to know more about all of snapshot information on every block device via monitor. Follow Kevin's and Max's proposals, T

[Qemu-devel] [PULL 11/32] blockjob: Update description of the 'device' field in the QMP API

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia The 'device' field in all BLOCK_JOB_* events and 'block-job-*' command is no longer the device name, but the ID of the job. This patch updates the documentation to clarify that. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Ke

[Qemu-devel] [PULL 29/32] blockdev: Fix regression with the default naming of throttling groups

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia When I/O limits are set for a block device, the name of the throttling group is taken from the BlockBackend if the user doesn't specify one. Commit efaa7c4eeb7490c6f37f3 moved the naming of the BlockBackend in blockdev_init() to the end of the function, after I/O limits are

[Qemu-devel] [PULL 28/32] vmdk: fix metadata write regression

2016-07-08 Thread Kevin Wolf
From: Reda Sallahi Commit "cdeaf1f vmdk: add bdrv_co_write_zeroes" causes a regression on writes. It writes metadata after every write instead of doing it only once for each cluster. vmdk_pwritev() writes metadata whenever m_data is set as valid so this patch sets m_data as valid only when we ha

[Qemu-devel] [PULL 08/32] stream: Add 'job-id' parameter to 'block-stream'

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia This patch adds a new optional 'job-id' parameter to 'block-stream', allowing the user to specify the ID of the block job to be created. The HMP 'block_stream' command remains unchanged. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Max Reitz Signed-

[Qemu-devel] [PULL 21/32] qemu-iotests: Test setting WCE with qdev

2016-07-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/157 | 88 ++ tests/qemu-iotests/157.out | 22 tests/qemu-iotests/group | 1 + 3 files changed, 111 insertions(+) create mode 100755 tests/qemu-iotests/157 cre

[Qemu-devel] [PULL 10/32] qemu-img: Set the ID of the block job in img_commit()

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia img_commit() creates a block job without an ID. This is no longer allowed now that we require it to be unique and well-formed. We were solving this by having a fallback in block_job_create(), but now that we extended the API of commit_active_start() we can finally set an expl

[Qemu-devel] [PULL 20/32] block/qdev: Allow configuring rerror/werror with qdev properties

2016-07-08 Thread Kevin Wolf
The rerror/werror policies are implemented in the devices, so that's where they should be configured. In comparison to the old options in -drive, the qdev properties are only added to those devices that actually support them. If the option isn't given (or "auto" is specified), the setting of the B

[Qemu-devel] [PULL 19/32] commit: Fix use of error handling policy

2016-07-08 Thread Kevin Wolf
Commit implemented the 'enospc' policy as 'ignore' if the error was not ENOSPC. The QAPI documentation promises that it's treated as 'stop'. Using the common block job error handling function fixes this and also adds the missing QMP event. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- bl

[Qemu-devel] [PULL 22/32] block: Remove BB options from blockdev-add

2016-07-08 Thread Kevin Wolf
werror/rerror are now available as qdev options. The stats-* options are removed without an existing replacement; they should probably be configurable with a separate QMP command like I/O throttling settings. Removing id is left for another day because this involves updating qemu-iotests cases to

[Qemu-devel] [PULL 07/32] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup'

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia This patch adds a new optional 'job-id' parameter to 'blockdev-backup' and 'drive-backup', allowing the user to specify the ID of the block job to be created. The HMP 'drive_backup' command remains unchanged. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-

[Qemu-devel] [PULL 13/32] raw-posix: Use qemu_dup

2016-07-08 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Max Reitz Reviewed-by: Kevin Wolf Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- block/raw-posix.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index c979ac3..d

[Qemu-devel] [PULL 18/32] block/qdev: Allow configuring WCE with qdev properties

2016-07-08 Thread Kevin Wolf
As cache.writeback is a BlockBackend property and as such more related to the guest device than the BlockDriverState, we already removed it from the blockdev-add interface. This patch adds the new way to set it, as a qdev property of the corresponding guest device. For example: -drive if=none,file

[Qemu-devel] [PULL 09/32] commit: Add 'job-id' parameter to 'block-commit'

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia This patch adds a new optional 'job-id' parameter to 'block-commit', allowing the user to specify the ID of the block job to be created. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/commit.c

[Qemu-devel] [PULL 06/32] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror'

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia This patch adds a new optional 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror', allowing the user to specify the ID of the block job to be created. The HMP 'drive_mirror' command remains unchanged. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-

[Qemu-devel] [PULL 03/32] blockjob: Add block_job_get()

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia Currently the way to look for a specific block job is to iterate the list manually using block_job_next(). Since we want to be able to identify a job primarily by its ID it makes sense to have a function that does just that. Signed-off-by: Alberto Garcia Reviewed-by: Max R

[Qemu-devel] [PULL 17/32] block/qdev: Allow node name for drive properties

2016-07-08 Thread Kevin Wolf
If a node name instead of a BlockBackend name is specified as the driver for a guest device, an anonymous BlockBackend is created now. usb-storage uses a hack where it forwards its BlockBackend as a property to another device that it internally creates. This hack must be updated so that it doesn't

[Qemu-devel] [PULL 12/32] osdep: Introduce qemu_dup

2016-07-08 Thread Kevin Wolf
From: Fam Zheng And use it in qemu_dup_flags. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- include/qemu/osdep.h | 3 +++ util/osdep.c | 23 +++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git

[Qemu-devel] [PULL 14/32] coroutine: use QSIMPLEQ instead of QTAILQ

2016-07-08 Thread Kevin Wolf
From: Paolo Bonzini CoQueue do not need to remove any element but the head of the list; processing is always strictly FIFO. Therefore, the simpler singly-linked QSIMPLEQ can be used instead. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Signed-off-by: Kevin

[Qemu-devel] [PULL 04/32] block: Use block_job_get() in find_block_job()

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia find_block_job() looks for a block backend with a specified name, checks whether it has a block job and acquires its AioContext. We want to identify jobs by their ID and not by the block backend they're attached to, so this patch ignores the backends altogether and gets the

[Qemu-devel] [PULL 15/32] test-coroutine: prepare for the next patch

2016-07-08 Thread Kevin Wolf
From: Paolo Bonzini The next patch moves the coroutine argument from first-enter to creation time. In this case, coroutine has not been initialized yet when the coroutine is created, so change to a pointer. Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- te

[Qemu-devel] [PULL 01/32] stream: Fix prototype of stream_start()

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia 'stream-start' has a parameter called 'backing-file', which is the string to be written to bs->backing when the job finishes. In the stream_start() implementation it is called 'backing_file_str', but it the prototype in the header file it is called 'base_id'. This patch fix

[Qemu-devel] [PULL 05/32] blockjob: Add 'job_id' parameter to block_job_create()

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia When a new job is created, the job ID is taken from the device name of the BDS. This patch adds a new 'job_id' parameter to let the caller provide one instead. This patch also verifies that the ID is always unique and well-formed. This causes problems in a couple of places w

[Qemu-devel] [PULL 02/32] blockjob: Update description of the 'id' field

2016-07-08 Thread Kevin Wolf
From: Alberto Garcia The 'id' field of the BlockJob structure will be able to hold any ID, not only a device name. This patch updates the description of that field and the error messages where it is being used. Soon we'll add the ability to set an arbitrary ID when creating a block job. Signed-

[Qemu-devel] [PULL 00/32] Block layer patches

2016-07-08 Thread Kevin Wolf
The following changes since commit 4f4a9ca4a4386c137301b3662faba076455ff15a: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160707' into staging (2016-07-07 14:49:38 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

Re: [Qemu-devel] [PATCH V2 1/6] oslib-posix: add helpers for stack alloc and free

2016-07-08 Thread Richard Henderson
On 07/04/2016 05:31 AM, Peter Lieven wrote: +void *qemu_alloc_stack(size_t sz) +{ +void *ptr, *guardpage; +size_t pagesz = getpagesize(); + +/* avoid stacks smaller than _SC_THREAD_STACK_MIN */ +sz = MAX(sz, sysconf(_SC_THREAD_STACK_MIN)); ... +void qemu_free_stack(void *stack,

Re: [Qemu-devel] [PATCH 0/3] fs/9p: fix setattr/getattr issues with open files

2016-07-08 Thread Greg Kurz
On Thu, 7 Jul 2016 15:34:34 +0200 Greg Kurz wrote: > On Thu, 7 Jul 2016 14:35:40 +0200 > Dominique Martinet wrote: > > > Hi Greg, > > > > Hi Dominique, > > > Greg Kurz wrote on Mon, Jul 04, 2016 at 05:08:49PM +0200: > > > On Mon, 4 Jul 2016 16:16:55 +0200 > > > Dominique Martinet wrote:

Re: [Qemu-devel] [PATCH v11 00/28] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 18:01, Radim Krčmář wrote: > 2016-07-05 16:19+0800, Peter Xu: >> This is v11 of Intel IR work. It is rebased to mst's branch >> "tags/for_upstream", commit: >> >> "278a2a2 vmw_pvscsi: remove unnecessary internal msi state flag" >> >> This series mainly fixed several issues in v10

Re: [Qemu-devel] [PATCH v4 5/5] x86: Set physical address bits based on host

2016-07-08 Thread Paolo Bonzini
On 08/07/2016 17:01, Dr. David Alan Gilbert (git) wrote: > +uint32_t host_phys_bits = x86_host_phys_bits(); > +static bool warned; > + > +if (cpu->host_phys_bits) { > +/* The user asked for us to use the host physical bits */ > +

Re: [Qemu-devel] [PATCH v3 0/6] block: Move BB options from blockdev-add to qdev

2016-07-08 Thread Kevin Wolf
Am 06.07.2016 um 16:45 hat Kevin Wolf geschrieben: > This series adds some device level options (write-cache, werror, rerror) > to qdev that used to be specified with -drive and made their way into > blockdev-add. They are at the same time removed from blockdev-add, which > is going to be changed i

Re: [Qemu-devel] [PATCH 0/2] Fix regression with the default naming of throttling groups

2016-07-08 Thread Stefan Hajnoczi
On Fri, Jul 08, 2016 at 05:02:59PM +0300, Alberto Garcia wrote: > Hi, > > Stefan reported this, this is a regression caused by commit > efaa7c4eeb7490c6f37f3. > > QEMU v2.6.0 is affected but the patch cannot be backported as-is, I'll > send a separate version to qemu-stable. > > Berto > > Alber

Re: [Qemu-devel] [V13 3/4] hw/i386: Introduce AMD IOMMU

2016-07-08 Thread Alex Williamson
On Fri, 8 Jul 2016 11:18:22 +0300 David Kiarie wrote: > Add AMD IOMMU emulaton to Qemu in addition to Intel IOMMU. > The IOMMU does basic translation, error checking and has a > minimal IOTLB implementation. This IOMMU bypassed the need > for target aborts by responding with IOMMU_NONE access ri

Re: [Qemu-devel] [PATCH for-2.6 0/2] Fix regression with the default naming of throttling groups

2016-07-08 Thread Stefan Hajnoczi
On Fri, Jul 08, 2016 at 05:05:12PM +0300, Alberto Garcia wrote: > Hi, > > Stefan reported this, this is a regression caused by commit > efaa7c4eeb7490c6f37f3. > > I sent a separate series for the git master, this is the backport for > QEMU v2.6.0. > > Berto > > Alberto Garcia (2): > blockdev:

[Qemu-devel] [PATCH 1/5] hw/misc: fix typo in Aspeed SCU hw-strap2 property name

2016-07-08 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- hw/misc/aspeed_scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c index 23f51752b0d2..b61c05ea4dbc 100644 --- a/hw/misc/aspeed_scu.c +++ b/hw/misc/aspeed_scu.c @@ -255,7 +255,7 @@ static const V

[Qemu-devel] [PATCH 2/5] ast2400: replace aspeed_smc_is_implemented()

2016-07-08 Thread Cédric Le Goater
aspeed_smc_is_implemented() filters invalid registers in a peculiar way. Let's remove it and open code the if conditions. It serves the same purpose, the aesthetic is better, and new registers can easily be added. Signed-off-by: Cédric Le Goater --- hw/ssi/aspeed_smc.c | 35 +++--

[Qemu-devel] [PATCH 4/5] ast2400: externalize revision numbers

2016-07-08 Thread Cédric Le Goater
AST2400_A0_SILICON_REV is defined twice. Fix this by including the definition in the header file as well as the routine to check if a silicon revision is supported. It will useful to reuse in other controllers. Let's add also AST2500_A0_SILICON_REV for future use. Signed-off-by: Cédric Le Goater

[Qemu-devel] [PATCH 3/5] ast2400: pretend DMAs are done for U-boot

2016-07-08 Thread Cédric Le Goater
U-boot does SPI timing calibration using DMA tranfers. To let the initialization continue, we fake success by setting the DMA status of the Interrupt Control Register. For the moment, DMA support is not required as it is not used in normal operation. Signed-off-by: Cédric Le Goater --- hw/ssi/a

[Qemu-devel] [PATCH 5/5] ast2400: add a memory controller device model

2016-07-08 Thread Cédric Le Goater
The uboot in the previous release of the SDK was using a hardcoded value for memory size. This is not true anymore, the value is now retrieved from the memory controller. Below is a model for this device, only supporting unlock and configuration. Without it, we endup running a guest with 64MB, whi

[Qemu-devel] [PATCH 0/5] ast2400: some cleanups and a simple memory controller model

2016-07-08 Thread Cédric Le Goater
Hello, Here are a couple of cleanups and a very basic memory controller model providing a configuration register. This is needed to determine the RAM size of the SOC, only used by U-Boot as of today. Ultimately, we would want to add more support for U-Boot and be able to boot from flash 0 but the

Re: [Qemu-devel] [PATCH 1/1] OpenBIOS: Switch over to official OpenBIOS git repo

2016-07-08 Thread Mark Cave-Ayland
On 08/07/16 11:41, Andreas Färber wrote: > Am 07.07.2016 um 23:22 schrieb Jeff Cody: >> This update should preserve git history, and switches over to the official >> openbios git repo, rather than pulling from the svn mirror. All prior >> history >> from the svn repository should still be preser

Re: [Qemu-devel] [PATCH v11 00/28] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-07-08 Thread Radim Krčmář
2016-07-05 16:19+0800, Peter Xu: > This is v11 of Intel IR work. It is rebased to mst's branch > "tags/for_upstream", commit: > > "278a2a2 vmw_pvscsi: remove unnecessary internal msi state flag" > > This series mainly fixed several issues in v10 review comments, fixed > one bug with RHEL guests

  1   2   3   >