Re: [Qemu-devel] [Bug] qemu_coroutine_enter abort and report error "Co-routine re-entered recursively"

2015-03-05 Thread Halsey Pian
Qemu version: qemu-2.2.0 release Platform: x86_64 From: Halsey Pian [mailto:halsey.p...@gmail.com] Sent: 2015年3月6日 15:04 To: qemu-devel@nongnu.org Cc: halsey.p...@gmail.com Subject: [Qemu-devel][Bug] qemu_coroutine_enter abort and report error "Co-routine re-entered recursively" Hi

[Qemu-devel] [Bug] qemu_coroutine_enter abort and report error "Co-routine re-entered recursively"

2015-03-05 Thread Halsey Pian
Hi All, I have two threads to write two seperate qcow2 files, but after a while, the writing would be aborted in qemu_coroutine_enter, and report error “"Co-routine re-entered recursively” . Qemu should be thread safe, right? It seems that there are some variables is not thread safe? C

Re: [Qemu-devel] 9pfs-proxy: -retval vs errno vs -1

2015-03-05 Thread Aneesh Kumar K.V
Michael Tokarev writes: > Another interesting tidbit is in hw/9pfs/virtio-9p-proxy.c. > > All filesystem methods use common v9fs_request() function, > which returns -errno. So far so good. > > Now, *all* places which call this function, does this: > > retval = v9fs_request(...); > if (re

[Qemu-devel] [PATCH 0/6] Clean up ISA dependencies so we make ISA optional to build

2015-03-05 Thread David Gibson
At present, ISA bus support is always included in the build for all targets. However these days there are a number of targets that have never had ISA, and even more where many of the individual machines don't have ISA. Unfortunately there are some awkward dependencies in the core code on ISA, alt

[Qemu-devel] [PATCH 3/6] pc: Use MachineClass callbacks for "irq" and "pic" hmp commands

2015-03-05 Thread David Gibson
Currently PC machine types rely on fallback code in the monitor implementation to correctly implement these hmp commands. Now that we have MachineClass callbacks to control this properly, instantiate them in pc_generic_machine_class_init(). Since this sets the MachineClass callbacks correctly for

[Qemu-devel] [PATCH 6/6] Allow ISA bus to be configured out

2015-03-05 Thread David Gibson
Currently, the code to handle the legacy ISA bus is always included in qemu. However there are lots of platforms that don't include ISA legacy devies, and quite a few that have never used ISA legacy devices at all. This patch allows the ISA bus code to be disabled in the configuration for platfor

[Qemu-devel] [PATCH 5/6] prep: Use MachineClass callbacks for "irq" and "pic" hmp commands

2015-03-05 Thread David Gibson
Currently all ppc targets rely on fallback code in monitor.c to implement the "irq" and "pic" hmp commands, by calling into the i8259 code. For the PReP machine type, which does usually have an ISA bridge and legacy IO, including an i8259, this patch correctly sets the MachineClass callbacks to im

[Qemu-devel] [PATCH 4/6] target-ppc: Convert PReP to machine class

2015-03-05 Thread David Gibson
The more commonly used ppc machine types: spapr, and newworld Mac have already been converted to the newer MachineClass representation, but some others still use QEMUMachine. This patch cleans things up slightly, by converting the "prep" machine type to the new style. Signed-off-by: David Gibson

[Qemu-devel] [PATCH 1/6] Split serial-isa into its own config option

2015-03-05 Thread David Gibson
At present, the core device model code for 8250-like serial ports (serial.c) and the code for serial ports attached to ISA-style legacy IO (serial-isa.c) are both controlled by the CONFIG_ISA variable. There are lots and lots of embedded platforms that have 8250-like serial ports but have never ha

[Qemu-devel] [PATCH 2/6] Remove monitor.c dependency on CONFIG_I8259

2015-03-05 Thread David Gibson
The hmp commands "irq" and "pic" are a bit of a mess. They're implemented on a number of targets, but not all. On sparc32 and LM32 they do target specific things, but on the remainder (i386, ppc and mips) they call into the i8259 PIC code. But really, what these commands do shouldn't be dependen

Re: [Qemu-devel] [PATCH v4 01/10] cpu/apic: drop icc bus/bridge/

2015-03-05 Thread Chen Fan
On 03/06/2015 02:17 AM, Eduardo Habkost wrote: On Fri, Feb 13, 2015 at 06:25:24PM +0800, Zhu Guihua wrote: From: Chen Fan ICC bus was invented only to provide hotplug capability to CPU and APIC because at the time being hotplug was available only for BUS attached devices. Now this patch is t

Re: [Qemu-devel] [PATCH RFC v3 24/27] COLO NIC: Implement NIC checkpoint and failover

2015-03-05 Thread zhanghailiang
On 2015/3/6 1:12, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: Signed-off-by: zhanghailiang Signed-off-by: Gao feng --- include/net/colo-nic.h | 3 ++- migration/colo.c | 22 ++ net/colo-nic.c | 19

Re: [Qemu-devel] [RFC 0/1] Rolling stats on colo

2015-03-05 Thread zhanghailiang
On 2015/3/6 9:48, zhanghailiang wrote: On 2015/3/5 21:31, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" Hi Dave, Hi, I'm getting COLO running on a couple of our machines here and wanted to see what was actually going on, so I merged in my recent rolling-stats code:

Re: [Qemu-devel] [RFC 0/1] Rolling stats on colo

2015-03-05 Thread zhanghailiang
On 2015/3/5 21:31, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" Hi Dave, Hi, I'm getting COLO running on a couple of our machines here and wanted to see what was actually going on, so I merged in my recent rolling-stats code: http://lists.gnu.org/archive/html/qemu-

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-05 Thread Andrey Korolyov
On Fri, Mar 6, 2015 at 1:14 AM, Andrey Korolyov wrote: > Hello, > > recently I`ve got a couple of shiny new Intel 2620v2s for future > replacement of the E5-2620v1, but I experienced relatively many events > with emulation errors, all traces looks simular to the one below. I am > running qemu-2.1

[Qemu-devel] [PATCH] user-exec.c: fix build on NetBSD/sparc64 and NetBSD/arm

2015-03-05 Thread Tobias Nygren
A couple of #ifdef changes necessary to use NetBSD's ucontext structs on sparc64 and arm. Signed-off-by: Tobias Nygren --- user-exec.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/user-exec.c b/user-exec.c index 1ff8673..8f57e8a 100644 --- a/user-exec.c ++

Re: [Qemu-devel] [PATCH v3 for-2.3 10/24] hw/apci: add _PRT method for extra PCI root busses

2015-03-05 Thread Michael S. Tsirkin
On Thu, Mar 05, 2015 at 11:55:34PM +0200, Marcel Apfelbaum wrote: > On 03/05/2015 09:52 PM, Michael S. Tsirkin wrote: > >On Thu, Mar 05, 2015 at 04:55:08PM +0200, Marcel Apfelbaum wrote: > >>Signed-off-by: Marcel Apfelbaum > >>--- > >> hw/i386/acpi-build.c | 78 > >> +

[Qemu-devel] [PATCH 3/8] net/dp8393x: always calculate proper checksums

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau --- hw/net/dp8393x.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 4f3e8a2..802f2b0 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -21,16 +21,10 @@ #include "qemu/timer.h" #in

[Qemu-devel] [PATCH 7/8] net/dp8393x: add PROM to store MAC address

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Laurent Vivier Signed-off-by: Hervé Poussineau --- hw/mips/mips_jazz.c |1 + hw/net/dp8393x.c| 18 ++ 2 files changed, 19 insertions(+) diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 16a8368..cb33c9c 100644 --- a/hw/mips/mips_jazz.c +++ b/h

[Qemu-devel] [PATCH 6/8] net/dp8393x: QOM'ify

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Laurent Vivier Signed-off-by: Hervé Poussineau --- hw/mips/mips_jazz.c| 12 +-- hw/net/dp8393x.c | 83 +--- include/hw/mips/mips.h |5 --- 3 files changed, 67 insertions(+), 33 deletions(-) diff --git a/hw/mips/mip

[Qemu-devel] [PATCH 4/8] net/dp8393x: do not use old_mmio accesses

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau --- hw/net/dp8393x.c | 112 ++ 1 file changed, 28 insertions(+), 84 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 802f2b0..f86a281 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -4

[Qemu-devel] [PATCH 8/8] net/dp8393x: add load/save support

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau --- hw/net/dp8393x.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 7b658d9..49fa2a8 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -850,6 +850,17 @@ static void dp8393x_realize(DeviceState *de

[Qemu-devel] [PATCH 2/8] rc4030: use AddressSpace and address_space_rw in users

2015-03-05 Thread Hervé Poussineau
Now that rc4030 internally uses an AddressSpace for DMA handling, make its root memory region public. This is especially usefull for dp8393x netcard, which now uses well known QEMU types and methods. Signed-off-by: Hervé Poussineau --- hw/dma/rc4030.c| 14 -- hw/mips/mips_j

[Qemu-devel] [PATCH 1/8] rc4030: create custom DMA address space

2015-03-05 Thread Hervé Poussineau
Add a new memory region in system address space where DMA address space definition (the 'translation table') belongs, so we can update on the fly the DMA address space. Signed-off-by: Hervé Poussineau --- hw/dma/rc4030.c | 154 ++- 1 file chan

[Qemu-devel] [PATCH 0/8] net/dp8393x improvements

2015-03-05 Thread Hervé Poussineau
Hi, This patchset improves dp8393x network card emulation to current QEMU standards, mostly decouples it from MIPS rc4030 chipset emulation, and add PROM and load/save functionalities. Only required cleanup has been done on the rc4030 side. Patchset has been tested on MIPS Jazz emulation and on

[Qemu-devel] [PATCH 5/8] net/dp8393x: use dp8393x_ prefix for all functions

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau --- hw/net/dp8393x.c | 80 -- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index f86a281..809f493 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -1

[Qemu-devel] E5-2620v2 - emulation stop error

2015-03-05 Thread Andrey Korolyov
Hello, recently I`ve got a couple of shiny new Intel 2620v2s for future replacement of the E5-2620v1, but I experienced relatively many events with emulation errors, all traces looks simular to the one below. I am running qemu-2.1 on x86 on top of 3.10 branch for testing purposes but can switch to

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

2015-03-05 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 18/21] userfaultfd: UFFDIO_REMAP uABI

