Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib

2015-05-14 Thread Chen Gang
On 5/12/15 00:55, Richard Henderson wrote: > On 05/10/2015 03:45 PM, Chen Gang wrote: >> > +static void gen_cmpltsi(struct DisasContext *dc, >> > +uint8_t rdst, uint8_t rsrc, int8_t imm8) >> > +{ >> > +qemu_log_mask(CPU_LOG_TB_IN_ASM, "cmpltsi r%d, r%d, %d\n", >> > +

Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib

2015-05-14 Thread Chen Gang
On 5/12/15 00:55, Richard Henderson wrote: > On 05/10/2015 03:45 PM, Chen Gang wrote: >> > +static void gen_cmpltsi(struct DisasContext *dc, >> > +uint8_t rdst, uint8_t rsrc, int8_t imm8) >> > +{ >> > +qemu_log_mask(CPU_LOG_TB_IN_ASM, "cmpltsi r%d, r%d, %d\n", >> > +

Re: [Qemu-devel] [PATCH 01/15] net: Improve error message for -net hubport a bit

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > Type "hubport" is valid only with -netdev. Unfortunately, that's > detected late and the error message doesn't explain why: > > $ qemu-system-i386 -net hubport,id=foo,hubid=0 > qemu-system-i386: -net hubport,id=foo,hubid=0: Device 'hubpor

Re: [Qemu-devel] [PATCH 0/9] qapi: Mostly generator cleanups

2015-05-14 Thread Eric Blake
On 05/11/2015 01:24 AM, Markus Armbruster wrote: > You've seen these patches before, in "[PATCH RFC 00/19] qapi: QMP > introspection". Eric has pulled a few into "[PATCH v2 0/3] parse > 'null' literal in QMP" and "[PATCH v3 00/14] Fix qapi mangling of > downstream names". This series has the rema

Re: [Qemu-devel] [PATCH 5/9] qapi: Fix generators to report command line errors decently

2015-05-14 Thread Eric Blake
On 05/11/2015 01:24 AM, Markus Armbruster wrote: > Report to stderr, prefix with the program name. Also reject > extra arguments. > > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > scripts/qapi.py | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > @@ -999,4

Re: [Qemu-devel] [PATCH] Add a property to disable the floppy controller

2015-05-14 Thread Marcel Apfelbaum
On 05/14/2015 05:41 PM, Stefano Stabellini wrote: Do not change default settings for any machines at the moment: this patch does not introduce any changes in behavior unless the user asks for no-fdc=on. Hi, Agreeing with Paolo on this, maybe we can have an 'fdc' property (enabled by default) a

Re: [Qemu-devel] [PATCH 6/9] qapi: Turn generators' mandatory option -i into an argument

2015-05-14 Thread Eric Blake
On 05/11/2015 01:24 AM, Markus Armbruster wrote: > Mandatory option is silly, and the error handling is missing: the > programs crash when -i isn't supplied. Make it an argument, and check > it properly. > > Signed-off-by: Markus Armbruster > --- > Makefile | 14 +++--- >

Re: [Qemu-devel] [PATCH v2] Add virt-v3 machine that uses GIC-500

2015-05-14 Thread Pavel Fedin
Hello! > I wonder how it works for you. Do you aware of an alternative way to > configure the clock > irqflags for more then 24 cores, or is it just ignored. Unfortunately i don't know how it works. > My current status is as follows: > With 64 cores there is no printouts what so ever. > With

Re: [Qemu-devel] [PATCH v3 2/2] target-mips: Misaligned memory accesses for MSA

2015-05-14 Thread Richard Henderson
On 05/14/2015 02:50 AM, Leon Alrae wrote: > Just to confirm -– before using helper_ret_*_mmu directly we should also > check if we can take fast-path (not sure if “fast-path” is correct term > in this case as we've already generated a call to helper function...): > > if (unlikely(env->tlb_tabl

Re: [Qemu-devel] [PATCH v4 08/16] qapi: Tidy c_type logic

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > c_type() is designed to be called on both string names and on > array designations, so 'name' is a bit misleading because it > operates on more than strings. Also, no caller ever passes > an empty string. Finally, + notation is a bit nicer to read > than '%s' % value for st

Re: [Qemu-devel] [PATCH COLO v4 01/15] docs: block replication's description

2015-05-14 Thread Dr. David Alan Gilbert
* Wen Congyang (ghost...@gmail.com) wrote: > At 2015/5/14 19:19, Dr. David Alan Gilbert Wrote: > >One thing I wanted to check I understand; how much RAM do the active and > >hidden > >disks use; lets say during the 1st checkpoint 10MB of disk is written, > >and during hte 2nd checkpoint a diff

Re: [Qemu-devel] [PATCH v4 08/16] qapi: Tidy c_type logic

2015-05-14 Thread Eric Blake
On 05/14/2015 06:50 AM, Eric Blake wrote: > c_type() is designed to be called on both string names and on > array designations, so 'name' is a bit misleading because it > operates on more than strings. Also, no caller ever passes > an empty string. Finally, + notation is a bit nicer to read > tha

Re: [Qemu-devel] [PATCH v4 09/16] qapi: Make c_type() consistently convert qapi names

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > Continuing the string of cleanups for supporting downstream names > containing '.', this patch focuses on ensuring c_type() can > handle a downstream name. This patch alone does not fix the > places where generator output should be calling this function > but was open-coding

Re: [Qemu-devel] [PATCH 02/15] net: Permit incremental conversion of init functions to Error

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > Error reporting for netdev_add is broken: the net_client_init_fun[] > report the actual errors with (at best) error_report(), and their > caller net_client_init1() makes up a generic error on top. > > For command line and HMP, this produces an mil

Re: [Qemu-devel] [PATCH v4 10/16] qapi: Support downstream enums

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > Enhance the testsuite to cover a downstream enum type and enum > string. Update the generator to mangle the enum name in the > appropriate places. > > Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster

Re: [Qemu-devel] [PATCH 09/10 v10] target-tilegx: Generate tcg instructions to execute to _init_malloc in glib

2015-05-14 Thread Chen Gang
On 5/12/15 00:55, Richard Henderson wrote: > On 05/10/2015 03:45 PM, Chen Gang wrote: >> > +static void gen_cmpltsi(struct DisasContext *dc, >> > +uint8_t rdst, uint8_t rsrc, int8_t imm8) >> > +{ >> > +qemu_log_mask(CPU_LOG_TB_IN_ASM, "cmpltsi r%d, r%d, %d\n", >> > +

[Qemu-devel] [PATCH v2] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-14 Thread Alexander Yarygin
After the commit 9b536adc ("block: acquire AioContext in bdrv_drain_all()") the aio_poll() function got called for every BlockDriverState, in assumption that every device may have its own AioContext. The bdrv_drain_all() function is called in each virtio_reset() call, which in turn is called for ev

Re: [Qemu-devel] [PATCH 03/15] net: Improve -net nic error reporting

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > When -net nic fails, it first reports a specific error, then a generic > one, like this: > > $ qemu-system-x86_64 -net nic,netdev=nonexistant > qemu-system-x86_64: -net nic,netdev=nonexistant: netdev 'nonexistant' not > found > qemu-s

[Qemu-devel] [PATCH v2 3/3] tcg: Add MO_ALIGN, MO_UNALN

2015-05-14 Thread Richard Henderson
These modifiers control, on a per-memory-op basis, whether unaligned memory accesses are allowed. The default setting reflects the target's definition of ALIGNED_ONLY. Signed-off-by: Richard Henderson --- softmmu_template.h | 72 -- tcg/tcg.h

[Qemu-devel] [PATCH v2 2/3] tcg: Push merged memop+mmu_idx parameter to softmmu routines

2015-05-14 Thread Richard Henderson
The extra information is not yet used but it is now available. This requires minor changes through all of the tcg backends. Signed-off-by: Richard Henderson --- softmmu_template.h | 42 -- target-arm/helper.c | 10 ++ tcg/aarch64/tcg-tar

[Qemu-devel] [PATCH v2 1/3] tcg: Merge memop and mmu_idx parameters to qemu_ld/st

2015-05-14 Thread Richard Henderson
At the tcg opcode level, not at the tcg-op.h generator level. This requires minor changes through all of the tcg backends, but none of the cpu translators. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c | 12 tcg/arm/tcg-target.c | 12 tcg/i386/tcg-ta

[Qemu-devel] [PATCH v2 0/3] Per-memory-op alignment checks

2015-05-14 Thread Richard Henderson
Changes v1-v2: * Stuff Peter noticed: - Don't break tci in patch one, - Fix type of mmu_idx in softmmu_template.h - Improve commentary tr MO_ALIGN/MO_UNALN. * Update args to helper_ret_stb_mmu in target-arm/helper.c. r~ Richard Henderson (3): tcg: Merge memop and mmu_idx parameters to

Re: [Qemu-devel] [RFC PATCH v4 00/28] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service

2015-05-14 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > On 2015/5/14 20:14, Dr. David Alan Gilbert wrote: > >* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > >>This is the 4th version of COLO, here is only COLO frame part, include: VM > >>checkpoint, > >>failover, proxy API, block repli

Re: [Qemu-devel] [PATCH v4 16/16] qapi: Prefer '"str" + var' over '"str%s" % var'

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > Use of python's % operator to format strings is fine if there are > multiple strings or if there is integer formatting going on, but > when it is just abused for string concatenation, it looks nicer > to just use the + operator. This is particularly true when the > value bei

Re: [Qemu-devel] [PATCH v4 08/16] qapi: Tidy c_type logic

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > On 05/14/2015 06:50 AM, Eric Blake wrote: >> c_type() is designed to be called on both string names and on >> array designations, so 'name' is a bit misleading because it >> operates on more than strings. Also, no caller ever passes >> an empty string. Finally, + notation i

Re: [Qemu-devel] [PATCH v4 16/16] qapi: Prefer '"str" + var' over '"str%s" % var'

2015-05-14 Thread Eric Blake
On 05/14/2015 10:09 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Use of python's % operator to format strings is fine if there are >> multiple strings or if there is integer formatting going on, but >> when it is just abused for string concatenation, it looks nicer >> to just use the +

[Qemu-devel] [PATCH 0/9] Optional toplevel sections

2015-05-14 Thread Juan Quintela
Hi [v2] - Rebased to current tree - Added global configuration section, not sent/received for previous machine types. Please, review. Thanks, Juan. [v1] by popular demand, and after too many time, this series. This is an RFC to know what people think about how to use them, the interface pro

[Qemu-devel] [PATCH 5/9] runstate: migration allows more transitions now

2015-05-14 Thread Juan Quintela
Next commit would allow to move from incoming migration to error happening on source. Should we add more states to this transition? Luiz? Signed-off-by: Juan Quintela --- vl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vl.c b/vl.c index ea4319d..b8844f6 100644 --- a/vl.c +++ b/vl.c

[Qemu-devel] [PATCH 3/9] runstate: Add runstate store

2015-05-14 Thread Juan Quintela
This allows us to store the current state to send it through migration. Signed-off-by: Juan Quintela --- include/sysemu/sysemu.h | 1 + vl.c| 11 +++ 2 files changed, 12 insertions(+) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 8a52934..c1a4

[Qemu-devel] [PATCH 9/9] migration: Add configuration section

2015-05-14 Thread Juan Quintela
It needs to be the first one and it is not optional, that is the reason why it is opencoded. For new machine types, it is required than machine type name is the same in both sides. It is just done right now for pc's. Signed-off-by: Juan Quintela --- hw/i386/pc_piix.c | 1 + hw/i38

[Qemu-devel] [PATCH 4/9] runstate: create runstate_index function

2015-05-14 Thread Juan Quintela
Given a string state, we need a way to get the RunState for that string. Signed-off-by: Juan Quintela --- include/sysemu/sysemu.h | 1 + vl.c| 13 + 2 files changed, 14 insertions(+) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index c1a403e..e

[Qemu-devel] [PATCH 2/9] migration: Use normal VMStateDescriptions for Subsections

2015-05-14 Thread Juan Quintela
We create optional sections with this patch. But we already have optional subsections. Instead of having two mechanism that do the same, we can just generalize it. For subsections we just change: - Add a needed function to VMStateDescription - Remove VMStateSubsection (after removal of the need

[Qemu-devel] [PATCH 1/9] migration: create savevm_state

2015-05-14 Thread Juan Quintela
This way, we will put savevm global state here, instead of lots of variables. Signed-off-by: Juan Quintela --- savevm.c | 53 + 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/savevm.c b/savevm.c index 3b0e222..1014e3e 100644 --

[Qemu-devel] [PATCH 7/9] global_state: Make section optional

2015-05-14 Thread Juan Quintela
This section would be sent: a- for all new machine types b- for old achine types if section state is different form {running,paused} that were the only giving us troubles. So, in new qemus: it is alwasy there. In old qemus: they are only there if it an error has happened, basically stoping on

[Qemu-devel] [PATCH 6/9] migration: create new section to store global state

2015-05-14 Thread Juan Quintela
This includes a new section that for now just stores the current qemu state. Right now, there are only one way to control what is the state of the target after migration. - If you run the target qemu with -S, it would start stopped. - If you run the target qemu without -S, it would run just after

[Qemu-devel] [PATCH 8/9] vmstate: Create optional sections

2015-05-14 Thread Juan Quintela
To make sections optional, we need to do it at the beggining of the code. Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 2 ++ migration/vmstate.c | 11 +++ savevm.c| 4 3 files changed, 17 insertions(+) diff --git a/include/migration/v

Re: [Qemu-devel] [PATCH 04/15] net/dump: Improve -net/host_net_add dump error reporting

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > When -net dump fails, it first reports a specific error, then a > generic one, like this: > > $ qemu-system-x86_64 -net dump,id=foo,file=/eperm > qemu-system-x86_64: -net dump,id=foo,file=/eperm: -net dump: can't open > /eperm > qemu-

Re: [Qemu-devel] [PATCH 5/9] qapi: Fix generators to report command line errors decently

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > On 05/11/2015 01:24 AM, Markus Armbruster wrote: >> Report to stderr, prefix with the program name. Also reject >> extra arguments. >> >> Signed-off-by: Markus Armbruster >> Reviewed-by: Eric Blake >> --- >> scripts/qapi.py | 6 +- >> 1 file changed, 5 insertions(+),

[Qemu-devel] [PATCH 1/3] scripts/qemu-gdb: Split MtreeCommand into its own module

2015-05-14 Thread Peter Maydell
As we add more commands to our Python gdb debugging support, it's going to get unwieldy to have everything in a single file. Split the implementation of the 'mtree' command from qemu-gdb.py into its own module. Signed-off-by: Peter Maydell --- scripts/qemu-gdb.py | 70 +--

[Qemu-devel] [PATCH 0/3] scripts/qemu-gdb: Add event tracing support

2015-05-14 Thread Peter Maydell
This patchset adds support for two new commands to our gdb scripts, which allow dynamically enabling and disabling tracing of events, like this: (gdb) source scripts/qemu-gdb.py (gdb) qemu trace-enable translate_block Enabled trace event translate_block Breakpoint 1 at 0xb634f: file ../trace/gene

[Qemu-devel] [PATCH 3/3] scripts/qemu-gdb: Add support for printing trace events

2015-05-14 Thread Peter Maydell
Add two new commands to our gdb support: qemu trace-enable eventname qemu trace-disable eventname which allow dynamically enabling and disabling printing of QEMU trace events during a debugging session. These work with the "null" trace backend, by putting breakpoints on the stub trace_eventname(

Re: [Qemu-devel] [PATCH v4 00/16] Fix qapi mangling of downstream names

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > On 05/14/2015 06:50 AM, Eric Blake wrote: >> This series makes it possible to use downstream extensions >> (such as __com.redhat_xyz) and temporary names (such as x-foo) >> in every position possible in QAPI schemes, with added tests >> that the generated code still compiles.

Re: [Qemu-devel] [PATCH 0/9] qapi: Mostly generator cleanups

2015-05-14 Thread Markus Armbruster
Eric Blake writes: > On 05/11/2015 01:24 AM, Markus Armbruster wrote: >> You've seen these patches before, in "[PATCH RFC 00/19] qapi: QMP >> introspection". Eric has pulled a few into "[PATCH v2 0/3] parse >> 'null' literal in QMP" and "[PATCH v3 00/14] Fix qapi mangling of >> downstream names"

Re: [Qemu-devel] [PATCH v2 0/3] Per-memory-op alignment checks

2015-05-14 Thread Peter Maydell
On 14 May 2015 at 17:06, Richard Henderson wrote: > Changes v1-v2: > > * Stuff Peter noticed: > - Don't break tci in patch one, > - Fix type of mmu_idx in softmmu_template.h > - Improve commentary tr MO_ALIGN/MO_UNALN. > > * Update args to helper_ret_stb_mmu in target-arm/helper.c. Reviewed

Re: [Qemu-devel] [PATCH 05/15] tap: net_tap_fd_init() can't fail, drop dead error handling

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > net/tap.c | 14 +- > 1 file changed, 1 insertion(+), 13 deletions(-) > > @@ -552,14 +551,8 @@ int net_init_bridge(const NetClientOptions *opts, const > char *name, > } > > fcntl(

[Qemu-devel] [PATCH 2/3] scripts/qemu-gdb: Split CoroutineCommand into its own file

2015-05-14 Thread Peter Maydell
Split the implementation of CoroutineCommand into its own file. Signed-off-by: Peter Maydell --- scripts/qemu-gdb.py | 78 + scripts/qemugdb/coroutine.py | 91 2 files changed, 93 insertions(+), 76 deletion

Re: [Qemu-devel] [PATCH 06/15] tap: Improve -netdev/netdev_add/-net/... bridge error reporting

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > When -netdev bridge fails, it first reports a specific error, then a > generic one, like this: > > $ qemu-system-x86_64 -netdev bridge,id=foo > failed to launch bridge helper > qemu-system-x86_64: -netdev bridge,id=foo: Device 'bridge'

Re: [Qemu-devel] [PATCH RFC 1/1] virtio: migrate config_vector

2015-05-14 Thread Dr. David Alan Gilbert
* Christian Borntraeger (borntrae...@de.ibm.com) wrote: > Am 14.05.2015 um 11:36 schrieb Michael S. Tsirkin: > > On Thu, May 14, 2015 at 11:22:13AM +0200, Christian Borntraeger wrote: > >> Am 13.05.2015 um 23:47 schrieb Michael S. Tsirkin: > >>> On Wed, May 13, 2015 at 08:57:00PM +0200, Christian B

Re: [Qemu-devel] [PATCH 07/15] tap: Convert tap_set_sndbuf() to Error

2015-05-14 Thread Eric Blake
On 05/12/2015 06:02 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > net/tap-aix.c | 3 +-- > net/tap-bsd.c | 3 +-- > net/tap-haiku.c | 3 +-- > net/tap-linux.c | 6 ++ > net/tap-solaris.c | 3 +-- > net/tap.c | 4 +++- > net/tap_int.h | 2 +- >

Re: [Qemu-devel] [PATCH 08/15] tap: Convert net_init_tap_one() to Error

2015-05-14 Thread Eric Blake
On 05/12/2015 06:03 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > net/tap.c | 70 > ++- > 1 file changed, 38 insertions(+), 32 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1

[Qemu-devel] [PATCH 15/23] userfaultfd: optimize read() and poll() to be O(1)

2015-05-14 Thread Andrea Arcangeli
This makes read O(1) and poll that was already O(1) becomes lockless. Signed-off-by: Andrea Arcangeli --- fs/userfaultfd.c | 172 +++ 1 file changed, 98 insertions(+), 74 deletions(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 50ed

[Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-05-14 Thread Andrea Arcangeli
This activates the userfaultfd syscall. Signed-off-by: Andrea Arcangeli --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.h | 1 + arch/x86/syscalls/syscall_32.tbl | 1 + arch/x86/syscalls/syscall_64.tbl | 1 + include/linux/syscalls.h

[Qemu-devel] [PATCH 17/23] userfaultfd: solve the race between UFFDIO_COPY|ZEROPAGE and read

2015-05-14 Thread Andrea Arcangeli
Solve in-kernel the race between UFFDIO_COPY|ZEROPAGE and userfaultfd_read if they are run on different threads simultaneously. Until now qemu solved the race in userland: the race was explicitly and intentionally left for userland to solve. However we can also solve it in kernel. Requiring all u

[Qemu-devel] [PATCH 18/23] userfaultfd: buildsystem activation

2015-05-14 Thread Andrea Arcangeli
This allows to select the userfaultfd during configuration to build it. Signed-off-by: Andrea Arcangeli --- fs/Makefile | 1 + init/Kconfig | 11 +++ 2 files changed, 12 insertions(+) diff --git a/fs/Makefile b/fs/Makefile index cb92fd4..53e59b2 100644 --- a/fs/Makefile +++ b/fs/Makef

[Qemu-devel] [PATCH 05/23] userfaultfd: add vm_userfaultfd_ctx to the vm_area_struct

2015-05-14 Thread Andrea Arcangeli
This adds the vm_userfaultfd_ctx to the vm_area_struct. Signed-off-by: Andrea Arcangeli --- include/linux/mm_types.h | 11 +++ kernel/fork.c| 1 + 2 files changed, 12 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0038ac7..2836da7 10064

[Qemu-devel] [PATCH 22/23] userfaultfd: avoid mmap_sem read recursion in mcopy_atomic

2015-05-14 Thread Andrea Arcangeli
If the rwsem starves writers it wasn't strictly a bug but lockdep doesn't like it and this avoids depending on lowlevel implementation details of the lock. Signed-off-by: Andrea Arcangeli --- mm/userfaultfd.c | 92 1 file changed, 66 inser

[Qemu-devel] [PATCH 11/23] userfaultfd: Rename uffd_api.bits into .features

2015-05-14 Thread Andrea Arcangeli
From: Pavel Emelyanov This is (seem to be) the minimal thing that is required to unblock standard uffd usage from the non-cooperative one. Now more bits can be added to the features field indicating e.g. UFFD_FEATURE_FORK and others needed for the latter use-case. Signed-off-by: Pavel Emelyanov

[Qemu-devel] [PATCH 12/23] userfaultfd: Rename uffd_api.bits into .features fixup

2015-05-14 Thread Andrea Arcangeli
Update comment. Signed-off-by: Andrea Arcangeli --- include/uapi/linux/userfaultfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h index 5e1c2f7..03f21cb 100644 --- a/include/uapi/linux/userfaultfd.h +++ b/

[Qemu-devel] [PATCH 20/23] userfaultfd: UFFDIO_COPY|UFFDIO_ZEROPAGE uAPI

2015-05-14 Thread Andrea Arcangeli
This implements the uABI of UFFDIO_COPY and UFFDIO_ZEROPAGE. Signed-off-by: Andrea Arcangeli --- include/uapi/linux/userfaultfd.h | 42 +++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/use

[Qemu-devel] [PATCH 09/23] userfaultfd: prevent khugepaged to merge if userfaultfd is armed

2015-05-14 Thread Andrea Arcangeli
If userfaultfd is armed on a certain vma we can't "fill" the holes with zeroes or we'll break the userland on demand paging. The holes if the userfault is armed, are really missing information (not zeroes) that the userland has to load from network or elsewhere. The same issue happens for wrprotec

[Qemu-devel] [PATCH 02/23] userfaultfd: waitqueue: add nr wake parameter to __wake_up_locked_key

2015-05-14 Thread Andrea Arcangeli
userfaultfd needs to wake all waitqueues (pass 0 as nr parameter), instead of the current hardcoded 1 (that would wake just the first waitqueue in the head list). Signed-off-by: Andrea Arcangeli --- include/linux/wait.h | 5 +++-- kernel/sched/wait.c | 7 --- net/sunrpc/sched.c | 2 +- 3

[Qemu-devel] [PATCH 01/23] userfaultfd: linux/Documentation/vm/userfaultfd.txt

2015-05-14 Thread Andrea Arcangeli
Add documentation. Signed-off-by: Andrea Arcangeli --- Documentation/vm/userfaultfd.txt | 140 +++ 1 file changed, 140 insertions(+) create mode 100644 Documentation/vm/userfaultfd.txt diff --git a/Documentation/vm/userfaultfd.txt b/Documentation/vm/userfaul

[Qemu-devel] [PATCH 08/23] userfaultfd: teach vma_merge to merge across vma->vm_userfaultfd_ctx

2015-05-14 Thread Andrea Arcangeli
vma->vm_userfaultfd_ctx is yet another vma parameter that vma_merge must be aware about so that we can merge vmas back like they were originally before arming the userfaultfd on some memory range. Signed-off-by: Andrea Arcangeli --- include/linux/mm.h | 2 +- mm/madvise.c | 3 ++- mm/mem

[Qemu-devel] [PATCH 21/23] userfaultfd: mcopy_atomic|mfill_zeropage: UFFDIO_COPY|UFFDIO_ZEROPAGE preparation

2015-05-14 Thread Andrea Arcangeli
This implements mcopy_atomic and mfill_zeropage that are the lowlevel VM methods that are invoked respectively by the UFFDIO_COPY and UFFDIO_ZEROPAGE userfaultfd commands. Signed-off-by: Andrea Arcangeli --- include/linux/userfaultfd_k.h | 6 + mm/Makefile | 1 + mm/userfau

[Qemu-devel] [PATCH 16/23] userfaultfd: allocate the userfaultfd_ctx cacheline aligned

2015-05-14 Thread Andrea Arcangeli
Use proper slab to guarantee alignment. Signed-off-by: Andrea Arcangeli --- fs/userfaultfd.c | 39 +++ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 3d26f41..5542fe7 100644 --- a/fs/userfaultfd.c +++ b

[Qemu-devel] [PATCH 00/23] userfaultfd v4

2015-05-14 Thread Andrea Arcangeli
Hello everyone, This is the latest userfaultfd patchset against mm-v4.1-rc3 2015-05-14-10:04. The postcopy live migration feature on the qemu side is mostly ready to be merged and it entirely depends on the userfaultfd syscall to be merged as well. So it'd be great if this patchset could be revie

[Qemu-devel] [PATCH 07/23] userfaultfd: call handle_userfault() for userfaultfd_missing() faults

2015-05-14 Thread Andrea Arcangeli
This is where the page faults must be modified to call handle_userfault() if userfaultfd_missing() is true (so if the vma->vm_flags had VM_UFFD_MISSING set). handle_userfault() then takes care of blocking the page fault and delivering it to userland. The fault flags must also be passed as paramet

[Qemu-devel] [PATCH 03/23] userfaultfd: uAPI

2015-05-14 Thread Andrea Arcangeli
Defines the uAPI of the userfaultfd, notably the ioctl numbers and protocol. Signed-off-by: Andrea Arcangeli --- Documentation/ioctl/ioctl-number.txt | 1 + include/uapi/linux/Kbuild| 1 + include/uapi/linux/userfaultfd.h | 81 3 files chang

[Qemu-devel] [PATCH 13/23] userfaultfd: change the read API to return a uffd_msg

2015-05-14 Thread Andrea Arcangeli
I had requests to return the full address (not the page aligned one) to userland. It's not entirely clear how the page offset could be relevant because userfaults aren't like SIGBUS that can sigjump to a different place and it actually skip resolving the fault depending on a page offset. There's c

[Qemu-devel] [PATCH 06/23] userfaultfd: add VM_UFFD_MISSING and VM_UFFD_WP

2015-05-14 Thread Andrea Arcangeli
These two flags gets set in vma->vm_flags to tell the VM common code if the userfaultfd is armed and in which mode (only tracking missing faults, only tracking wrprotect faults or both). If neither flags is set it means the userfaultfd is not armed on the vma. Signed-off-by: Andrea Arcangeli ---

[Qemu-devel] [PATCH 04/23] userfaultfd: linux/userfaultfd_k.h

2015-05-14 Thread Andrea Arcangeli
Kernel header defining the methods needed by the VM common code to interact with the userfaultfd. Signed-off-by: Andrea Arcangeli --- include/linux/userfaultfd_k.h | 79 +++ 1 file changed, 79 insertions(+) create mode 100644 include/linux/userfaultfd_k.h

[Qemu-devel] [PATCH 10/23] userfaultfd: add new syscall to provide memory externalization

2015-05-14 Thread Andrea Arcangeli
Once an userfaultfd has been created and certain region of the process virtual address space have been registered into it, the thread responsible for doing the memory externalization can manage the page faults in userland by talking to the kernel using the userfaultfd protocol. poll() can be used

[Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-05-14 Thread Andrea Arcangeli
This is an optimization but it's a userland visible one and it affects the API. The downside of this optimization is that if you call poll() and you get POLLIN, read(ufd) may still return -EAGAIN. The blocked userfault may be waken by a different thread, before read(ufd) comes around. This in shor

[Qemu-devel] [PATCH 23/23] userfaultfd: UFFDIO_COPY and UFFDIO_ZEROPAGE

2015-05-14 Thread Andrea Arcangeli
These two ioctl allows to either atomically copy or to map zeropages into the virtual address space. This is used by the thread that opened the userfaultfd to resolve the userfaults. Signed-off-by: Andrea Arcangeli --- fs/userfaultfd.c | 96 +++

Re: [Qemu-devel] [PATCH 10/23] userfaultfd: add new syscall to provide memory externalization

2015-05-14 Thread Linus Torvalds
On Thu, May 14, 2015 at 10:31 AM, Andrea Arcangeli wrote: > +static __always_inline void wake_userfault(struct userfaultfd_ctx *ctx, > + struct userfaultfd_wake_range > *range) > +{ > + if (waitqueue_active(&ctx->fault_wqh)) > + __wake_

Re: [Qemu-devel] [PATCH] Do not emulate a floppy drive when -nodefaults

2015-05-14 Thread John Snow
On 05/14/2015 10:07 AM, Michael S. Tsirkin wrote: > On Thu, May 14, 2015 at 02:02:04PM +0200, Markus Armbruster wrote: >> Correct. >> >> Here's how I think it should be done: >> >> * Create a machine option to control the FDC >> >> This is a machine-specific option. It should only exist for ma

Re: [Qemu-devel] [RFC v1 2/3] target-microblaze: Allow the stack protection to be disabled

2015-05-14 Thread Richard Henderson
On 05/13/2015 11:08 PM, Alistair Francis wrote: > void helper_stackprot(CPUMBState *env, uint32_t addr) > { > -if (addr < env->slr || addr > env->shr) { > +MicroBlazeCPU *cpu = mb_env_get_cpu(env); > + > +if (cpu->cfg.stackproc && (addr < env->slr || addr > env->shr)) { This check sh

Re: [Qemu-devel] [PATCH v3 2/2] target-mips: Misaligned memory accesses for MSA

2015-05-14 Thread Richard Henderson
On 05/14/2015 02:46 AM, Yongbok Kim wrote: > In addition to that, if we issue all the loads let say only the first page is > accessible, in the architectural point of view it would be fine as nothing > will > be stored in the vector register but accessing the first page is "visible" > from > the

[Qemu-devel] [PATCH v2 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros

2015-05-14 Thread Eduardo Habkost
This series does some changes to make the macros more consistent. Now every pc and pseries version has a corresponding compat macro defined. Changes v1 -> v2: * Rebase after the new PC 2.4 machine-types were added Eduardo Habkost (13): pc: Replace tab with spaces hw: Move commas inside HW_COM

[Qemu-devel] [PATCH v2 01/13] pc: Replace tab with spaces

2015-05-14 Thread Eduardo Habkost
Coding style change only. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 2 +- include/hw/i386/pc.h | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 212e263..a8ff6f5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i

[Qemu-devel] [PATCH v2 05/13] hw: Define empty HW_COMPAT_2_[23] macros

2015-05-14 Thread Eduardo Habkost
Now we can make everything consistent and define the macros even if they are still empty. Signed-off-by: Eduardo Habkost --- include/hw/compat.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/hw/compat.h b/include/hw/compat.h index c56a698..4a43466 100644 --- a/include/hw/comp

[Qemu-devel] [PATCH v2 08/13] spapr: define SPAPR_COMPAT_2_3

2015-05-14 Thread Eduardo Habkost
Don't add the pseries-2.3 machine yet, but define the corresponding SPAPR_COMPAT macro to make sure both pseries-2.2 and pseries-2.1 will inherit HW_COMPAT_2_3. Signed-off-by: Eduardo Habkost --- hw/ppc/spapr.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr

[Qemu-devel] [PATCH v2 02/13] hw: Move commas inside HW_COMPAT_2_1 macro

2015-05-14 Thread Eduardo Habkost
Changing the convention to include commas inside the macros will allow macros containing empty lists to be defined and used without compilation errors. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 2 +- hw/i386/pc_q35.c | 2 +- hw/ppc/spapr.c | 2 +- include/hw/compat.h |

[Qemu-devel] [PATCH v2 13/13] piix: Define PC_COMPAT_0_10

2015-05-14 Thread Eduardo Habkost
Move compat_props from pc-0.10 to the macro, to make it consistent with the other machines. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 47 +-- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_pi

[Qemu-devel] [PATCH v2 04/13] spapr: Move commas inside SPAPR_COMPAT_* macros

2015-05-14 Thread Eduardo Habkost
Changing the convention to include commas inside the macros will allow macros containing empty lists to be defined and used without compilation errors. Signed-off-by: Eduardo Habkost --- hw/ppc/spapr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/

[Qemu-devel] [PATCH v2 06/13] pc: Define PC_COMPAT_2_[123] macros

2015-05-14 Thread Eduardo Habkost
Once we start adding compat code for pc-2.3, the usage of HW_COMPAT_2_1 in pc-*-2.2 won't be enough, as it also has to include PC_COMPAT_2_3 inside it. To ensure that, define PC_COMPAT_2_3, PC_COMPAT_2_2, and PC_COMPAT_2_1 macros. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 10

[Qemu-devel] [PATCH v2 12/13] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13

2015-05-14 Thread Eduardo Habkost
The VGA and vmware-svga rombar compat properties were added by commit 281a26b15b4adcecb8604216738975abd754bea8, but only to pc-0.13 and pc-0.12. This breaks the PC_COMPAT_* nesting pattern we currently follow. The new variables will now be inherited by pc-0.11 and older, but pc-0.11 and pc-0.10 al

[Qemu-devel] [PATCH v2 09/13] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14

2015-05-14 Thread Eduardo Habkost
Those properties were introduced by commit 3827cdb1c3aa17a792d1658161195b9d7173c26b. They were not duplicated into pc-0.13 and older because 0.14 was the first QEMU version supporting qxl. The only problem is that this breaks the PC_COMPAT_* nesting pattern we currently use. So, move the propertie

[Qemu-devel] [PATCH v2 03/13] pc: Move commas inside PC_COMPAT_* macros

2015-05-14 Thread Eduardo Habkost
Changing the convention to include commas inside the macros will allow macros containing empty lists to be defined and used without compilation errors. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 62 ++-- hw/i386/pc_q35.c | 10 +++

[Qemu-devel] [PATCH v2 07/13] spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros

2015-05-14 Thread Eduardo Habkost
SPAPR_COMPAT_2_1 will need to include both HW_COMPAT_2_2 and HW_COMPAT_2_1, so include HW_COMPAT_2_1 inside SPAPR_COMPAT_2_1 and HW_COMPAT_2_2 inside SPAPR_COMPAT_2_2. Signed-off-by: Eduardo Habkost --- hw/ppc/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pp

[Qemu-devel] [PATCH v2 10/13] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11

2015-05-14 Thread Eduardo Habkost
The current code setting ide-drive.ver and scsi-disk.ver on pc-0.11 breaks the PC_COMPAT_* nesting pattern we currently use. As those variables are overwritten in pc-0.10 too, they can be inherited by pc-0.10 with no side-effects at all. Cc: Gerd Hoffmann Signed-off-by: Eduardo Habkost --- hw/

[Qemu-devel] [PATCH v2 11/13] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13

2015-05-14 Thread Eduardo Habkost
The compat property was added by commit 9dbcca5aa13cb9ab40788ac4c56bc227d94ca920, and the pc-0.12 and older machine-types were not changed because virtio-9p-pci was introduced on QEMU 0.13 (commit 9f10751365b26b13b8a9b67e0e90536ae3d282df). The only problem is that this breaks the PC_COMPAT_* nestin

Re: [Qemu-devel] [PATCH V7 15/16] virtio-pci: increase the maximum number of virtqueues to 513

2015-05-14 Thread Eduardo Habkost
On Thu, Apr 23, 2015 at 02:21:48PM +0800, Jason Wang wrote: > This patch increases the maximum number of virtqueues for pci from 64 > to 513. This will allow booting a virtio-net-pci device with 256 queue > pairs on recent Linux host (which supports up to 256 tuntap queue pairs). > > To keep migra

Re: [Qemu-devel] [PATCH v3 2/2] target-mips: Misaligned memory accesses for MSA

2015-05-14 Thread Richard Henderson
On 05/14/2015 08:27 AM, Richard Henderson wrote: > Perhaps > > void probe_read(CPUArchState *env, target_ulong addr, int mmu_idx, > uintptr_t retaddr); > > void probe_write(CPUArchState *env, target_ulong addr, int mmu_idx, > uintptr_t r

[Qemu-devel] [PULL] Per-memory-op alignment checks

2015-05-14 Thread Richard Henderson
in the git repository at: git://github.com/rth7680/qemu.git tags/pull-tcg-20150514 for you to fetch changes up to dfb36305626636e2e07e0c5acd3a002a5419399e: tcg: Add MO_ALIGN, MO_UNALN (2015-05-14 12:15:18 -0700) Per-memop

Re: [Qemu-devel] [PATCH 09/15] tap: Convert launch_script() to Error

2015-05-14 Thread Eric Blake
On 05/12/2015 06:03 AM, Markus Armbruster wrote: > Fixes inappropriate use of stderr in monitor command handler. > > While there, improve the messages some. > > Signed-off-by: Markus Armbruster > --- > net/tap.c | 40 > 1 file changed, 28 insertions(+),

[Qemu-devel] [PATCH] nsis: Add QEMU version information to Windows registry

2015-05-14 Thread Stefan Weil
The uninstall keys include an option key "DisplayVersion" which we set now. By default the version value is read from file VERSION, but it is also possible to pass VERSION=#.#.# to make. Signed-off-by: Stefan Weil --- Makefile | 1 + qemu.nsi | 3 +++ 2 files changed, 4 insertions(+) diff --git

[Qemu-devel] [PATCH] pci: Fix compiler warning (MinGW-w64 gcc 4.9)

2015-05-14 Thread Stefan Weil
i686-w64-mingw32-gcc 4.9.1 from Debian Jessie complains: hw/pci/pci.c:938:29: warning: array subscript is above array bounds [-Warray-bounds] Using g_assert instead of assert fixes this warning. Signed-off-by: Stefan Weil --- hw/pci/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[Qemu-devel] [RFC PATCH] hw/arm/virt: Added preliminary GICv3 support for kvm mode

2015-05-14 Thread Ashok Kumar
Added -M virt,gicversion=2,3 property to configure GICv2 or GICv3. GICv3 save/restore is not supported as vgic-v3-emul.c is yet to support them. Signed-off-by: Ashok Kumar --- Tested KVM/GICv3 in ARM fastmodel. Tested TCG/GICv2. Not tested KVM/GICv2. hw/arm/virt.c| 56 ++

[Qemu-devel] New account on developer wiki

2015-05-14 Thread Eyal de Lara
Hi, I am new to qemu development, and would appreciate it very much if someone please creates an account for me on the developer wiki. Thanks in advance for taking the time to address this request. Cheers, Eyal

<    1   2   3   4   >