Re: [Qemu-devel] [for-2.7 PATCH v3 00/15] Core based CPU hotplug for PowerPC sPAPR

2016-05-24 Thread Thomas Huth
On 12.05.2016 05:48, Bharata B Rao wrote: > Hi, > > This is v3 of "Core based CPU hotplug for PowerPC sPAPR". The hotplug > semantics looks like this: > > (qemu) device_add POWER8E-spapr-cpu-core,id=core2,core=16[,threads=4] > (qemu) device_add POWER8E_v2.1-spapr-cpu-core,id=core2,core=16[,thread

[Qemu-devel] [PATCH v6 3/5] hw/char: QOM'ify lm32_juart.c

2016-05-24 Thread xiaoqiang zhao
* Drop the old SysBus init function * Call qemu_chr_add_handlers in the realize callback * Use qdev chardev prop instead of qemu_char_get_next_serial Signed-off-by: xiaoqiang zhao --- hw/char/lm32_juart.c | 17 - hw/lm32/lm32.h| 3 ++- hw/lm32/lm32_boards.c | 5 +++--

Re: [Qemu-devel] [QEMU RFC PATCH v2 4/6] Migration: migrate QTAILQ

2016-05-24 Thread David Gibson
On Tue, May 24, 2016 at 10:55:07AM -0700, Jianjun Duan wrote: > A recursive structure has elements of the same type in itself. Currently > we cannot directly transfer a QTAILQ instance, or any recursive > structure such as lists in migration because of the limitation in the > migration code. Here w

[Qemu-devel] [PATCH v6 2/5] hw/char: QOM'ify etraxfs_ser.c

2016-05-24 Thread xiaoqiang zhao
* Drop the old SysBus init function and use instance_init * Call qemu_chr_add_handlers in the realize callback * Use qdev chardev prop instead of qemu_char_get_next_serial * Add etraxfs_ser_create function to create etraxfs serial device Signed-off-by: xiaoqiang zhao --- hw/char/etraxfs_ser.c

[Qemu-devel] [PATCH v6 0/5] QOM'ify hw/char devices

2016-05-24 Thread xiaoqiang zhao
This patch set trys to QOM'ify hw/char files, see commit messages for more details Thanks Paolo for your suggestions. Note: * CRIS axis_dev88 broad related test is passed and looks ok. * lm32 test cases by Michael is passed and looks good. * lm32 milkymist need test by Michael. Changes in v6

Re: [Qemu-devel] [PATCH qemu v16 01/19] vfio: Delay DMA address space listener release

2016-05-24 Thread David Gibson
On Fri, May 13, 2016 at 04:24:53PM -0600, Alex Williamson wrote: > On Fri, 13 May 2016 17:16:48 +1000 > Alexey Kardashevskiy wrote: > > > On 05/06/2016 08:39 AM, Alex Williamson wrote: > > > On Wed, 4 May 2016 16:52:13 +1000 > > > Alexey Kardashevskiy wrote: > > > > > >> This postpones VFIO c

[Qemu-devel] [PATCH v6 1/5] hw/char: QOM'ify escc.c

2016-05-24 Thread xiaoqiang zhao
* Drop the old SysBus init function and use instance_init * Call qemu_chr_add_handlers in the realize callback Signed-off-by: xiaoqiang zhao --- hw/char/escc.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c ind

[Qemu-devel] [PATCH v6 4/5] hw/char: QOM'ify lm32_uart.c

2016-05-24 Thread xiaoqiang zhao
* Drop the old SysBus init function and use instance_init * Call qemu_chr_add_handlers in the realize callback * Use qdev chardev prop instead of qemu_char_get_next_serial * Add lm32_uart_create function to create lm32 uart device Tested-by: Michael Walle Acked-by: Michael Walle Signed-off-by: x

[Qemu-devel] [PATCH v6 5/5] hw/char: QOM'ify milkymist-uart.c

2016-05-24 Thread xiaoqiang zhao
drop the qemu_char_get_next_serial and use chardev prop instead Signed-off-by: xiaoqiang zhao --- hw/char/milkymist-uart.c | 10 ++ hw/lm32/milkymist-hw.h | 4 +++- hw/lm32/milkymist.c | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/char/milkymist-uart

Re: [Qemu-devel] [PATCH v2 14/14] blockjob: Remove BlockJob.bs

2016-05-24 Thread Changlong Xie
On 05/24/2016 09:47 PM, Kevin Wolf wrote: There is a single remaining user in qemu-img, which can be trivially converted to using BlockJob.blk instead. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- blockjob.c | 1 - include/block/blockjob.h | 1 - qemu-img.c

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

2016-05-24 Thread Zhou Jie
Hi, Alex 3. Stall any access to the device until resume is signaled. The code below doesn't actually do this, mmaps are disabled, but that just means any device access will use the slow path through QEMU. That path is still fully enabled and so is config space access. I will modify the cod

[Qemu-devel] [PULL v2 6/8] linux-user: remove unavailable syscalls from aarch64

2016-05-24 Thread riku . voipio
From: Riku Voipio QEMU lists deprecated system call numbers in for Aarch64. These are never enabled for Linux kernel, so don't define them in Qemu either. Remove the ifdef around host_to_target_stat64 since all architectures need it now. Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --

[Qemu-devel] [Bug 1585433] Re: if docker-volume-size of baymodel lessthan 3, bay cann't create

2016-05-24 Thread thh
** Project changed: qemu => magnum -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1585433 Title: if docker-volume-size of baymodel lessthan 3, bay cann't create Status in Magnum: New Bug descri

[Qemu-devel] 答复: Re: RFC: Make 'info snapshots' show all of snapshots with multiple devices info

2016-05-24 Thread Lin Ma
>>> Kevin Wolf 2016/5/23 星期一 下午 5:00 >>> >Am 22.05.2016 um 11:55 hat Lin Ma geschrieben: >> Currently, the output of 'info snapshots' show fully available snapshots. >> >> In my opinion there are 2 disadvantages: >> 1. It's opaque, hides some snapshot information to users. It's not convenient

[Qemu-devel] [PULL 06/38] linux-user: Support for restarting system calls for x86 targets

2016-05-24 Thread riku . voipio
From: Timothy E Baldwin Update the x86 main loop and sigreturn code: * on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn * set all guest CPU state within signal.c code rather than passing it back out as the "return code" from do_sigreturn() * handle TARGET_QEMU_ESIGRETUR

[Qemu-devel] [PULL v2 4/8] linux-user: Don't assert if guest tries shmdt(0)

2016-05-24 Thread riku . voipio
From: Peter Maydell Our implementation of shmat() and shmdt() for linux-user was using "zero guest address" as its marker for "entry in the shm_regions[] array is not in use". This meant that if the guest did a shmdt(0) we would match on an unused array entry and call page_set_flags() with both s

[Qemu-devel] [Bug 1585432] Re: magnum coe-service-list returns error

2016-05-24 Thread thh
I assume you want this to be in the Magnum project, not qemu...? ** Project changed: qemu => magnum -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1585432 Title: magnum coe-service-list returns er

[Qemu-devel] ARM invalid co-processor register

2016-05-24 Thread Karthik
Hi, CPU: Cortex R5F I have this instruction that invalidates the entire data cache MCR p15, 0, r0, c15, c5, 0 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0460c/Chdhgibd.html This instruction generates undefined exception, and further debugging showed it is because the co-pr

[Qemu-devel] [PULL 04/38] linux-user: Define TARGET_ERESTART* errno values

2016-05-24 Thread riku . voipio
From: Timothy E Baldwin Define TARGET_ERESTARTSYS; like the kernel, we will use this to indicate that a guest system call should be restarted. We use the same value the kernel does for this, 512. Signed-off-by: Timothy Edward Baldwin [PMM: split out from the patch which moves and renumbers TAR

Re: [Qemu-devel] [PULL v2 3/8] linux-user: set ppc64/ppc64le default CPU to POWER8

2016-05-24 Thread Riku Voipio
Hi, Sorry ignore these "pull v2" mails, apparently I had some old files lying around.. On Wed, May 25, 2016 at 08:27:38AM +0300, riku.voi...@linaro.org wrote: > From: Laurent Vivier > > Set the default to the latest CPU version to have the > largest set of available features. > > It is also re

[Qemu-devel] [PULL v2 1/8] linux-user: fix realloc size of target_fd_trans.

2016-05-24 Thread riku . voipio
From: Laurent Vivier target_fd_trans is an array of "TargetFdTrans *": compute size accordingly. Use g_renew() as proposed by Paolo. Reported-by: Paolo Bonzini Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 delet

Re: [Qemu-devel] [QEMU RFC PATCH v2 1/6] spapr: ensure device trees are always associated with DRC

2016-05-24 Thread David Gibson
On Tue, May 24, 2016 at 10:55:04AM -0700, Jianjun Duan wrote: > There are possible racing situations involving hotplug events and > guest migration. For cases where a hotplug event is migrated, or > the guest is in the process of fetching device tree at the time of > migration, we need to ensure th

[Qemu-devel] [PULL 03/38] linux-user: Reindent signal handling

2016-05-24 Thread riku . voipio
From: Timothy E Baldwin Some of the signal handling was a mess with a mixture of tabs and 8 space indents. Signed-off-by: Timothy Edward Baldwin Message-id: 1441497448-32489-3-git-send-email-t.e.baldwi...@members.leeds.ac.uk Reviewed-by: Peter Maydell [PMM: just rebased] Signed-off-by: Peter M

[Qemu-devel] [PULL 02/38] linux-user: Consistently return host errnos from do_openat()

2016-05-24 Thread riku . voipio
From: Peter Maydell The function do_openat() is not consistent about whether it is returning a host errno or a guest errno in case of failure. Standardise on returning -1 with errno set (ie caller has to call get_errno()). Signed-off-by: Peter Maydell Reported-by: Timothy Edward Baldwin Signed

Re: [Qemu-devel] ARM Cortex R5 + VFP3

2016-05-24 Thread Karthik
Hi, Added enabling VFP co-processor in the bootrom emulation code. Works like a charm. Many thanks. Best regards, Karthik On Tue, May 24, 2016 at 7:52 PM, Karthik wrote: > Yeah, the micro had a secure boot ROM which we don't have access to. > Probably it is enabled there. I'll check in the t

[Qemu-devel] [PULL 05/38] linux-user: Renumber TARGET_QEMU_ESIGRETURN, make it not arch-specific

2016-05-24 Thread riku . voipio
From: Timothy E Baldwin Currently we define a QEMU-internal errno TARGET_QEMU_ESIGRETURN only on the MIPS and PPC targets; move this to errno_defs.h so it is available for all architectures, and renumber it to 513. We pick 513 because this is safe from future use as a system call return value: Li

[Qemu-devel] [PULL 01/38] linux-user: Check array bounds in errno conversion

2016-05-24 Thread riku . voipio
From: Timothy E Baldwin Check array bounds in host_to_target_errno() and target_to_host_errno(). Signed-off-by: Timothy Edward Baldwin Message-id: 1441497448-32489-2-git-send-email-t.e.baldwi...@members.leeds.ac.uk [PMM: Add a lower-bound check, use braces on if(), tweak commit message] Signed-

[Qemu-devel] [PULL 07/38] linux-user: Support for restarting system calls for ARM targets

2016-05-24 Thread riku . voipio
From: Timothy E Baldwin Update the 32-bit and 64-bit ARM main loop and sigreturn code: * on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn * set all guest CPU state within signal.c code on sigreturn * handle TARGET_QEMU_ESIGRETURN in the main loop as the indication that

[Qemu-devel] [PULL v2 2/8] build: [linux-user] Rename "syscall.h" to "target_syscall.h" in target directories

2016-05-24 Thread riku . voipio
From: Lluís Vilanova This fixes double-definitions in linux-user builds when using the UST tracing backend (which indirectly includes the system's "syscall.h"). Signed-off-by: Lluís Vilanova Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/aarch64/syscall.h | 1

[Qemu-devel] [PULL v2 5/8] linux-user: sync syscall numbers with kernel

2016-05-24 Thread riku . voipio
From: Riku Voipio Sync syscall numbers to match the linux v4.5-rc1 kernel. Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/aarch64/syscall_nr.h| 2 +- linux-user/alpha/syscall_nr.h | 6 ++ linux-user/cris/syscall_nr.h | 24 l

[Qemu-devel] [PULL v2 3/8] linux-user: set ppc64/ppc64le default CPU to POWER8

2016-05-24 Thread riku . voipio
From: Laurent Vivier Set the default to the latest CPU version to have the largest set of available features. It is also really needed in little-endian mode because POWER7 is not really supported in this mode and some distros (at least debian) generate POWER8 code for their ppc64le target. Fixe

[Qemu-devel] [PULL 00/38] linux-user update

2016-05-24 Thread riku . voipio
From: Riku Voipio The following changes since commit b0f6ef8915247f3230ffd9b71af9c3dadb6082c7: Merge remote-tracking branch 'remotes/amit-virtio-rng/tags/rng-2.7-1' into staging (2016-05-24 11:38:22 +0100) are available in the git repository at: git://git.linaro.org/people/riku.voipio/qem

[Qemu-devel] [PATCH] nbd: Don't trim unrequested bytes

2016-05-24 Thread Eric Blake
Similar to commit df7b97ff, we are mishandling clients that give an unaligned NBD_CMD_TRIM request, and potentially trimming bytes that occur before their request; which in turn can cause potential unintended data loss (unlikely in practice, since most clients are sane and issue aligned trim reques

Re: [Qemu-devel] [PATCH v2 08/14] mirror: Use BlockBackend for I/O

2016-05-24 Thread Changlong Xie
On 05/25/2016 12:01 PM, Eric Blake wrote: On 05/24/2016 09:51 PM, Changlong Xie wrote: On 05/24/2016 09:47 PM, Kevin Wolf wrote: +s->target = blk_new(); blk_new(errp); Depends on Kevin's block/next branch, which currently includes: commit 5d7dd50566a4f9786b95f49448f48fead0bb34d8 Author:

Re: [Qemu-devel] [PATCH v2 13/14] commit: Use BlockBackend for I/O

2016-05-24 Thread Eric Blake
On 05/24/2016 09:51 PM, Changlong Xie wrote: > On 05/24/2016 09:47 PM, Kevin Wolf wrote: >> +s->base = blk_new(); > blk_new(errp); >> +blk_insert_bs(s->base, base); >> + >> +s->top = blk_new(); > blk_new(errp); Wrong. Even if it weren't for basing it on top of Kevin's branch which remo

Re: [Qemu-devel] [PATCH v2 08/14] mirror: Use BlockBackend for I/O

2016-05-24 Thread Eric Blake
On 05/24/2016 09:51 PM, Changlong Xie wrote: > On 05/24/2016 09:47 PM, Kevin Wolf wrote: >> +s->target = blk_new(); > blk_new(errp); Depends on Kevin's block/next branch, which currently includes: commit 5d7dd50566a4f9786b95f49448f48fead0bb34d8 Author: Max Reitz Date: Tue May 17 16:41:34 2

Re: [Qemu-devel] [PATCH v2 12/14] backup: Use BlockBackend for I/O

2016-05-24 Thread Changlong Xie
On 05/24/2016 09:47 PM, Kevin Wolf wrote: +job->target = blk_new(); blk_new(errp);

Re: [Qemu-devel] [PATCH v2 08/14] mirror: Use BlockBackend for I/O

2016-05-24 Thread Changlong Xie
On 05/24/2016 09:47 PM, Kevin Wolf wrote: +s->target = blk_new(); blk_new(errp);

Re: [Qemu-devel] [PATCH v2 13/14] commit: Use BlockBackend for I/O

2016-05-24 Thread Changlong Xie
On 05/24/2016 09:47 PM, Kevin Wolf wrote: +s->base = blk_new(); blk_new(errp); +blk_insert_bs(s->base, base); + +s->top = blk_new(); blk_new(errp);

Re: [Qemu-devel] [PATCH v2 04/14] block: Convert block job core to BlockBackend

2016-05-24 Thread Changlong Xie
On 05/24/2016 09:47 PM, Kevin Wolf wrote: +blk = blk_new(); blk_new(errp);

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

2016-05-24 Thread Alex Williamson
On Tue, 24 May 2016 13:49:12 +0300 "Michael S. Tsirkin" wrote: > On Tue, Apr 26, 2016 at 08:48:15AM -0600, Alex Williamson wrote: > > I think that means that if we want to switch from a > > simple halt-on-error to a mechanism for the guest to handle recovery, > > we need to disable access to the

[Qemu-devel] [Bug 1585433] [NEW] if docker-volume-size of baymodel lessthan 3, bay cann't create

2016-05-24 Thread Michael liu
Public bug reported: magnum is running on centos7, magnum baymodel-create --name k8sbaymodel5 --image-id fedora-23-atomic-20160405 --keypair-id testkey --external-network-id public --dns-nameserver 8.8.8.8 --flavor-id m1.small --coe kubernetes --docker-volume-size 5 magnum bay-create --name k

[Qemu-devel] [Bug 1585432] [NEW] magnum coe-service-list returns error

2016-05-24 Thread Michael liu
Public bug reported: magnum running on centos7, I didn't create any services on k8s cluster, but I got the result as follows: [root@localhost ~(keystone_admin)]# magnum coe-service-list --bay k8sbay3 ERROR: Field `ports[0][node_port]' cannot be None (HTTP 500) (Request-ID: req-c66b68dd-5437-47

Re: [Qemu-devel] [PATCH v2 13/14] commit: Use BlockBackend for I/O

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This changes the commit block job to use the job's BlockBackend for > performing its I/O. job->bs isn't used by the commit code any more > afterwards. > > Signed-off-by: Kevin Wolf > --- > block/commit.c | 53 +--

Re: [Qemu-devel] [PATCH v2 12/14] backup: Use BlockBackend for I/O

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This changes the backup block job to use the job's BlockBackend for > performing its I/O. job->bs isn't used by the backup code any more > afterwards. > > Signed-off-by: Kevin Wolf > --- > block/backup.c| 46 +---

Re: [Qemu-devel] [PATCH v2 08/14] mirror: Use BlockBackend for I/O

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This changes the mirror block job to use the job's BlockBackend for > performing its I/O. job->bs isn't used by the mirroring code any more > afterwards. > > Signed-off-by: Kevin Wolf > --- > block/mirror.c | 74 > -

Re: [Qemu-devel] [PATCH 2/2] memory: Drop FlatRange.romd_mode

2016-05-24 Thread Fam Zheng
On Tue, 05/24 19:47, Laszlo Ersek wrote: > Which I think satisfies (a->mr == b->mr), but falsifies (a->romd_mode == > b->romd_mode). > > In effect, the patch seems to allow merging and equality between FlatRange > objects when they only differ in romd_mode, and that's wrong. > > Given that the co

[Qemu-devel] [PATCH v6 13/15] qht: add test-qht-par to invoke qht-bench from 'check' target

2016-05-24 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- tests/.gitignore | 1 + tests/Makefile | 5 - tests/test-qht-par.c | 56 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 tests/test-qht-par.c diff --git a/tests/.gitignore

[Qemu-devel] [PATCH v6 00/15] tb hash improvements

2016-05-24 Thread Emilio G. Cota
v5: https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg02366.html v6 applies cleanly on top of tcg-next (8b1fe3f4 "cpu-exec: Clean up 'interrupt_request' reloading", tagged "pull-tcg-20160512"). Changes from v5, mostly from Sergey's review: - processor.h: use #ifdef #elif throughout the fi

[Qemu-devel] [PATCH v6 12/15] qht: add qht-bench, a performance benchmark

2016-05-24 Thread Emilio G. Cota
This serves as a performance benchmark as well as a stress test for QHT. We can tweak quite a number of things, including the number of resize threads and how frequently resizes are triggered. A performance comparison of QHT vs CLHT[1] and ck_hs[2] using this same benchmark program can be found he

[Qemu-devel] [PATCH v6 01/15] compiler.h: add QEMU_ALIGNED() to enforce struct alignment

2016-05-24 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/qemu/compiler.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 8f1cc7b..b64f899 100644 --- a/include/qemu/compiler.h +++ b/include/qem

[Qemu-devel] [PATCH v6 14/15] tb hash: track translated blocks with qht

2016-05-24 Thread Emilio G. Cota
Having a fixed-size hash table for keeping track of all translation blocks is suboptimal: some workloads are just too big or too small to get maximum performance from the hash table. The MRU promotion policy helps improve performance when the hash table is a little undersized, but it cannot make up

[Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table

2016-05-24 Thread Emilio G. Cota
This is a fast, scalable chained hash table with optional auto-resizing, allowing reads that are concurrent with reads, and reads/writes that are concurrent with writes to separate buckets. A hash table with these features will be necessary for the scalability of the ongoing MTTCG work; before th

[Qemu-devel] [PATCH v6 11/15] qht: add test program

2016-05-24 Thread Emilio G. Cota
Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- tests/.gitignore | 1 + tests/Makefile | 6 ++- tests/test-qht.c | 159 +++ 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 t

[Qemu-devel] [PATCH v6 09/15] qdist: add test program

2016-05-24 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- tests/.gitignore | 1 + tests/Makefile | 6 +- tests/test-qdist.c | 369 + 3 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 tests/test-qdist.c diff

[Qemu-devel] [PATCH v6 08/15] qdist: add module to represent frequency distributions of data

2016-05-24 Thread Emilio G. Cota
Sometimes it is useful to have a quick histogram to represent a certain distribution -- for example, when investigating a performance regression in a hash table due to inadequate hashing. The appended allows us to easily represent a distribution using Unicode characters. Further, the data structur

[Qemu-devel] [PATCH v6 07/15] tb hash: hash phys_pc, pc, and flags with xxhash

2016-05-24 Thread Emilio G. Cota
For some workloads such as arm bootup, tb_phys_hash is performance-critical. The is due to the high frequency of accesses to the hash table, originated by (frequent) TLB flushes that wipe out the cpu-private tb_jmp_cache's. More info: https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg05

[Qemu-devel] [PATCH v6 02/15] seqlock: remove optional mutex

2016-05-24 Thread Emilio G. Cota
This option is unused; besides, it bloats the struct when not needed. Let's just let writers define their own locks elsewhere. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- cpus.c | 2 +- include/qemu/seqlock.h | 10 +- 2 fil

[Qemu-devel] [PATCH v6 05/15] qemu-thread: add simple test-and-set spinlock

2016-05-24 Thread Emilio G. Cota
From: Guillaume Delbergue Signed-off-by: Guillaume Delbergue [Rewritten. - Paolo] Signed-off-by: Paolo Bonzini [Emilio's additions: use TAS instead of atomic_xchg; emit acquire/release barriers; return bool from trylock; call cpu_relax() while spinning; optimize for uncontended locks by acqui

[Qemu-devel] [PATCH v6 15/15] translate-all: add tb hash bucket info to 'info jit' dump

2016-05-24 Thread Emilio G. Cota
Examples: - Good hashing, i.e. tb_hash_func5(phys_pc, pc, flags): TB count715135/2684354 [...] TB hash buckets 388775/524288 (74.15% head buckets used) TB hash occupancy 33.04% avg chain occ. Histogram: [0,10)%|▆ █ ▅▁▃▁▁|[90,100]% TB hash avg chain 1.017 buckets. Histogram: 1

[Qemu-devel] [PATCH v6 03/15] seqlock: rename write_lock/unlock to write_begin/end

2016-05-24 Thread Emilio G. Cota
It is a more appropriate name, now that the mutex embedded in the seqlock is gone. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- cpus.c | 28 ++-- include/qemu/seqlock.h | 4 ++-- 2 files changed, 16 insertion

[Qemu-devel] [PATCH v6 04/15] include/processor.h: define cpu_relax()

2016-05-24 Thread Emilio G. Cota
Taken from the linux kernel. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/qemu/processor.h | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 include/qemu/processor.h diff --git a/include/qemu/processo

[Qemu-devel] [PATCH v6 06/15] exec: add tb_hash_func5, derived from xxhash

2016-05-24 Thread Emilio G. Cota
This will be used by upcoming changes for hashing the tb hash. Add this into a separate file to include the copyright notice from xxhash. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/exec/tb-hash-xx.h | 94 +++ 1 file chan

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

2016-05-24 Thread Zhou Jie
So I needn't disable access to the device between being notified that the error occurred and being notified to resume. This will make code simpler. Am I right? On 2016/5/24 18:49, Michael S. Tsirkin wrote: On Tue, Apr 26, 2016 at 08:48:15AM -0600, Alex Williamson wrote: I think that means tha

Re: [Qemu-devel] [PATCH RFC kernel] balloon: speed up inflating/deflating process

2016-05-24 Thread Li, Liang Z
> > > > > > > This is grossly inefficient if you only requested a single page. > > > > > > > And it's also allocating memory very aggressively without > > > > > > > ever telling the host what is going on. > > > > > > > > > > > > If only requested a single page, there is no need to send the > > > >

Re: [Qemu-devel] [PATCH RFC kernel] balloon: speed up inflating/deflating process

2016-05-24 Thread Li, Liang Z
> On Tue, May 24, 2016 at 02:36:08PM +, Li, Liang Z wrote: > > > > > > > This can be pre-initialized, correct? > > > > > > > > > > > > pre-initialized? I am not quite understand your mean. > > > > > > > > > > I think you can maintain sg as part of device state and init sg > > > > > with the > >

Re: [Qemu-devel] [PATCH v2 06/14] stream: Use BlockBackend for I/O

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This changes the streaming block job to use the job's BlockBackend for > performing the COR reads. job->bs isn't used by the streaming code any > more afterwards. > > Signed-off-by: Kevin Wolf > --- > block/io.c| 9 - > block/strea

Re: [Qemu-devel] [PATCH v2 05/14] block: Make blk_co_preadv/pwritev() public

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > Also add trace points now that the function can be directly called. > > Signed-off-by: Kevin Wolf > --- > block/block-backend.c | 21 ++--- > include/sysemu/block-backend.h | 6 ++ > trace-events | 4 +++

Re: [Qemu-devel] [PATCH v2 04/14] block: Convert block job core to BlockBackend

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > This adds a new BlockBackend field to the BlockJob struct, which > coexists with the BlockDriverState while converting the individual jobs. > > When creating a block job, a new BlockBackend is created on top of the > given BlockDriverState, and it is des

Re: [Qemu-devel] [PATCH v5 13/18] qht: support parallel writes

2016-05-24 Thread Emilio G. Cota
On Wed, May 25, 2016 at 01:17:21 +0300, Sergey Fedorov wrote: > >> With this implementation we could: > >> (1) get rid of qht_map::stale > >> (2) don't waste cycles waiting for resize to complete > > I'll include this in v6. > > How is it by perf? Not much of a difference, since resize is a slo

Re: [Qemu-devel] [PATCH] docs: Fix a couple of typos in throttle.txt

2016-05-24 Thread Eric Blake
On 05/24/2016 05:59 AM, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > docs/throttle.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake > > diff --git a/docs/throttle.txt b/docs/throttle.txt > index 06ed9b3..b4431f6 100644 > --- a/docs/throt

Re: [Qemu-devel] [PATCH V3] block/iscsi: allow caching of the allocation map

2016-05-24 Thread Eric Blake
On 05/24/2016 02:40 AM, Peter Lieven wrote: > until now the allocation map was used only as a hint if a cluster > is allocated or not. If a block was not allocated (or Qemu had > no info about the allocation status) a get_block_status call was > issued to check the allocation status and possibly av

Re: [Qemu-devel] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block

2016-05-24 Thread Mark Cave-Ayland
On 23/05/16 20:36, Mark Cave-Ayland wrote: > On 23/05/16 13:54, Paolo Bonzini wrote: > >> scsi-block uses the block layer for reads and writes in order to avoid >> allocating bounce buffers as big as the transferred data. We know how >> to split a large transfer to multiple reads and writes, and

Re: [Qemu-devel] [PATCH v2 02/14] block: Cancel jobs first in bdrv_close_all()

2016-05-24 Thread Eric Blake
On 05/24/2016 07:47 AM, Kevin Wolf wrote: > So far, bdrv_close_all() first removed all root BlockDriverStates of > BlockBackends and monitor owned BDSes, and then assumed that the > remaining BDSes must be related to jobs and cancelled these jobs. > > This order doesn't work that well any more whe

[Qemu-devel] [PATCH 01/13] block: Rename blk_write_zeroes()

2016-05-24 Thread Eric Blake
Commit 983a1600 changed the semantics of blk_write_zeroes() to be byte-based rather than sector-based, but did not change the name, which is an open invitation for other code to misuse the function. Renaming to pwrite_zeroes() makes it more in line with other byte-based interfaces, and will help m

[Qemu-devel] [PATCH 11/13] raw_bsd: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake --- block/raw_bsd.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block/raw_bsd.c b/block/raw_bsd.c index d9adf90..b1d5237 100644 --- a/block/raw_bsd.c +++ b/block

[Qemu-devel] [PATCH 06/13] qcow2: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. There are still opportunities to optimize the qcow2 handling of zero clusters. For example, if the backing file only has non-zero data in the portion about to be overwritten, then we could widen the request and make the enti

[Qemu-devel] [PATCH 02/13] block: Track write zero limits in bytes

2016-05-24 Thread Eric Blake
Another step towards removing sector-based interfaces: convert the maximum write and minimum alignment values from sectorss to bytes. Alignment is changed to 'int', since it makes no sense to have an alignment larger than the maximum write. Add an assert that no one was trying to use sectors to g

[Qemu-devel] [PATCH 08/13] gluster: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake --- block/gluster.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index a8aaacf..15aff4b 100644 --- a/block/gluster.c +++ b/b

[Qemu-devel] [PATCH 12/13] vmdk: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake --- block/vmdk.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 8494d63..284d7a0 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@

[Qemu-devel] [PATCH 04/13] block: Switch bdrv_write_zeroes() to byte interface

2016-05-24 Thread Eric Blake
Rename to bdrv_pwrite_zeroes() to let the compiler ensure we cater to the updated semantics. Do the same for bdrv_aio_write_zeroes() and bdrv_co_write_zeroes(). For now, we still require sector alignment in the callers, via assertions. Signed-off-by: Eric Blake --- include/block/block.h | 16

[Qemu-devel] [PATCH 10/13] raw-posix: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake --- block/raw-posix.c | 37 +++-- trace-events | 2 +- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c i

[Qemu-devel] [PATCH 09/13] qed: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. Kill an abuse of the comma operator while at it (fortunately, the semantics were still right). Signed-off-by: Eric Blake --- block/qed.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) di

[Qemu-devel] [PATCH 07/13] blkreplay: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake --- block/blkreplay.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/blkreplay.c b/block/blkreplay.c index 1a721ad..525c2d5 100755 --- a/block/blkreplay.c +++

[Qemu-devel] [PATCH 03/13] block: Add .bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Update bdrv_co_do_write_zeroes() to be byte-based, and select between the new byte-based bdrv_co_pwrite_zeroes() or the old bdrv_co_write_zeroes(). The next patches will convert drivers, then remove the old interface. Signed-off-by: Eric Blake --- include/block/block_int.h | 4 ++- block/io.c

[Qemu-devel] [PATCH 13/13] block: Kill bdrv_co_write_zeroes()

2016-05-24 Thread Eric Blake
Now that all drivers have been converted to a byte interface, we no longer need a sector interface. Signed-off-by: Eric Blake --- include/block/block_int.h | 2 -- block/io.c| 15 ++- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/block/block

[Qemu-devel] [PATCH 05/13] iscsi: Convert to bdrv_co_pwrite_zeroes()

2016-05-24 Thread Eric Blake
Another step on our continuing quest to switch to byte-based interfaces. As this is the first byte-based iscsi interface, convert is_request_lun_aligned() into two versions, one for sectors and one for bytes. Signed-off-by: Eric Blake --- block/iscsi.c | 53 +++--

[Qemu-devel] [PATCH 00/13] Kill sector-based write_zeroes

2016-05-24 Thread Eric Blake
Kevin pointed out that my recent change to byte-based instead of sector-based blk_write_zeroes() (commit 983a1600) makes life harder as long as bdrv_write_zeroes is still sector-based, and where the compiler doesn't flag any change in parameter types. Complete the conversion, by renaming things (so

Re: [Qemu-devel] [PATCH v5 13/18] qht: support parallel writes

2016-05-24 Thread Sergey Fedorov
On 25/05/16 01:07, Emilio G. Cota wrote: > On Mon, May 23, 2016 at 23:28:27 +0300, Sergey Fedorov wrote: >> What if we turn qht::lock into a mutex and change the function as follows: >> >> static inline >> struct qht_bucket *qht_bucket_lock__no_stale(struct qht *ht, >> uint32_t hash, >>

Re: [Qemu-devel] [PATCH v5 13/18] qht: support parallel writes

2016-05-24 Thread Emilio G. Cota
On Mon, May 23, 2016 at 23:28:27 +0300, Sergey Fedorov wrote: > What if we turn qht::lock into a mutex and change the function as follows: > > static inline > struct qht_bucket *qht_bucket_lock__no_stale(struct qht *ht, > uint32_t hash, >

Re: [Qemu-devel] [PATCH v6 1/3] loader: Allow ELF loader to auto-detect the ELF arch

2016-05-24 Thread Cleber Rosa
On 05/13/2016 05:37 PM, Alistair Francis wrote: +if (elf_machine < 1) { +/* The caller didn't specify and ARCH, we can figure it out */ Spotted a comment typo: s/and/an/ +lseek(fd, 0x12, SEEK_SET); +if (read(fd, &e_machine, sizeof(e_machine)) != sizeof(e_machine)

Re: [Qemu-devel] [RFC v2 10/11] tcg: drop global lock during TCG code execution

2016-05-24 Thread Sergey Fedorov
On 05/04/16 18:32, Alex Bennée wrote: > diff --git a/cpu-exec.c b/cpu-exec.c > index bd50fef..f558508 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c > @@ -28,6 +28,7 @@ > #include "qemu/rcu.h" > #include "exec/tb-hash.h" > #include "exec/log.h" > +#include "qemu/main-loop.h" > #if defined(TARGET_

Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-24 Thread Emilio G. Cota
On Tue, May 24, 2016 at 23:09:47 +0300, Sergey Fedorov wrote: > On 24/05/16 23:06, Emilio G. Cota wrote: > > For correctness, smp_read_barrier_depends() is only required to > > emit a barrier on Sparc hosts. However, we are currently emitting > > a consume fence unconditionally. > > > > Fix it by k

[Qemu-devel] [PATCH v2 3/3] atomics: do not emit consume barrier for atomic_rcu_read

2016-05-24 Thread Emilio G. Cota
Currently we emit a consume-load in atomic_rcu_read. This is overkill for non-Sparc hosts, and is only useful to make things easier for Thread Sanitizer, which as far as I understand works best without explicit fences. The appended leaves the consume-load in atomic_rcu_read when compiling with Thr

Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-24 Thread Sergey Fedorov
On 24/05/16 23:06, Emilio G. Cota wrote: > For correctness, smp_read_barrier_depends() is only required to > emit a barrier on Sparc hosts. However, we are currently emitting > a consume fence unconditionally. > > Fix it by keeping the consume fence if we're compiling with Thread > Sanitizer, since

[Qemu-devel] [PATCH v2 1/3] docs/atomics: update atomic_read/set comparison with Linux

2016-05-24 Thread Emilio G. Cota
Recently Linux did a mass conversion of its atomic_read/set calls so that they at least are READ/WRITE_ONCE. See Linux's commit 62e8a325 ("atomic, arch: Audit atomic_{read,set}()"). It seems though that their documentation hasn't been updated to reflect this. The appended updates our documentation

[Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer

2016-05-24 Thread Emilio G. Cota
For correctness, smp_read_barrier_depends() is only required to emit a barrier on Sparc hosts. However, we are currently emitting a consume fence unconditionally. Fix it by keeping the consume fence if we're compiling with Thread Sanitizer, since this might help prevent false warnings. Otherwise,

[Qemu-devel] [PATCH v2 0/3] atomics: fix RCU perf. regression + update documentation

2016-05-24 Thread Emilio G. Cota
v1: https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg03661.html Patch 1 hasn't changed from v1 (where it was patch 2 though). Patches 2 and 3 fix a not-so-small-after-all RCU performance regression we introduced when transitioning to __atomic primitives. I got an arm64 machine to test tod

Re: [Qemu-devel] [PATCH 1/2] atomics: do not use __atomic primitives for RCU atomics

2016-05-24 Thread Sergey Fedorov
On 24/05/16 22:56, Emilio G. Cota wrote: > On Tue, May 24, 2016 at 09:08:01 +0200, Paolo Bonzini wrote: >> On 23/05/2016 19:09, Emilio G. Cota wrote: >>> PS. And really equating smp_wmb/rmb to release/acquire as we have under >>> #ifdef __ATOMIC is hard to justify, other than to please tsan. >> Tha

[Qemu-devel] [RFC PATCH v4 3/3] VFIO Type1 IOMMU: Add support for mediated devices

2016-05-24 Thread Kirti Wankhede
VFIO Type1 IOMMU driver is designed for the devices which are IOMMU capable. Mediated device only uses IOMMU TYPE1 API, the underlying hardware can be managed by an IOMMU domain. This change exports functions to pin and unpin pages for mediated devices. It maintains data of pinned pages for mediat

  1   2   3   4   >