2015-03-05 Thread Andrea Arcangeli
This implements the uABI of UFFDIO_REMAP. Notably one mode bitflag is also forwarded (and in turn known) by the lowlevel remap_pages method. Signed-off-by: Andrea Arcangeli --- include/uapi/linux/userfaultfd.h | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) di

Re: [Qemu-devel] [PATCH v3 for-2.3 10/24] hw/apci: add _PRT method for extra PCI root busses

2015-03-05 Thread Marcel Apfelbaum
On 03/05/2015 09:52 PM, Michael S. Tsirkin wrote: On Thu, Mar 05, 2015 at 04:55:08PM +0200, Marcel Apfelbaum wrote: Signed-off-by: Marcel Apfelbaum --- hw/i386/acpi-build.c | 78 1 file changed, 78 insertions(+) diff --git a/hw/i386/acpi-

[Qemu-devel] [PATCH v3 for-2.3 15/24] hw/pci: made pci_bus_num a PCIBusClass method

2015-03-05 Thread Marcel Apfelbaum
From: Marcel Apfelbaum Refactoring it as a method of PCIBusClass will allow different implementations for subclasses. Signed-off-by: Marcel Apfelbaum --- hw/i386/kvm/pci-assign.c | 1 + hw/pci/pci.c | 7 --- hw/pci/pci_bus.c | 10 ++ hw/scsi/megasas.c|

