Re: [PATCH V6 2/2] virtio-blk: Add REQ_FLUSH and REQ_FUA support to bio path

2012-08-08 Thread Asias He
On 08/07/2012 05:15 PM, Christoph Hellwig wrote: At least after review is done I really think this patch sopuld be folded into the previous one. OK. Some more comments below: @@ -58,6 +58,12 @@ struct virtblk_req struct bio *bio; struct virtio_blk_outhdr out_hdr;

Re: [PATCH V6 0/2] Improve virtio-blk performance

2012-08-08 Thread Asias He
On 08/08/2012 11:09 AM, Asias He wrote: On 08/07/2012 05:16 PM, Christoph Hellwig wrote: On Tue, Aug 07, 2012 at 04:47:13PM +0800, Asias He wrote: 1) Ramdisk device With bio-based IO path, sequential read/write, random read/write IOPS boost : 28%, 24%, 21%, 16%

[PATCH 02/15] qom: using atomic ops to re-implement object_ref

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- include/qemu/object.h |3 ++- qom/object.c | 13 + 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/qemu/object.h b/include/qemu/object.h

[PATCH 03/15] qom: introduce reclaimer to release obj

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Collect unused object and release them at caller demand. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- include/qemu/reclaimer.h | 28 ++ main-loop.c |5 qemu-tool.c |5

[PATCH 04/15] memory: MemoryRegion topology must be stable when updating

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using mem_map_lock to protect among updaters. So we can get the intact snapshot of mem topology -- FlatView radix-tree. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- exec.c |3 +++ memory.c | 22 ++

[PATCH 0/15 v2] prepare unplug out of protection of global lock

2012-08-08 Thread Liu Ping Fan
background: refer to orignal plan posted by Marcelo Tosatti, http://lists.gnu.org/archive/html/qemu-devel/2012-06/msg04315.html prev version: https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg03312.html changes v1-v2 --introduce atomic ops --introduce ref cnt for MemoryRegion --make

[PATCH 05/15] memory: introduce life_ops to MemoryRegion

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com The types of referred object by MemoryRegion are variable, ex, another mr, DeviceState, or other struct defined by drivers. So the refer/unrefer may be different by drivers. Using this ops, we can mange the backend object. Signed-off-by: Liu Ping

[PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so we can separate mr's life cycle management from refered object. When mr-ref 0-1, inc the refered object. When mr-ref 1-0, dec the refered object. The refered object can be DeviceStae, another mr, or other opaque.

[PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com If out of global lock, we will be challenged by SMP in low level, so need atomic ops. This file is heavily copied from kernel. Currently, only x86 atomic ops included, and will be extended for other arch for future. Signed-off-by: Liu Ping Fan

[PATCH 07/15] memory: inc/dec mr's ref when adding/removing from mem view

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com memory_region_{add,del}_subregion will inc/dec mr's refcnt. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- memory.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/memory.c b/memory.c index 5dc8b59..2eaa2fc

[PATCH 08/15] memory: introduce PhysMap to present snapshot of toploygy

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com PhysMap contain the flatview and radix-tree view, they are snapshot of system topology and should be consistent. With PhysMap, we can swap the pointer when updating and achieve the atomic. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com ---

[PATCH 09/15] memory: prepare flatview and radix-tree for rcu style access

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Flatview and radix view are all under the protection of pointer. And this make sure the change of them seem to be atomic! The mr accessed by radix-tree leaf or flatview will be reclaimed after the prev PhysMap not in use any longer Signed-off-by:

[PATCH 10/15] memory: change tcg related code to using PhysMap

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Change tcg code to use PhysMap. This is separated from the prev patch for review purpose. Should be merged into prev one. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- exec.c | 27 +-- 1 files changed, 21

[PATCH 11/15] lock: introduce global lock for device tree

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpus.c | 12 main-loop.h |3 +++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index b182b3d..a734b36 100644 --- a/cpus.c +++

[PATCH 12/15] qdev: using devtree lock to protect device's accessing

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com lock: qemu_device_tree_mutex competitors: --device_del(destruction of device will be postphoned until unplug ack from guest), --pci hot-unplug --iteration (qdev_reset_all) --device_add Signed-off-by: Liu Ping Fan

[PATCH 13/15] hotplug: introduce qdev_unplug_complete() to remove device from views

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com When guest confirm the removal of device, we should --unmap from MemoryRegion view --isolated from device tree view Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/acpi_piix4.c |4 ++-- hw/pci.c| 13 -

[PATCH 14/15] qom: object_unref call reclaimer

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com iohandler/bh/timer may use DeviceState when its refcnt=0, postpone the reclaimer till they have done with it. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- qom/object.c |9 - 1 files changed, 8 insertions(+), 1

[PATCH 15/15] e1000: using new interface--unmap to unplug

2012-08-08 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- hw/e1000.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 4573f13..fa71455 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1192,6

Re: [PATCH 6/8] KVM: PPC: E500: Implement MMU notifiers

2012-08-08 Thread Paul Mackerras
On Tue, Aug 07, 2012 at 12:57:14PM +0200, Alexander Graf wrote: The e500 target has lived without mmu notifiers ever since it got introduced, but fails for the user space check on them with hugetlbfs. Ironically that user space check isn't necessary any more since David Gibson's fix for the

Re: [PATCH 8/8] KVM: PPC: Add cache flush on page map

2012-08-08 Thread Alexander Graf
On 07.08.2012, at 23:01, Scott Wood scottw...@freescale.com wrote: On 08/07/2012 05:57 AM, Alexander Graf wrote: When we map a page that wasn't icache cleared before, do so when first mapping it in KVM using the same information bits as the Linux mapping logic. That way we are 100% sure

Re: [PATCH 6/8] KVM: PPC: E500: Implement MMU notifiers

2012-08-08 Thread Alexander Graf
On 08.08.2012, at 05:31, Paul Mackerras pau...@samba.org wrote: On Tue, Aug 07, 2012 at 12:57:14PM +0200, Alexander Graf wrote: The e500 target has lived without mmu notifiers ever since it got introduced, but fails for the user space check on them with hugetlbfs. Ironically that user

[PATCH V7 0/2] Improve virtio-blk performance

2012-08-08 Thread Asias He
Hi, all Changes in v7: - Using vbr-flags to trace request type - Dropped unnecessary struct virtio_blk *vblk parameter - Reuse struct virtblk_req in bio done function - Added performance data on normal SATA device and the reason why make it optional Fio test shows bio-based IO path gives the

[PATCH V7 2/2] virtio-blk: Add REQ_FLUSH and REQ_FUA support to bio path

2012-08-08 Thread Asias He
We need to support both REQ_FLUSH and REQ_FUA for bio based path since it does not get the sequencing of REQ_FUA into REQ_FLUSH that request based drivers can request. REQ_FLUSH is emulated by: A) If the bio has no data to write: 1. Send VIRTIO_BLK_T_FLUSH to device, 2. In the flush I/O

[PATCH V7 1/2] virtio-blk: Add bio-based IO path for virtio-blk

2012-08-08 Thread Asias He
This patch introduces bio-based IO path for virtio-blk. Compared to request-based IO path, bio-based IO path uses driver provided -make_request_fn() method to bypasses the IO scheduler. It handles the bio to device directly without allocating a request in block layer. This reduces the IO path in

Re: KVM segfaults with 3.5 while installing ubuntu 12.04

2012-08-08 Thread Stefan Hajnoczi
On Wed, Aug 08, 2012 at 07:51:07AM +0200, Stefan Priebe wrote: Any news? Was this applied upstream? Kevin is ill. He has asked me to review and test patches in his absence. When he gets back later this week this will get picked up (and included in QEMU 1.2). Here is the tree, it includes this

Re: [Qemu-devel] [PATCH 2/5] s390: Virtual channel subsystem support.

2012-08-08 Thread Cornelia Huck
On Tue, 7 Aug 2012 21:00:59 + Blue Swirl blauwir...@gmail.com wrote: diff --git a/hw/s390x/css.c b/hw/s390x/css.c new file mode 100644 index 000..7941c44 --- /dev/null +++ b/hw/s390x/css.c @@ -0,0 +1,440 @@ +/* + * Channel subsystem base support. + * + * Copyright

Re: [Qemu-devel] [PATCH 2/5] s390: Virtual channel subsystem support.

2012-08-08 Thread Peter Maydell
On 7 August 2012 15:52, Cornelia Huck cornelia.h...@de.ibm.com wrote: +static void sch_handle_clear_func(SubchDev *sch) +{ +struct pmcw *p = sch-curr_status.pmcw; +struct scsw *s = sch-curr_status.scsw; +int path; + +/* Path management: In our simple css, we always choose

Re: [Qemu-devel] [PATCH 3/5] s390: Add new channel I/O based virtio transport.

2012-08-08 Thread Cornelia Huck
On Tue, 7 Aug 2012 20:47:22 + Blue Swirl blauwir...@gmail.com wrote: diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c new file mode 100644 index 000..8a90c3a --- /dev/null +++ b/hw/s390x/virtio-ccw.c @@ -0,0 +1,962 @@ +/* + * virtio ccw target implementation +

Re: KVM segfaults with 3.5 while installing ubuntu 12.04

2012-08-08 Thread Stefan Priebe
ah OK - thanks. Will there be a fixed 1.1.2 as well? Stefan Am 08.08.2012 10:06, schrieb Stefan Hajnoczi: On Wed, Aug 08, 2012 at 07:51:07AM +0200, Stefan Priebe wrote: Any news? Was this applied upstream? Kevin is ill. He has asked me to review and test patches in his absence. When he

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Avi Kivity
On 08/08/2012 12:09 AM, Benjamin Herrenschmidt wrote: On Tue, 2012-08-07 at 16:13 +0300, Avi Kivity wrote: Peter has started to fix up this naming mess in qemu. I guess we should do the same for the kernel (except for ABIs) and document it, because it keeps generating confusion. Ok so

Re: [Qemu-devel] [PATCH 2/5] s390: Virtual channel subsystem support.

2012-08-08 Thread Cornelia Huck
On Wed, 8 Aug 2012 09:27:32 +0100 Peter Maydell peter.mayd...@linaro.org wrote: On 7 August 2012 15:52, Cornelia Huck cornelia.h...@de.ibm.com wrote: +static void sch_handle_clear_func(SubchDev *sch) +{ +struct pmcw *p = sch-curr_status.pmcw; +struct scsw *s =

Re: [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 08:25, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com If out of global lock, we will be challenged by SMP in low level, so need atomic ops. This file is heavily copied from kernel. Then it cannot be GPLv2 _or later_. Please use the version that I

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Avi Kivity
On 08/08/2012 03:49 AM, David Gibson wrote: We never have irqchip in kernel (because we haven't written that yet) but we still sleep in-kernel for CEDE. I haven't spotted any problem with that, but now I'm wondering if there is one, since x86 don't do it in what seems like the analogous

Re: [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com If out of global lock, we will be challenged by SMP in low level, so need atomic ops. This file is heavily copied from kernel. Currently, only x86 atomic ops included, and will be extended for other

Re: [PATCH 03/15] qom: introduce reclaimer to release obj

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Collect unused object and release them at caller demand. Please explain the motivation for this patch. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this

Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Wei-Ren Chen
I propose we use gcc builtins. We get automatic architecture support, and tuning for newer processors if the user so chooses. http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html In May 2031 we can switch to C11 atomics. Maybe 2013? -- Wei-Ren Chen (陳韋任)

Re: [PATCH 03/15] qom: introduce reclaimer to release obj

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 11:05, Avi Kivity ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Collect unused object and release them at caller demand. Please explain the motivation for this patch. It's poor man RCU, I think? Paolo -- To unsubscribe from this list: send the line

Re: [PATCH v8] kvm: notify host when the guest is panicked

2012-08-08 Thread Andrew Jones
On Wed, Aug 08, 2012 at 10:43:01AM +0800, Wen Congyang wrote: diff --git a/Documentation/virtual/kvm/pv_event.txt b/Documentation/virtual/kvm/pv_event.txt new file mode 100644 index 000..0ebc890 --- /dev/null +++ b/Documentation/virtual/kvm/pv_event.txt @@ -0,0 +1,32 @@ +The KVM

Re: [PATCH 04/15] memory: MemoryRegion topology must be stable when updating

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using mem_map_lock to protect among updaters. So we can get the intact snapshot of mem topology -- FlatView radix-tree. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- exec.c |3

Re: [PATCH 03/15] qom: introduce reclaimer to release obj

2012-08-08 Thread Avi Kivity
On 08/08/2012 12:07 PM, Paolo Bonzini wrote: Il 08/08/2012 11:05, Avi Kivity ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Collect unused object and release them at caller demand. Please explain the motivation for this patch. It's poor man RCU, I think? I thought that

Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Avi Kivity
On 08/08/2012 12:05 PM, 陳韋任 (Wei-Ren Chen) wrote: I propose we use gcc builtins. We get automatic architecture support, and tuning for newer processors if the user so chooses. http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html In May 2031 we can switch to C11 atomics.

Re: [PATCH 05/15] memory: introduce life_ops to MemoryRegion

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The types of referred object by MemoryRegion are variable, ex, another mr, DeviceState, or other struct defined by drivers. So the refer/unrefer may be different by drivers. Using this ops, we can

Re: [PATCH 06/15] memory: use refcnt to manage MemoryRegion

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using refcnt for mr, so we can separate mr's life cycle management from refered object. When mr-ref 0-1, inc the refered object. When mr-ref 1-0, dec the refered object. The refered object can

Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Peter Maydell
On 8 August 2012 07:25, Liu Ping Fan qemul...@gmail.com wrote: +static inline void atomic_sub(int i, Atomic *v) +{ +asm volatile(lock; subl %1,%0 + : +m (v-counter) + : ir (i)); +} NAK. We don't want random inline assembly implementations of locking primitives in

Re: [PATCH v8] kvm: notify host when the guest is panicked

2012-08-08 Thread Wen Congyang
At 08/08/2012 05:12 PM, Andrew Jones Wrote: On Wed, Aug 08, 2012 at 10:43:01AM +0800, Wen Congyang wrote: diff --git a/Documentation/virtual/kvm/pv_event.txt b/Documentation/virtual/kvm/pv_event.txt new file mode 100644 index 000..0ebc890 --- /dev/null +++

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Benjamin Herrenschmidt
On Wed, 2012-08-08 at 11:52 +0300, Avi Kivity wrote: So for now I'm just doing my own version of CREATE_IRQCHIP to create it and KVM_INTERRUPT to trigger the various interrupts. None of the mapping stuff (which we really don't need). You mean KVM_IRQ_LINE. KVM_INTERRUPT is a synchronous

Re: [PATCH 08/15] memory: introduce PhysMap to present snapshot of toploygy

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com PhysMap contain the flatview and radix-tree view, they are snapshot of system topology and should be consistent. With PhysMap, we can swap the pointer when updating and achieve the atomic.

Re: [Qemu-devel] [PATCH 12/15] qdev: using devtree lock to protect device's accessing

2012-08-08 Thread Peter Maydell
On 8 August 2012 07:25, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com lock: qemu_device_tree_mutex Looking at where it's used, this doesn't seem to have anything to do with device trees (ie dtb, see www.devicetree.org) : poorly named lock? -- PMM --

Re: [PATCH 03/15] qom: introduce reclaimer to release obj

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 08:25, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Collect unused object and release them at caller demand. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- include/qemu/reclaimer.h | 28 ++ main-loop.c

Re: [PATCH 14/15] qom: object_unref call reclaimer

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 08:25, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com iohandler/bh/timer may use DeviceState when its refcnt=0, postpone the reclaimer till they have done with it. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- qom/object.c |9

Re: [PATCH 09/15] memory: prepare flatview and radix-tree for rcu style access

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Flatview and radix view are all under the protection of pointer. And this make sure the change of them seem to be atomic! The mr accessed by radix-tree leaf or flatview will be reclaimed after the

Re: [PATCH 11/15] lock: introduce global lock for device tree

2012-08-08 Thread Avi Kivity
On 08/08/2012 09:25 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Please explain the motivation. AFAICT, the big qemu lock is sufficient. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm

Re: [PATCH 11/15] lock: introduce global lock for device tree

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 08:25, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- cpus.c | 12 main-loop.h |3 +++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/cpus.c

Re: [PATCH 13/15] hotplug: introduce qdev_unplug_complete() to remove device from views

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 08:25, Liu Ping Fan ha scritto: +void qdev_unplug_complete(DeviceState *dev, Error **errp) +{ +/* isolate from mem view */ +qdev_unmap(dev); +qemu_lock_devtree(); +/* isolate from device tree */ +qdev_unset_parent(dev); +qemu_unlock_devtree(); +

Re: [PATCH 15/15] e1000: using new interface--unmap to unplug

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 08:25, Liu Ping Fan ha scritto: +static void +pci_e1000_unmap(PCIDevice *p) +{ +/* DO NOT FREE anything!until refcnt=0 */ +/* isolate from memory view */ +} At least you need to call the superclass method. Paolo static int pci_e1000_uninit(PCIDevice *dev) {

Re: [PATCH 13/15] hotplug: introduce qdev_unplug_complete() to remove device from views

2012-08-08 Thread Avi Kivity
On 08/08/2012 12:52 PM, Paolo Bonzini wrote: Il 08/08/2012 08:25, Liu Ping Fan ha scritto: +void qdev_unplug_complete(DeviceState *dev, Error **errp) +{ +/* isolate from mem view */ +qdev_unmap(dev); +qemu_lock_devtree(); +/* isolate from device tree */ +

Re: [PATCH 1/2] KVM: PPC: booke: Add watchdog emulation

2012-08-08 Thread Alexander Graf
On 07.08.2012, at 17:59, Bhushan Bharat-R65777 wrote: -Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Tuesday, August 07, 2012 3:38 PM To: Bhushan Bharat-R65777 Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; Bhushan Bharat-R65777 Subject: Re: [PATCH 1/2]

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread David Gibson
On Wed, Aug 08, 2012 at 11:58:58AM +0300, Avi Kivity wrote: On 08/08/2012 03:49 AM, David Gibson wrote: We never have irqchip in kernel (because we haven't written that yet) but we still sleep in-kernel for CEDE. I haven't spotted any problem with that, but now I'm wondering if there is

[PATCH] KVM: correctly detect APIC SW state in kvm_apic_post_state_restore()

2012-08-08 Thread Gleb Natapov
For apic_set_spiv() to track APIC SW state correctly it needs to see previous and next values of the spurious vector register, but currently memset() overwrite the old value before apic_set_spiv() get a chance to do tracking. Fix it by calling apic_set_spiv() before overwriting old value.

Re: [PATCH] KVM: x86 emulator: access GPRs on demand

2012-08-08 Thread Avi Kivity
On 08/08/2012 12:23 AM, Marcelo Tosatti wrote: @@ -281,8 +294,10 @@ struct x86_emulate_ctxt { bool rip_relative; unsigned long _eip; struct operand memop; +u32 regs_valid; /* bitmaps of registers in _regs[] that can be read */ +u32 regs_dirty; /* bitmaps of registers

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Avi Kivity
On 08/08/2012 02:59 PM, David Gibson wrote: No, you're correct. HLT could have been emulated in userspace, it just wasn't. The correct statement is that HLT was arbitrarily chosen to be emulated in userspace with the synchronous model, but the asynchronous model forced it into the kernel.

Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Stefan Hajnoczi
On Wed, Aug 8, 2012 at 10:21 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 8 August 2012 07:25, Liu Ping Fan qemul...@gmail.com wrote: +static inline void atomic_sub(int i, Atomic *v) +{ +asm volatile(lock; subl %1,%0 + : +m (v-counter) + : ir (i)); +}

Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 15:09, Stefan Hajnoczi ha scritto: NAK. We don't want random inline assembly implementations of locking primitives in QEMU, they are way too hard to keep working with all the possible host architectures we support. I spent some time a while back getting rid of the (variously

Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Peter Maydell
On 8 August 2012 14:18, Paolo Bonzini pbonz...@redhat.com wrote: Il 08/08/2012 15:09, Stefan Hajnoczi ha scritto: No need to roll our own or copy the implementation from the kernel. To some extent we need to because: 1. GCC atomics look ugly, :) do not provide rmb/wmb, and in some versions

Re: [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Paolo Bonzini
Il 08/08/2012 15:32, Peter Maydell ha scritto: 1. GCC atomics look ugly, :) do not provide rmb/wmb, and in some versions of GCC mb is known to be (wrongly) a no-op. 2. glib atomics do not provide mb/rmb/wmb either, and g_atomic_int_get/g_atomic_int_set are inefficient: they add barriers

Re: [PATCH 01/15] atomic: introduce atomic operations

2012-08-08 Thread Avi Kivity
On 08/08/2012 04:49 PM, Paolo Bonzini wrote: Il 08/08/2012 15:32, Peter Maydell ha scritto: 1. GCC atomics look ugly, :) do not provide rmb/wmb, and in some versions of GCC mb is known to be (wrongly) a no-op. 2. glib atomics do not provide mb/rmb/wmb either, and

Re: [Qemu-devel] KVM call agenda for tuesday 31

2012-08-08 Thread Andreas Färber
Am 31.01.2012 15:01, schrieb Mitsyanko Igor: On 01/31/2012 05:15 PM, Andreas Färber wrote: Am 31.01.2012 00:53, schrieb Anthony Liguori: On 01/30/2012 05:41 PM, Andreas Färber wrote: Am 30.01.2012 19:55, schrieb Juan Quintela: Please send in any agenda items you are interested in covering.

hang on reboot with 3.6-rc1

2012-08-08 Thread David Ahern
Not sure if KVM is the culprit, but it is the last line shown on the console. I have to power cycle the server to reboot. David attachment: kvm-3.6-rc1.png

Re: [kvmarm] [PATCH 5/8] KVM: Add hva_to_memslot

2012-08-08 Thread Alexander Graf
On 08.08.2012, at 06:55, Christoffer Dall wrote: On Tue, Aug 7, 2012 at 6:57 AM, Alexander Graf ag...@suse.de wrote: Architecture code might want to figure out if an hva that it gets for example via the mmu notifier callbacks actually is in guest mapped memory, and if so, in which memory

Re: [PATCH 0/8] KVM: PPC: E500: Implement MMU Notifiers

2012-08-08 Thread Alexander Graf
On 07.08.2012, at 12:57, Alexander Graf wrote: This patch set adds a very simple implementation of MMU notifiers for the e500 target. Along the way, I stumbled over a few other things that I've put into the same patch set, namely: * e500 prerequisites * icache flushing on page map

[PATCH] handle device help before accelerator set up

2012-08-08 Thread Bruce Rogers
A command line device probe using just -device ? gets processed after qemu-kvm initializes the accelerator. If /dev/kvm is not present, the accelerator check will fail (kvm is defaulted to on), which causes libvirt to not be set up to handle qemu guests. Moving the device help handling before the

Re: [Qemu-devel] [PATCH v8 5/6] introduce a new qom device to deal with panicked event

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 2:47 AM, Wen Congyang we...@cn.fujitsu.com wrote: If the target is x86/x86_64, the guest's kernel will write 0x01 to the port KVM_PV_EVENT_PORT when it is panciked. This patch introduces a new qom device kvm_pv_ioport to listen this I/O port, and deal with panicked event

Re: [Qemu-devel] [PATCH 3/5] s390: Add new channel I/O based virtio transport.

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 8:28 AM, Cornelia Huck cornelia.h...@de.ibm.com wrote: On Tue, 7 Aug 2012 20:47:22 + Blue Swirl blauwir...@gmail.com wrote: diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c new file mode 100644 index 000..8a90c3a --- /dev/null +++

Re: [Qemu-devel] [PATCH 2/5] s390: Virtual channel subsystem support.

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 8:17 AM, Cornelia Huck cornelia.h...@de.ibm.com wrote: On Tue, 7 Aug 2012 21:00:59 + Blue Swirl blauwir...@gmail.com wrote: diff --git a/hw/s390x/css.c b/hw/s390x/css.c new file mode 100644 index 000..7941c44 --- /dev/null +++ b/hw/s390x/css.c @@ -0,0

Re: [PATCH 04/15] memory: MemoryRegion topology must be stable when updating

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 6:25 AM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Using mem_map_lock to protect among updaters. So we can get the intact snapshot of mem topology -- FlatView radix-tree. Signed-off-by: Liu Ping Fan

Re: [PATCH 08/15] memory: introduce PhysMap to present snapshot of toploygy

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 6:25 AM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com PhysMap contain the flatview and radix-tree view, they are snapshot of system topology and should be consistent. With PhysMap, we can swap the pointer when updating and

Re: [PATCH 09/15] memory: prepare flatview and radix-tree for rcu style access

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 6:25 AM, Liu Ping Fan qemul...@gmail.com wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Flatview and radix view are all under the protection of pointer. And this make sure the change of them seem to be atomic! The mr accessed by radix-tree leaf or flatview will

Re: [Qemu-devel] [PATCH 2/5] s390: Virtual channel subsystem support.

2012-08-08 Thread Peter Maydell
On 8 August 2012 20:16, Blue Swirl blauwir...@gmail.com wrote: On Wed, Aug 8, 2012 at 8:17 AM, Cornelia Huck cornelia.h...@de.ibm.com wrote: On Tue, 7 Aug 2012 21:00:59 + Blue Swirl blauwir...@gmail.com wrote: Please use more descriptive names instead of acronyms, for example

Re: [Qemu-devel] [PATCH 2/5] s390: Virtual channel subsystem support.

2012-08-08 Thread Blue Swirl
On Wed, Aug 8, 2012 at 7:34 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 8 August 2012 20:16, Blue Swirl blauwir...@gmail.com wrote: On Wed, Aug 8, 2012 at 8:17 AM, Cornelia Huck cornelia.h...@de.ibm.com wrote: On Tue, 7 Aug 2012 21:00:59 + Blue Swirl blauwir...@gmail.com wrote:

Re: UIO: missing resource mapping

2012-08-08 Thread Hans J. Koch
On Wed, Jul 18, 2012 at 12:40:47PM +0200, Dominic Eschweiler wrote: Am Montag, den 16.07.2012, 23:58 +0200 schrieb Hans J. Koch: Try to hack up a patch to add generic BAR mapping to uio_pci_generic.c and post it for review. Here we go ... Thank you very much for your work. I'm really

[PATCH] kvm tools: Add initial virtio-scsi support

2012-08-08 Thread Asias He
This patch brings virito-scsi support to kvm tool. With the introduce of tcm_vhost (vhost-scsi) tcm_vhost: Initial merge for vhost level target fabric driver we can implement virito-scsi by simply having vhost-scsi to handle the SCSI command. Howto use: 1) Setup the tcm_vhost target through

Re: [PATCH 6/8] KVM: PPC: E500: Implement MMU notifiers

2012-08-08 Thread Paul Mackerras
On Tue, Aug 07, 2012 at 12:57:14PM +0200, Alexander Graf wrote: The e500 target has lived without mmu notifiers ever since it got introduced, but fails for the user space check on them with hugetlbfs. Ironically that user space check isn't necessary any more since David Gibson's fix for the

Re: [PATCH 8/8] KVM: PPC: Add cache flush on page map

2012-08-08 Thread Alexander Graf
On 07.08.2012, at 23:01, Scott Wood scottw...@freescale.com wrote: On 08/07/2012 05:57 AM, Alexander Graf wrote: When we map a page that wasn't icache cleared before, do so when first mapping it in KVM using the same information bits as the Linux mapping logic. That way we are 100% sure

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Avi Kivity
On 08/08/2012 12:09 AM, Benjamin Herrenschmidt wrote: On Tue, 2012-08-07 at 16:13 +0300, Avi Kivity wrote: Peter has started to fix up this naming mess in qemu. I guess we should do the same for the kernel (except for ABIs) and document it, because it keeps generating confusion. Ok so

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Avi Kivity
On 08/08/2012 03:49 AM, David Gibson wrote: We never have irqchip in kernel (because we haven't written that yet) but we still sleep in-kernel for CEDE. I haven't spotted any problem with that, but now I'm wondering if there is one, since x86 don't do it in what seems like the analogous

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Benjamin Herrenschmidt
On Wed, 2012-08-08 at 11:52 +0300, Avi Kivity wrote: So for now I'm just doing my own version of CREATE_IRQCHIP to create it and KVM_INTERRUPT to trigger the various interrupts. None of the mapping stuff (which we really don't need). You mean KVM_IRQ_LINE. KVM_INTERRUPT is a synchronous

Re: [PATCH 1/2] KVM: PPC: booke: Add watchdog emulation

2012-08-08 Thread Alexander Graf
On 07.08.2012, at 17:59, Bhushan Bharat-R65777 wrote: -Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Tuesday, August 07, 2012 3:38 PM To: Bhushan Bharat-R65777 Cc: kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Bhushan Bharat-R65777 Subject: Re: [PATCH

Re: [PATCH 3/3] KVM: PPC: booke: Added debug handler

2012-08-08 Thread Alexander Graf
On 08.08.2012, at 03:02, Bhushan Bharat-R65777 wrote: -Original Message- From: Wood Scott-B07421 Sent: Wednesday, August 08, 2012 2:15 AM To: Alexander Graf Cc: Bhushan Bharat-R65777; kvm-ppc@vger.kernel.org; k...@vger.kernel.org; Bhushan Bharat-R65777 Subject: Re: [PATCH

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread David Gibson
On Wed, Aug 08, 2012 at 11:58:58AM +0300, Avi Kivity wrote: On 08/08/2012 03:49 AM, David Gibson wrote: We never have irqchip in kernel (because we haven't written that yet) but we still sleep in-kernel for CEDE. I haven't spotted any problem with that, but now I'm wondering if there is

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread Avi Kivity
On 08/08/2012 02:59 PM, David Gibson wrote: No, you're correct. HLT could have been emulated in userspace, it just wasn't. The correct statement is that HLT was arbitrarily chosen to be emulated in userspace with the synchronous model, but the asynchronous model forced it into the kernel.

Re: [PATCH 0/8] KVM: PPC: E500: Implement MMU Notifiers

2012-08-08 Thread Alexander Graf
On 07.08.2012, at 12:57, Alexander Graf wrote: This patch set adds a very simple implementation of MMU notifiers for the e500 target. Along the way, I stumbled over a few other things that I've put into the same patch set, namely: * e500 prerequisites * icache flushing on page map