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 mar...@redhat.com --- hw/i386/acpi-build.c | 78 1 file changed, 78 insertions(+) diff --git a/hw/i386/acpi-build.c

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; + +

[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

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); looks wrong, later in

[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 gang.chen.5...@gmail.com --- linux-user/syscall_defs.h | 38 ++ 1 file changed, 34

[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 gang.chen.5...@gmail.com --- linux-user/syscall.c | 50 +- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git

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 *memcg;

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 aarca...@redhat.com 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.

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.

[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 gang.chen.5...@gmail.com --- linux-user/tilegx/syscall.h| 80 linux-user/tilegx/syscall_nr.h | 278

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_pmd,

[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 gang.chen.5...@gmail.com --- configure | 3 +

[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 gang.chen.5...@gmail.com --- linux-user/tilegx/target_cpu.h | 35 +++ linux-user/tilegx/target_signal.h | 28 ++ linux-user/tilegx/target_structs.h |

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 according

[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 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 aarca...@redhat.com --- include/uapi/linux/userfaultfd.h | 27 ++- 1 file changed, 26

[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 hpous...@reactos.org --- hw/dma/rc4030.c | 154

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

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau hpous...@reactos.org --- 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 @@

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

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Laurent Vivier laur...@vivier.eu Signed-off-by: Hervé Poussineau hpous...@reactos.org --- 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

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

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Laurent Vivier laur...@vivier.eu Signed-off-by: Hervé Poussineau hpous...@reactos.org --- hw/mips/mips_jazz.c| 12 +-- hw/net/dp8393x.c | 83 +--- include/hw/mips/mips.h |5 --- 3 files changed, 67 insertions(+), 33

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

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau hpous...@reactos.org --- 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

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

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau hpous...@reactos.org --- 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 +++

[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

[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 hpous...@reactos.org --- hw/dma/rc4030.c| 14

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 mar...@redhat.com --- hw/i386/acpi-build.c | 78 1 file changed, 78 insertions(+) diff

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

2015-03-05 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau hpous...@reactos.org --- 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 +++

[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 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 mar...@redhat.com --- hw/pci/pci_bus.c | 7 +++ include/hw/pci/pci_bus.h | 6 ++ include/sysemu/sysemu.h | 1 + 3 files changed, 14

[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 marce...@redhat.com Refactoring it as a method of PCIBusClass will allow different implementations for subclasses. Signed-off-by: Marcel Apfelbaum mar...@redhat.com --- hw/i386/kvm/pci-assign.c | 1 + hw/pci/pci.c | 7 --- hw/pci/pci_bus.c | 10

[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

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 mar...@redhat.com --- hw/i386/acpi-build.c | 78

[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 stefa...@redhat.com ---

[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

[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 t...@netbsd.org --- 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 ---

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 and...@xdel.ru 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

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 chen.fan.f...@cn.fujitsu.com 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

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 dgilb...@redhat.com 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

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 zhang.zhanghaili...@huawei.com Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- include/net/colo-nic.h | 3 ++- migration/colo.c | 22

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 ehabk...@redhat.com wrote: One small step in the simplification of cpu_exec_init(). Signed-off-by: Eduardo Habkost ehabk...@redhat.com Reviewed-by: Igor Mammedov imamm...@redhat.com --- exec.c| 2 -- qom/cpu.c | 2 ++ 2 files

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 ehabk...@redhat.com 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:

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 ehabk...@redhat.com 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

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 ehabk...@redhat.com 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

[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 ehabk...@redhat.com --- 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 @@

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 ehabk...@redhat.com 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 ehabk...@redhat.com --- target-i386/cpu.c | 2 +-

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 ehabk...@redhat.com wrote: Rename the function so that the reason for its existence is clearer: it does x86-specific initialization of TCG structures. Signed-off-by:

[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 only

[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 aarca...@redhat.com --- fs/userfaultfd.c | 100

[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 aarca...@redhat.com --- include/linux/userfaultfd_k.h | 17 ++ mm/huge_memory.c | 120 ++ mm/userfaultfd.c | 526 ++

[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 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

[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 aarca...@redhat.com --- include/linux/userfaultfd_k.h | 79 +++ 1 file changed, 79 insertions(+) create mode 100644

[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

[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 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 aarca...@redhat.com --- include/linux/userfaultfd_k.h | 10 ++ 1 file changed, 10 insertions(+) diff --git

[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 aarca...@redhat.com --- include/linux/userfaultfd_k.h | 6 + mm/Makefile

[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

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:

[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 aarca...@redhat.com --- Documentation/ioctl/ioctl-number.txt | 1 + include/uapi/linux/userfaultfd.h | 81 2 files changed, 82 insertions(+)

[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 aarca...@redhat.com --- 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

[Qemu-devel] [PATCH 02/21] userfaultfd: linux/Documentation/vm/userfaultfd.txt

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

[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 aarca...@redhat.com --- include/linux/mm.h | 2 +- mm/madvise.c

[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 aarca...@redhat.com --- fs/Makefile | 1 + init/Kconfig | 11 +++ 2 files changed, 12 insertions(+) diff --git a/fs/Makefile b/fs/Makefile index a88ac48..ba8ab62 100644 ---

[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 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 aarca...@redhat.com --- include/uapi/linux/userfaultfd.h | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/userfaultfd.h

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

2015-03-05 Thread Andrea Arcangeli
This activates the userfaultfd syscall. Signed-off-by: Andrea Arcangeli aarca...@redhat.com --- 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 +

[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

[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 aarca...@redhat.com --- include/linux/wait.h | 5 +++-- kernel/sched/wait.c | 7 ---

[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

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 +

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 aarca...@redhat.com 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

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 Target

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 doesn't know

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. Previously,

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

2015-03-05 Thread Aneesh Kumar K.V
Michael Tokarev m...@tls.msk.ru 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

Re: [Qemu-devel] [PATCH 2/2] virtio_blk: fix comment for virtio 1.0

2015-03-05 Thread Michael S. Tsirkin
On Mon, Mar 02, 2015 at 10:45:37AM +1030, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: Fix up comment to match virtio 1.0 logic: virtio_blk_outhdr isn't the first elements anymore, the only requirement is that it comes first in the s/g list. Signed-off-by: Michael

Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/9] arm: fix memory leak

2015-03-05 Thread Markus Armbruster
Gonglei arei.gong...@huawei.com writes: On 2015/3/4 21:16, Michael Tokarev wrote: [...] And a much more general solution is to actually test patches before submitting them. You obviously did not test this series, having 3 errors in 9 patches, ie, 1/3 of your patches does not work...

[Qemu-devel] [PULL v3 00/45] Trivial patches for 2015-03-04

2015-03-05 Thread Michael Tokarev
And here's Yet Another pull request, dropping one more patch (microblaze: fix memory leak) which was broken and escaped my testing coverage. I left the tag/subject intact, and again, wont include all the individual patches, which is the same set as in the original pull request minus 2 patches.

Re: [Qemu-devel] [PATCH v5 01/45] Start documenting how postcopy works.

2015-03-05 Thread Dr. David Alan Gilbert
* David Gibson (da...@gibson.dropbear.id.au) wrote: On Wed, Feb 25, 2015 at 04:51:24PM +, Dr. David Alan Gilbert (git) wrote: From: Dr. David Alan Gilbert dgilb...@redhat.com Signed-off-by: Dr. David Alan Gilbert dgilb...@redhat.com --- docs/migration.txt | 189

Re: [Qemu-devel] QEMU etc/e820 and fw_cfg

2015-03-05 Thread Gerd Hoffmann
On Mi, 2015-03-04 at 19:12 +, Gordan Bobic wrote: On 2015-03-04 13:20, Gerd Hoffmann wrote: On Di, 2015-03-03 at 10:32 +, Gordan Bobic wrote: I need to pass a custom e820 map to a virtual machine for troubleshooting purposes and working around IOMMU hardware bugs. I have

Re: [Qemu-devel] [PATCH V13 3/4] pc: add a Virtual Machine Generation ID device

2015-03-05 Thread Michael S. Tsirkin
On Thu, Mar 05, 2015 at 01:51:26PM +1100, David Gibson wrote: On Tue, 3 Mar 2015 12:06:05 +0100 Igor Mammedov imamm...@redhat.com wrote: On Tue, 3 Mar 2015 12:03:26 +1100 David Gibson dgib...@redhat.com wrote: On Mon, 2 Mar 2015 22:06:22 +0100 Michael S. Tsirkin m...@redhat.com

[Qemu-devel] [PATCH v3 2/2] spapr: override default ram size 1GB

2015-03-05 Thread Nikunj A Dadhania
Signed-off-by: Nikunj A Dadhania nik...@linux.vnet.ibm.com --- hw/ppc/spapr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 23cde20..c71ee4b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -96,6 +96,7 @@ typedef struct sPAPRMachineState

[Qemu-devel] GICv3/GIC-500

2015-03-05 Thread Shlomo Pongratz
Hi, I'm trying to implement GICv3 (actually GIC-500) in order to support more than 8 cores for ARM64. Up to 24 cores I didn't notice any significant problems (just slow boot) but with 64 or 32 cores the Linux kernel is usually got stuck, seldom it completes the boot. When examining the

[Qemu-devel] [PATCH v3 1/2] machine: add default_ram_size to machine class

2015-03-05 Thread Nikunj A Dadhania
Machines types can have different requirement for default ram size. Introduce a member in the machine class and set the current default_ram_size to 128MB. For QEMUMachine types override the value during the registration of the machine and for MachineClass introduce the generic class init setting

[Qemu-devel] [PATCH v3 0/2] Introduce default ram size in MachineClass

2015-03-05 Thread Nikunj A Dadhania
Current DEFAULT_RAM_SIZE(128MB) enforced by QEMU would not work for all machines. Introduce a default_ram_size as part of MachineClass. The below patches has following behaviour: 1) If the user does not provide -m option, machine's default ram size will be picked. 2) In case the user

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

2015-03-05 Thread Eduardo Habkost
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 ehabk...@redhat.com --- target-i386/cpu.c | 2 +- target-i386/cpu.h | 2 +- target-i386/translate.c | 2 +- 3 files changed, 3

[Qemu-devel] [PATCH v5 1/2] machine: add default_ram_size to machine class

2015-03-05 Thread Nikunj A Dadhania
Machines types can have different requirement for default ram size. Introduce a member in the machine class and set the current default_ram_size to 128MB. For QEMUMachine types override the value during the registration of the machine and for MachineClass introduce the generic class init setting

Re: [Qemu-devel] [PULL 3/7] qxl: refactor rounding up to a nearest power of 2

2015-03-05 Thread Radim Krčmář
2015-03-05 10:52+0100, Markus Armbruster: Gerd Hoffmann kra...@redhat.com writes: From: Radim Krčmář rkrc...@redhat.com We already have pow2floor, mirror it and use instead of a function with similar results (same in used domain), to clarify our intent. Signed-off-by: Radim Krčmář

Re: [Qemu-devel] [PATCH 2/3] block: Add QMP support for streaming to an intermediate layer

2015-03-05 Thread Alberto Garcia
On Thu, Mar 05, 2015 at 03:09:58PM +0100, Kevin Wolf wrote: { 'command': 'block-stream', - 'data': { 'device': 'str', '*base': 'str', '*backing-file': 'str', -'*speed': 'int', '*on-error': 'BlockdevOnError' } } + 'data': { 'device': 'str', '*base': 'str', '*top': 'str', +

[Qemu-devel] [PATCH v3 for-2.3 18/24] hw/pci: implement iteration over multiple host bridges

2015-03-05 Thread Marcel Apfelbaum
From: Marcel Apfelbaum marce...@redhat.com Signed-off-by: Marcel Apfelbaum mar...@redhat.com --- hw/pci/pci.c | 8 include/hw/pci/pci_host.h | 4 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 53598bd..f0cf752 100644

[Qemu-devel] [PATCH v3 for-2.3 19/24] hw/pci: introduce PCI Expander Bridge (PXB)

2015-03-05 Thread Marcel Apfelbaum
From: Marcel Apfelbaum marce...@redhat.com PXB is a light-weight host bridge whose purpose is to enable the main host bridge to support multiple PCI root buses. As oposed to PCI-2-PCI bridge's secondary bus, PXB's bus is a primary bus and can be associated with a NUMA node (different from the

[Qemu-devel] [PATCH v3 for-2.3 11/24] hw/acpi: add _CRS method for extra root busses

2015-03-05 Thread Marcel Apfelbaum
Save the IO/mem/bus numbers ranges assigned to the extra root busses to be removed from the root bus 0 range. Signed-off-by: Marcel Apfelbaum mar...@redhat.com --- hw/i386/acpi-build.c | 149 +++ 1 file changed, 149 insertions(+) diff --git

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

2015-03-05 Thread Eduardo Habkost
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_exec_init() has lots of side-effects on global QEMU state, move it to

[Qemu-devel] [PATCH v3 for-2.3 12/24] hw/acpi: remove from root bus 0 the crs resources used by other busses.

2015-03-05 Thread Marcel Apfelbaum
If multiple root busses are used, root bus 0 cannot use all the pci holes ranges. Remove the IO/mem ranges used by the other primary busses. Signed-off-by: Marcel Apfelbaum mar...@redhat.com --- hw/i386/acpi-build.c | 84 1 file changed, 72

[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 ehabk...@redhat.com --- exec.c | 9 + 1 file changed, 5

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 ehabk...@redhat.com 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 ehabk...@redhat.com Reviewed-by: Igor Mammedov imamm...@redhat.com ---

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 zhang.zhanghaili...@huawei.com Signed-off-by: Gao feng gaof...@cn.fujitsu.com --- include/net/colo-nic.h | 3 ++- migration/colo.c | 22 ++ net/colo-nic.c | 19

  1   2   3   >