[Qemu-devel] [PATCH v3 for-2.3 23/24] hw/pci_bus: add support for NUMA nodes

2015-03-05 Thread Marcel Apfelbaum
PCI root buses can be attached to a specific NUMA node. PCI buses are not attached be default to a NUMA node. Signed-off-by: Marcel Apfelbaum --- hw/pci/pci_bus.c | 7 +++ include/hw/pci/pci_bus.h | 6 ++ include/sysemu/sysemu.h | 1 + 3 files changed, 14 insertions(+) diff --g

[Qemu-devel] [PATCH v2 2/2] iotests: add O_DIRECT alignment probing test

2015-03-05 Thread Stefan Hajnoczi
This test case checks that image files can be opened even if I/O produces EIO errors. QEMU should not refuse opening failed disks since the guest may be configured for multipath I/O where accessing failed disks is expected. Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/128 | 82

[Qemu-devel] [PATCH v2 1/2] block/raw-posix: fix launching with failed disks

2015-03-05 Thread Stefan Hajnoczi
Since commit c25f53b06eba1575d5d0e92a0132455c97825b83 ("raw: Probe required direct I/O alignment") QEMU has failed to launch if image files produce I/O errors. Previously, QEMU would launch successfully and the guest would see the errors when attempting I/O. This is a regression and may prevent m

[Qemu-devel] [PATCH v2 0/2] block/raw-posix: fix launching with failed disks

2015-03-05 Thread Stefan Hajnoczi
Guests configured for multipath I/O might be started up with failed disks attached. QEMU should not refuse starting when a disk returns I/O errors (and in the past this behavior was implemented correctly). This patch series fixes a regression that prevents QEMU from opening failed disks and adds

[Qemu-devel] [PATCH 4/6 v5] linux-user: Support tilegx architecture in syscall

2015-03-05 Thread Chen Gang
Add tilegx architecture in "syscall_defs.h", all related features (ioctrl, and stat) are based on Linux kernel tilegx 64-bit implementation. Signed-off-by: Chen Gang --- linux-user/syscall_defs.h | 38 ++ 1 file changed, 34 insertions(+), 4 deletions(-) diff

Re: [Qemu-devel] [PATCH 6/6] target-i386: Call cpu_exec_init() on realize

2015-03-05 Thread Eduardo Habkost
On Thu, Mar 05, 2015 at 05:44:58PM +0100, Andreas Färber wrote: > Am 05.03.2015 um 17:42 schrieb Igor Mammedov: [...] > >> @@ -2840,7 +2842,6 @@ static void x86_cpu_initfn(Object *obj) > >> CPUX86State *env = &cpu->env; > >> > >> cs->env_ptr = env; > >> -cpu_exec_init(env); > > look

[Qemu-devel] [PATCH 3/6 v5] linux-user: tilegx: Add target features support within qemu

2015-03-05 Thread Chen Gang
They are for target features within qemu which independent from outside. Signed-off-by: Chen Gang --- linux-user/tilegx/target_cpu.h | 35 +++ linux-user/tilegx/target_signal.h | 28 ++ linux-user/tilegx/target_structs.h | 48 +

[Qemu-devel] [PATCH 6/6 v5] linux-user/syscall.c: conditionalize syscalls which are not defined in tilegx

2015-03-05 Thread Chen Gang
For tilegx, several syscall macros are not supported, so switch them to avoid building break. Signed-off-by: Chen Gang --- linux-user/syscall.c | 50 +- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user

Re: [Qemu-devel] [PATCH 0/6] target-i386: Remove side-effects from X86CPU::instance_init

2015-03-05 Thread Eduardo Habkost
On Thu, Mar 05, 2015 at 12:38:44PM -0300, Eduardo Habkost wrote: > Eduardo Habkost (6): > cpu: No need to zero-initialize numa_node > cpu: Initialize breakpoint/watchpoint lists on cpu_common_initfn() > cpu: Reorder cpu->as and cpu->thread_id initialization Andreas, do you want to queue the

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

2015-03-05 Thread Pavel Emelyanov
> +static int mcopy_atomic_pte(struct mm_struct *dst_mm, > + pmd_t *dst_pmd, > + struct vm_area_struct *dst_vma, > + unsigned long dst_addr, > + unsigned long src_addr) > +{ > + struct mem_cgroup *me

[Qemu-devel] [PATCH 5/6 v5] linux-user: Support tilegx architecture in linux-user

2015-03-05 Thread Chen Gang
Add main working flow feature and loading elf64 tilegx binary feature, based on Linux kernel tilegx 64-bit implementation. After this patch, qemu can successfully load elf64 tilegx binary for linux-user, and the working flow reaches the first correct instruction position "__start". Signed-off-by:

[Qemu-devel] [PATCH 0/6 v5] tilegx: Can load elf64 tilegx binary successfully for linux-user

2015-03-05 Thread Chen Gang
After load elf64 tilegx binary for linux-user, the working flow reaches 1st correct instruction "__start". Next, we shall load all instructions for qemu using. This patch is based on Linux kernel tile architecture tilegx 64-bit implementation, and also based on tilegx architecture ABI reference.

[Qemu-devel] [PATCH 1/6 v5] target-tilegx: Firstly add TILE-Gx with minimized features

2015-03-05 Thread Chen Gang
It is the configure and build system support for TILE-Gx (tilegx will be used in configure and real sub-directory name), and at present, it is linux-user only. Signed-off-by: Chen Gang --- configure | 3 + default-configs/tilegx-linux-user.mak | 1 + target-tilegx

[Qemu-devel] [PATCH 2/6 v5] linux-user: tilegx: Firstly add architecture related features

2015-03-05 Thread Chen Gang
They are based on Linux kernel tilegx architecture for 64 bit binary, also based on tilegx ABI reference document. Signed-off-by: Chen Gang --- linux-user/tilegx/syscall.h| 80 linux-user/tilegx/syscall_nr.h | 278 linux-user/tilegx/term

Re: [Qemu-devel] [PATCH 00/21] RFC: userfaultfd v3

2015-03-05 Thread Pavel Emelyanov
> All UFFDIO_COPY/ZEROPAGE/REMAP methods already support CRIU postcopy > live migration and the UFFD can be passed to a manager process through > unix domain sockets to satisfy point 5). Yup :) That's the best (from my POV) point of ufd -- the ability to delegate the descriptor to some other task

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

2015-03-05 Thread Pavel Emelyanov
> diff --git a/kernel/fork.c b/kernel/fork.c > index cf65139..cb215c0 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -425,6 +425,7 @@ static int dup_mmap(struct mm_struct *mm, struct > mm_struct *oldmm) > goto fail_nomem_anon_vma_fork; > tmp->vm_flags &

Re: [Qemu-devel] [PATCH 19/21] userfaultfd: remap_pages: UFFDIO_REMAP preparation

2015-03-05 Thread Pavel Emelyanov
> +ssize_t remap_pages(struct mm_struct *dst_mm, struct mm_struct *src_mm, > + unsigned long dst_start, unsigned long src_start, > + unsigned long len, __u64 mode) > +{ > + struct vm_area_struct *src_vma, *dst_vma; > + long err = -EINVAL; > + pmd_t *src_p

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

2015-03-05 Thread Pavel Emelyanov
> +int handle_userfault(struct vm_area_struct *vma, unsigned long address, > + unsigned int flags, unsigned long reason) > +{ > + struct mm_struct *mm = vma->vm_mm; > + struct userfaultfd_ctx *ctx; > + struct userfaultfd_wait_queue uwq; > + > + BUG_ON(!rwsem_is_loc

[Qemu-devel] [Bug 1428657] [NEW] qemu-system-arm does not ignore the lowest bit of pc when returning from interrrupt

2015-03-05 Thread Anders Esbensen
Public bug reported: This was observed in qemu v2.1.3, running a sample app from FreeRTOS(FreeRTOSV7.5.2/FreeRTOS/Demo/CORTEX_LM3S_Eclipse/RTOSDemo) In the sample code compiled with arm-none-eabi-gcc , version 4.8.2 (4.8.2-14ubuntu1+6) . qemu seems to be executing the wrong instrunction aft

Re: [Qemu-devel] [PATCH v3 for-2.3 10/24] hw/apci: add _PRT method for extra PCI root busses

2015-03-05 Thread Michael S. Tsirkin
On Thu, Mar 05, 2015 at 04:55:08PM +0200, Marcel Apfelbaum wrote: > Signed-off-by: Marcel Apfelbaum > --- > hw/i386/acpi-build.c | 78 > > 1 file changed, 78 insertions(+) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index e

Re: [Qemu-devel] [PATCH 19/21] userfaultfd: remap_pages: UFFDIO_REMAP preparation

2015-03-05 Thread Linus Torvalds
On Thu, Mar 5, 2015 at 10:51 AM, Andrea Arcangeli wrote: > > Thanks for your idea that the UFFDIO_COPY is faster, the userland code > we submitted for qemu only uses UFFDIO_COPY|ZEROPAGE, it never uses > UFFDIO_REMAP. Ok. So there's no actual expected use of the remap interface. Good. That makes

Re: [Qemu-devel] [PATCH v4 2/5] target-i386: Remove unused APIC ID default code

2015-03-05 Thread Eduardo Habkost
On Thu, Mar 05, 2015 at 07:35:17PM +0100, Andreas Färber wrote: > Am 05.03.2015 um 14:43 schrieb Eduardo Habkost: > > On Tue, Mar 03, 2015 at 11:13:41PM -0300, Eduardo Habkost wrote: > >> The existing apic_id = cpu_index code has no visible effect: the PC code > >> already initializes the APIC ID a

Re: [Qemu-devel] [RFC PATCH 01/14] docs: block replication's description

2015-03-05 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 03/05/2015 12:35 AM, Dr. David Alan Gilbert wrote: > > * Wen Congyang (we...@cn.fujitsu.com) wrote: > >> Signed-off-by: Wen Congyang > >> Signed-off-by: Paolo Bonzini > >> Signed-off-by: Yang Hongyang > >> Signed-off-by: zhanghailiang > >> Signe

Re: [Qemu-devel] [PATCH 19/21] userfaultfd: remap_pages: UFFDIO_REMAP preparation

2015-03-05 Thread Andrea Arcangeli
On Thu, Mar 05, 2015 at 09:39:48AM -0800, Linus Torvalds wrote: > Is this really worth it? On real loads? That people are expected to use? I fully agree that it's not worth merging upstream UFFDIO_REMAP until (and if) a real world usage for it will showup. To further clarify: would this not have b

Re: [Qemu-devel] [PATCH v4 09/10] cpu: add device_add foo-x86_64-cpu support

2015-03-05 Thread Eduardo Habkost
On Fri, Feb 13, 2015 at 06:25:32PM +0800, Zhu Guihua wrote: > From: Chen Fan > > Add support to device_add foo-x86_64-cpu, and additional checks of > apic id are added into x86_cpuid_set_apic_id() to avoid duplicate. > Besides, in order to support "device/device_add foo-x86_64-cpu" > which withou

Re: [Qemu-devel] [PATCH v4 2/5] target-i386: Remove unused APIC ID default code

2015-03-05 Thread Andreas Färber
Am 05.03.2015 um 14:43 schrieb Eduardo Habkost: > On Tue, Mar 03, 2015 at 11:13:41PM -0300, Eduardo Habkost wrote: >> The existing apic_id = cpu_index code has no visible effect: the PC code >> already initializes the APIC ID according to the topology on >> pc_new_cpu(), and linux-user memcpy()s th

Re: [Qemu-devel] [PATCH v4 05/10] qom/cpu: move register_vmstate to common CPUClass.realizefn

2015-03-05 Thread Eduardo Habkost
On Fri, Feb 13, 2015 at 06:25:28PM +0800, Zhu Guihua wrote: > From: Gu Zheng > > Move cpu vmstate register from cpu_exec_init into cpu_common_realizefn, > and use cc->get_arch_id as the instance id that suggested by Igor to > fix the migration issue. If you are implementing something new, please

Re: [Qemu-devel] [PATCH v3 3/4] migration: Convert 'status' of MigrationInfo to use an enum type

2015-03-05 Thread Markus Armbruster
zhanghailiang writes: > The original 'status' is an open-coded 'str' type, convert it to use an > enum type. > This conversion is backwards compatible, better documented and > more convenient for future extensibility. > > We also rename 'MIGRATION_STATUS_ERROR' to 'MIGRATION_STATUS_FAILED'. > In

Re: [Qemu-devel] [PATCH v4 01/10] cpu/apic: drop icc bus/bridge/

2015-03-05 Thread Eduardo Habkost
On Fri, Feb 13, 2015 at 06:25:24PM +0800, Zhu Guihua wrote: > From: Chen Fan > > ICC bus was invented only to provide hotplug capability to > CPU and APIC because at the time being hotplug was available only for > BUS attached devices. > > Now this patch is to drop ICC bus impl, and switch to bu

Re: [Qemu-devel] 9pfs-local: open2() deletes existing data?

2015-03-05 Thread Aneesh Kumar K.V
Michael Tokarev writes: > I was looking at various interesting functions in hw/9pfs/virtio-9p-local.c > and noticed local_open2() which basically tries to open a file in a > filesystem, and if that is successful, it tries to set file credentials > using a configured mechanism, and if that fails,

Re: [Qemu-devel] [PATCH] block/raw-posix: fix launching with failed disks

2015-03-05 Thread Stefan Hajnoczi
On Thu, Mar 05, 2015 at 01:53:57PM +0100, Kevin Wolf wrote: > Am 04.03.2015 um 23:48 hat Stefan Hajnoczi geschrieben: > > Since commit c25f53b06eba1575d5d0e92a0132455c97825b83 ("raw: Probe > > required direct I/O alignment") QEMU has failed to launch if image files > > produce I/O errors. > > > >

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-05 Thread Stefan Hajnoczi
On Wed, Mar 04, 2015 at 05:16:51PM +0100, Alberto Garcia wrote: > On Wed, Mar 04, 2015 at 10:04:27AM -0600, Stefan Hajnoczi wrote: > > > > > This pattern suggests throttle_timer_fired() should acquire the > > > > lock internally instead. > > > > > > The idea is that the ThrottleState code itself

Re: [Qemu-devel] [PATCH 19/21] userfaultfd: remap_pages: UFFDIO_REMAP preparation

2015-03-05 Thread Linus Torvalds
On Thu, Mar 5, 2015 at 9:18 AM, Andrea Arcangeli wrote: > remap_pages is the lowlevel mm helper needed to implement > UFFDIO_REMAP. This function is nasty nasty nasty. Is this really worth it? On real loads? That people are expected to use? Considering how we just got rid of one special magic V

Re: [Qemu-devel] [PATCH] savevm: create snapshot failed when id_str already exits

2015-03-05 Thread Stefan Hajnoczi
On Thu, Mar 05, 2015 at 09:05:52PM +0800, Yi Wang wrote: > Thanks for your reply and Happy Lantern Festival! > I am afraid you misunderstood what I mean, maybe I didn't express > clearly :-) My patch works in such case: > Firstly vm has two disks: > [root@fox-host vmimg]# virsh domblklist win7 > Ta

Re: [Qemu-devel] [Xen-devel] [v2][PATCH] libxl: add one machine property to support IGD GFX passthrough

2015-03-05 Thread Ian Campbell
On Mon, 2015-03-02 at 09:20 +0800, Chen, Tiejun wrote: > Is this expected? Yes. Can you post it as a proper patch please. I suggest you split the basic stuff and the kind override discussed below in to two patches. > >> +(b_info->u.hvm.gfx_passthru && > >> + strncmp(b_inf

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

2015-03-05 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 199a03a..fbf21f5 10064

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

2015-03-05 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/userfaultfd.h | 81 2 files changed, 82 insertions(+) create mode 100644 incl

[Qemu-devel] [PATCH 0/1] target-i386: Move icc_bridge code to PC

2015-03-05 Thread Eduardo Habkost
This removes yet another chunk of PC-specific code from target-i386/cpu.c and moves it to PC code. WIth this we get closer to being able to change target-i386 to use cpu_generic_init(). This series is based on my x86 tree, located at: https://github.com/ehabkost/qemu.git x86 Eduardo Habkost (1

[Qemu-devel] [PATCH 1/1] target-i386: Remove icc_bridge parameter from cpu_x86_create()

2015-03-05 Thread Eduardo Habkost
Instead of passing icc_bridge from the PC initialization code to cpu_x86_create(), make the PC initialization code attach the CPU to icc_bridge. The only difference here is that icc_bridge attachment will now be done after x86_cpu_parse_featurestr() is called. But this shouldn't make any differenc

Re: [Qemu-devel] [PATCH] Fix bug in implementation of SYSRET instruction for x86-64

2015-03-05 Thread John Snow
CC'ing X86 maintainers. On 03/04/2015 12:48 PM, Bill Paul wrote: Hi guys. I seem to have found a bug in the helper_systet() function in target-i386/seg_helper.c. I downloaded the Intel architecture manual from here: http://www.intel.com/content/www/us/en/processors/architectures-software-devel

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

2015-03-05 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 21/21] userfaultfd: add userfaultfd_wp mm helpers

2015-03-05 Thread Andrea Arcangeli
These helpers will be used to know if to call handle_userfault() during wrprotect faults in order to deliver the wrprotect faults to userland. Signed-off-by: Andrea Arcangeli --- include/linux/userfaultfd_k.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/userfault

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

2015-03-05 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 04/21] userfaultfd: linux/userfaultfd_k.h

2015-03-05 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 00/21] RFC: userfaultfd v3

2015-03-05 Thread Andrea Arcangeli
Hello everyone, This is a RFC for the userfaultfd syscall API v3 that addresses the feedback received for the previous v2 submit. The main change from the v2 is that MADV_USERFAULT/NOUSERFAULT disappeared (they're replaced by the UFFDIO_REGISTER/UNREGISTER ioctls). In short userfaults are now onl

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

2015-03-05 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 19/21] userfaultfd: remap_pages: UFFDIO_REMAP preparation

2015-03-05 Thread Andrea Arcangeli
remap_pages is the lowlevel mm helper needed to implement UFFDIO_REMAP. Signed-off-by: Andrea Arcangeli --- include/linux/userfaultfd_k.h | 17 ++ mm/huge_memory.c | 120 ++ mm/userfaultfd.c | 526 ++ 3 files changed, 663

[Qemu-devel] [PATCH 20/21] userfaultfd: UFFDIO_REMAP

2015-03-05 Thread Andrea Arcangeli
This remap ioctl allows to atomically move a page in or out of an userfaultfd address space. It's more expensive than "copy" (and of course more expensive than "zerofill") as it requires a TLB flush on the source range for each ioctl, which is an expensive operation on SMP. Especially if copying on

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

2015-03-05 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 | 100 ++

[Qemu-devel] [PATCH 16/21] userfaultfd: remap_pages: rmap preparation

2015-03-05 Thread Andrea Arcangeli
As far as the rmap code is concerned, rmap_pages only alters the page->mapping and page->index. It does it while holding the page lock. However there are a few places that in presence of anon pages are allowed to do rmap walks without the page lock (split_huge_page and page_referenced_anon). Those

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

2015-03-05 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 17/21] userfaultfd: remap_pages: swp_entry_swapcount() preparation

2015-03-05 Thread Andrea Arcangeli
Provide a new swapfile method for remap_pages() to verify the swap entry is mapped only in one vma before relocating the swap entry in a different virtual address. Otherwise if the swap entry is mapped in multiple vmas, when the page is swapped back in, it could get mapped in a non linear way in so

[Qemu-devel] [PATCH 12/21] userfaultfd: activate syscall

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

[Qemu-devel] [PATCH 13/21] userfaultfd: UFFDIO_COPY|UFFDIO_ZEROPAGE uAPI

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

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

2015-03-05 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 11/21] userfaultfd: buildsystem activation

2015-03-05 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 a88ac48..ba8ab62 100644 --- a/fs/Makefile +++ b/fs/Makef

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

2015-03-05 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 02/21] userfaultfd: linux/Documentation/vm/userfaultfd.txt

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

Re: [Qemu-devel] [PATCH RFC v3 24/27] COLO NIC: Implement NIC checkpoint and failover

2015-03-05 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > Signed-off-by: zhanghailiang > Signed-off-by: Gao feng > --- > include/net/colo-nic.h | 3 ++- > migration/colo.c | 22 ++ > net/colo-nic.c | 19 +++ > 3 files changed, 39 insertions(+),

Re: [Qemu-devel] [PATCH 6/6] target-i386: Call cpu_exec_init() on realize

2015-03-05 Thread Andreas Färber
Am 05.03.2015 um 17:42 schrieb Igor Mammedov: > On Thu, 5 Mar 2015 12:38:50 -0300 > Eduardo Habkost wrote: > >> To allow new code to ask the CPU classes for CPU model information and >> allow QOM properties to be queried by qmp_device_list_properties(), we >> need to be able to safely instantiat

Re: [Qemu-devel] [PATCH 6/6] target-i386: Call cpu_exec_init() on realize

2015-03-05 Thread Igor Mammedov
On Thu, 5 Mar 2015 12:38:50 -0300 Eduardo Habkost wrote: > To allow new code to ask the CPU classes for CPU model information and > allow QOM properties to be queried by qmp_device_list_properties(), we > need to be able to safely instantiate a X86CPU object without any > side-effects. > > cpu_

Re: [Qemu-devel] [PATCH 4/6] target-i386: Rename optimize_flags_init()

2015-03-05 Thread Eduardo Habkost
On Thu, Mar 05, 2015 at 05:31:39PM +0100, Igor Mammedov wrote: > On Thu, 5 Mar 2015 12:38:48 -0300 > Eduardo Habkost wrote: > > > Rename the function so that the reason for its existence is clearer: it > > does x86-specific initialization of TCG structures. > > > > Signed-off-by: Eduardo Habkos

Re: [Qemu-devel] [PATCH 3/6] cpu: Reorder cpu->as and cpu->thread_id initialization

2015-03-05 Thread Igor Mammedov
On Thu, 5 Mar 2015 12:38:47 -0300 Eduardo Habkost wrote: > Instead of initializing cpu->as and cpu->thread_id while holding > cpu_list_lock(), initialize it earlier. > > This allows the code handling cpu_index and global CPU list to be > isolated from the rest. > > Signed-off-by: Eduardo Habko

Re: [Qemu-devel] [PATCH 2/6] cpu: Initialize breakpoint/watchpoint lists on cpu_common_initfn()

2015-03-05 Thread Igor Mammedov
On Thu, 5 Mar 2015 12:38:46 -0300 Eduardo Habkost wrote: > One small step in the simplification of cpu_exec_init(). > > Signed-off-by: Eduardo Habkost Reviewed-by: Igor Mammedov > --- > exec.c| 2 -- > qom/cpu.c | 2 ++ > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git

Re: [Qemu-devel] [PATCH 4/6] target-i386: Rename optimize_flags_init()

2015-03-05 Thread Igor Mammedov
On Thu, 5 Mar 2015 12:38:48 -0300 Eduardo Habkost wrote: > Rename the function so that the reason for its existence is clearer: it > does x86-specific initialization of TCG structures. > > Signed-off-by: Eduardo Habkost > --- > target-i386/cpu.c | 2 +- > target-i386/cpu.h | 2 +-

[Qemu-devel] [PATCH 1/6] cpu: No need to zero-initialize numa_node

2015-03-05 Thread Eduardo Habkost
QOM objects are already zero-filled when instantiated, there's no need to explicitly set numa_node to 0. Signed-off-by: Eduardo Habkost --- exec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/exec.c b/exec.c index c85321a..3a61e51 100644 --- a/exec.c +++ b/exec.c @@ -542,7 +542,6 @@ void c

Re: [Qemu-devel] [PATCH 1/6] cpu: No need to zero-initialize numa_node

2015-03-05 Thread Igor Mammedov
On Thu, 5 Mar 2015 12:38:45 -0300 Eduardo Habkost wrote: > QOM objects are already zero-filled when instantiated, there's no need > to explicitly set numa_node to 0. > > Signed-off-by: Eduardo Habkost Reviewed-by: Igor Mammedov > --- > exec.c | 1 - > 1 file changed, 1 deletion(-) > > diff

Re: [Qemu-devel] [PATCH v4 4/5] target-i386: Move APIC ID compatibility code to pc.c

2015-03-05 Thread Andreas Färber
Am 05.03.2015 um 14:37 schrieb Eduardo Habkost: > On Thu, Mar 05, 2015 at 01:32:02AM +0100, Andreas Färber wrote: >> Am 04.03.2015 um 03:13 schrieb Eduardo Habkost: >>> The APIC ID compatibility code is required only for PC, and now that >>> x86_cpu_initfn() doesn't use x86_cpu_apic_id_from_index()

[Qemu-devel] [PATCH 3/6] cpu: Reorder cpu->as and cpu->thread_id initialization

2015-03-05 Thread Eduardo Habkost
Instead of initializing cpu->as and cpu->thread_id while holding cpu_list_lock(), initialize it earlier. This allows the code handling cpu_index and global CPU list to be isolated from the rest. Signed-off-by: Eduardo Habkost --- exec.c | 9 + 1 file changed, 5 insertions(+), 4 deletion

  1   2   3   >