Re: [PATCH v4] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Xiao Guangrong
On 12/15/2011 02:53 PM, Liu ping fan wrote: +struct kvm_vcpu *kvm_vcpu_get(struct kvm_vcpu *vcpu) +{ + if (vcpu == NULL) + return NULL; + if (atomic_add_unless(vcpu-refcount, 1, 0)) Why do not use atomic_inc()? Also, i think a memory barrier is needed after

Re: [PATCH v3] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Gleb Natapov
On Thu, Dec 15, 2011 at 11:21:37AM +0800, Liu ping fan wrote: On Tue, Dec 13, 2011 at 7:36 PM, Marcelo Tosatti mtosa...@redhat.com wrote: On Mon, Dec 12, 2011 at 10:41:23AM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only

Re: [PATCH v4] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Xiao Guangrong
On 12/15/2011 04:25 PM, Xiao Guangrong wrote: On 12/15/2011 02:53 PM, Liu ping fan wrote: +struct kvm_vcpu *kvm_vcpu_get(struct kvm_vcpu *vcpu) +{ + if (vcpu == NULL) + return NULL; + if (atomic_add_unless(vcpu-refcount, 1, 0)) Why do not use atomic_inc()? Also,

Re: [PATCH v3] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Liu ping fan
2011/12/15 Gleb Natapov g...@redhat.com: On Thu, Dec 15, 2011 at 11:21:37AM +0800, Liu ping fan wrote: On Tue, Dec 13, 2011 at 7:36 PM, Marcelo Tosatti mtosa...@redhat.com wrote: On Mon, Dec 12, 2011 at 10:41:23AM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com

Re: [PATCH v3] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Gleb Natapov
On Thu, Dec 15, 2011 at 05:06:09PM +0800, Liu ping fan wrote: 2011/12/15 Gleb Natapov g...@redhat.com: On Thu, Dec 15, 2011 at 11:21:37AM +0800, Liu ping fan wrote: On Tue, Dec 13, 2011 at 7:36 PM, Marcelo Tosatti mtosa...@redhat.com wrote: On Mon, Dec 12, 2011 at 10:41:23AM +0800, Liu

Re: [PATCH v4] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Gleb Natapov
On Thu, Dec 15, 2011 at 12:28:48PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu's destruction before kvm instance, so vcpu MUST and CAN be destroyed before kvm's destroy. I

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-15 Thread Avi Kivity
On 12/14/2011 07:58 PM, Eric B Munson wrote: I don't think you should see a guest softlockup if the host is overloaded. Nor should you see it due to a long live migration pause, or STOP/CONT. You should see a guest softlockup if it is spinning due to a guest bug, and not for any other

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-15 Thread Avi Kivity
On 12/14/2011 08:21 PM, Marcelo Tosatti wrote: On Wed, Dec 14, 2011 at 04:39:56PM +0200, Avi Kivity wrote: On 12/14/2011 02:16 PM, Marcelo Tosatti wrote: Having this controlled from userspace means it doesn't work for SIGSTOP or for long scheduling delays. What about doing this

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Carsten Otte
New version below. Changes: - __pmdp_for_addr and ptep_for_addr now take a vma as argument - check if a vma exists has moved to gmap_fault and kvm_s390_keyop - kvm_s390_keyop verifies that a vma is writable so that it's safe to set the SWC bit Subject: [PATCH] kvm-s390: storage key interface

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-15 Thread Jan Kiszka
On 2011-12-12 17:51, Jan Kiszka wrote: On 2011-12-12 17:37, Marcelo Tosatti wrote: On Thu, Dec 08, 2011 at 12:52:19PM +0100, Jan Kiszka wrote: Changes in v4: - rebased of current uq/master - fixed stupid bugs that broke bisectability and user space irqchip mode - integrated NMI-over-LINT1

[PATCH] KVM: drop bsp_vcpu pointer from kvm struct

2011-12-15 Thread Gleb Natapov
Drop bsp_vcpu pointer from kvm struct since its only use is incorrect anyway. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index cac4746..b6a7353 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c @@ -262,9 +262,10 @@ int

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-15 Thread Avi Kivity
On 12/15/2011 12:33 PM, Jan Kiszka wrote: Any thoughts on the qemu-kvm merge plan? Sounds painful. Pain will be where the existing qemu-kvm extensions collide with these refactored upstream devices (backend/frontend split specifically). That's where we have to merge very carefully.

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-15 Thread Avi Kivity
On 12/08/2011 01:34 PM, Amit Shah wrote: On (Mon) 05 Dec 2011 [15:18:59], Eric B Munson wrote: When a guest kernel is stopped by the host hypervisor it can look like a soft lockup to the guest kernel. This false warning can mask later soft lockup warnings which may be real. This patch

Re: [PATCH v4 00/15] uq/master: Introduce basic irqchip support

2011-12-15 Thread Jan Kiszka
On 2011-12-15 12:54, Avi Kivity wrote: On 12/15/2011 12:33 PM, Jan Kiszka wrote: Any thoughts on the qemu-kvm merge plan? Sounds painful. Pain will be where the existing qemu-kvm extensions collide with these refactored upstream devices (backend/frontend split specifically). That's where we

[PATCH] KVM: x86: Fix build breakage due to anonymous field initialization

2011-12-15 Thread Jan Kiszka
Not all compilers accept anonymous field initialization, e.g. gcc 4.5.1. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/pmu.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index 061a03f..7aad544 100644 ---

Re: [PATCH] KVM: x86: Fix build breakage due to anonymous field initialization

2011-12-15 Thread Peter Zijlstra
On Thu, 2011-12-15 at 13:04 +0100, Jan Kiszka wrote: Not all compilers accept anonymous field initialization, e.g. gcc 4.5.1. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/pmu.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

[PATCH 1/2] kvm tools: Fix rootfs name resolving when specified with image

2011-12-15 Thread Sasha Levin
Fix the case when using a rootfs combined with a virtio-blk disk. Also, simplify custon rootfs name lookup. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/builtin-run.c | 18 ++ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git

[PATCH 2/2] kvm tools: Submit multiple virtio-blk requests in parallel

2011-12-15 Thread Sasha Levin
When using AIO, submit all requests which exists in the vring in a single io_submit instead of one io_submit for each descriptor. Benchmarks: Short version: 15%+ increase in IOPS, small increase in BW. Read IOPS: Before: vda: ios=291792/0, merge=0/0, ticks=35229/0, in_queue=31025, util=61.30%

Re: [PATCH] KVM: x86: Fix build breakage due to anonymous field initialization

2011-12-15 Thread Jan Kiszka
On 2011-12-15 13:08, Peter Zijlstra wrote: On Thu, 2011-12-15 at 13:04 +0100, Jan Kiszka wrote: Not all compilers accept anonymous field initialization, e.g. gcc 4.5.1. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/pmu.c |3 ++- 1 files changed, 2 insertions(+), 1

[PATCH v5 01/16] msi: Generalize msix_supported to msi_supported

2011-12-15 Thread Jan Kiszka
Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but MSI support came after MSI-X. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/msi.c |8 hw/msi.h |2 ++ hw/msix.c |9

[PATCH v5 16/16] kvm: Arm in-kernel irqchip support

2011-12-15 Thread Jan Kiszka
Make the basic in-kernel irqchip support selectable via -machine ...,kernel_irqchip=on. Leave it off by default until it can fully replace user space models. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- qemu-config.c |4 qemu-options.hx |5 - 2 files changed, 8

[PATCH v5 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-15 Thread Jan Kiszka
Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into these models, and maintain IRQ routes. Routing is optional and depends on the host arch supporting KVM_CAP_IRQ_ROUTING. When it's not available on x86, we looe the HPET as we can't route GSI0 to IOAPIC pin 2.

[PATCH v5 13/16] kvm: x86: Add user space part for in-kernel APIC

2011-12-15 Thread Jan Kiszka
This introduces the alternative APIC backend which makes use of KVM's in-kernel device model. External NMI injection via LINT1 is emulated by checking the current state of the in-kernel APIC, only injecting a NMI into the VCPU if LINT1 is unmasked and configured to DM_NMI. MSI is not yet

[PATCH v5 04/16] apic: Inject external NMI events via LINT1

2011-12-15 Thread Jan Kiszka
On real hardware, NMI button events are injected via the LINT1 line of the APICs. E.g. kdump expect this wiring and gets upset if the per-APIC LINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that should not receive them. Change the APIC emulation code to reflect this. Based on

[PATCH v5 08/16] i8259: Introduce backend/frontend infrastructure for KVM reuse

2011-12-15 Thread Jan Kiszka
Analogously to the APIC, we will reuse some parts of the user space i8259 model for KVM. Again, we create a PIC backend infrastructure and provide hooks for init, reset, and vmload/save. This also introduces a common helper to instantiate a single i8259 chip from the cascade- creating i8259_init

[PATCH v5 15/16] kvm: x86: Add user space part for in-kernel IOAPIC

2011-12-15 Thread Jan Kiszka
This introduces the KVM-accelerated IOAPIC backend and extends the IRQ routing setup by the 0-2 redirection when needed. The IOAPIC gains a KVM-specific property that allows to define the GSI base for injecting interrupts into the kernel model. This will allow to disentangle PIC and IOAPIC pins

[PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse

2011-12-15 Thread Jan Kiszka
The KVM in-kernel APIC model will reuse parts of the user space model while providing the same frontend view to guest and most management interfaces. Introduce an APIC backend concept to encapsulate those parts that will tell user space and KVM model apart. The backend offers callback hooks for

[PATCH v5 00/16] uq/master: Introduce basic irqchip support

2011-12-15 Thread Jan Kiszka
Changes in v5: - properly introduce apic_report_irq_delivered (instead of apic_set_irq_delivered silently) - rework apic to kvm core interface according to Blue's suggestion CC: Lai Jiangshan la...@cn.fujitsu.com Jan Kiszka (16): msi: Generalize msix_supported to msi_supported kvm: Move

[PATCH v5 09/16] ioapic: Introduce backend/frontend infrastructure for KVM reuse

2011-12-15 Thread Jan Kiszka
Split up the IOAPIC analogously to APIC and i8259. KVM will share the device description, reset logic and certain init parts with the user space model. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.target |2 +- hw/ioapic.c | 130

[PATCH v5 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-15 Thread Jan Kiszka
Introduce the alternative i8259 backend that exploits KVM in-kernel acceleration. The PIIX3 initialization code is furthermore extended by KVM specific IRQ route setup. GSI injection differs in KVM mode from the user space model. As we can dispatch ISA-range IRQs to both IOAPIC and PIC inside the

[PATCH v5 07/16] apic: Open-code timer save/restore

2011-12-15 Thread Jan Kiszka
To enable migration between accelerated and non-accelerated APIC models, we will need to handle the timer saving and restoring specially and can no longer rely on the automatics of VMSTATE_TIMER. Specifically, accelerated model will not start any QEMUTimer. This patch therefore factors out the

[PATCH v5 03/16] apic: Stop timer on reset

2011-12-15 Thread Jan Kiszka
All LVTs are masked on reset, so the timer becomes ineffective. Letting it tick nevertheless is harmless, but will at least create a spurious trace event. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/apic.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

[PATCH v5 05/16] apic: Introduce apic_report_irq_delivered

2011-12-15 Thread Jan Kiszka
The in-kernel i8259 and IOAPIC backends for KVM will need this, so encapsulate the shared bits. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/apic.c| 11 --- hw/apic.h|1 + trace-events |2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git

[PATCH v5 02/16] kvm: Move kvmclock into hw/kvm folder

2011-12-15 Thread Jan Kiszka
More KVM-specific devices will come, so let's start with moving the kvmclock into a dedicated folder. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.target|4 ++-- configure |1 + hw/{kvmclock.c = kvm/clock.c} |4 ++--

[PATCH v5 10/16] memory: Introduce memory_region_init_reservation

2011-12-15 Thread Jan Kiszka
Introduce a memory region type that can reserve I/O space. Such regions are useful for modeling I/O that is only handled outside of QEMU, i.e. in the context of an accelerator like KVM. Any access to such a region from QEMU is a bug, but could theoretically be triggered by guest code (DMA to

[PATCH v5 12/16] kvm: x86: Establish IRQ0 override control

2011-12-15 Thread Jan Kiszka
KVM is forced to disable the IRQ0 override when we run with in-kernel irqchip but without IRQ routing support of the kernel. Set the fwcfg value correspondingly. This aligns us with qemu-kvm. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/pc.c|3 ++- kvm-all.c |5 +

[PATCH 1/2] kvm tools: Use kernel error check functions

2011-12-15 Thread Lan Tianyu
Add compiler.h file to support using kernel error check funciotns(e.g ERR_PTR, PTR_ERR and so on). Signed-off-by: Lan Tianyu tianyu@intel.com --- tools/kvm/include/linux/compiler.h | 16 1 files changed, 16 insertions(+), 0 deletions(-) create mode 100644

[PATCH 2/2] kvm tools, qcow: Add support for growing refcount blocks

2011-12-15 Thread Lan Tianyu
This patch enables allocating new refcount blocks and so then kvm tools could expand qcow2 image much larger. Signed-off-by: Lan Tianyu tianyu@intel.com --- tools/kvm/disk/qcow.c | 111 +--- 1 files changed, 94 insertions(+), 17 deletions(-) diff

5x slower guest disk performance with virtio disk

2011-12-15 Thread Brian J. Murrell
I have a CentOS 6 host system running a CentOS 6 KVM guest and the guest seems to get about 5x slower disk throughput than the host: host $ sudo dd of=/dev/datavol/disk1 if=/dev/zero bs=1M oflag=direct count=5 5+0 records in 5+0 records out 5242880 bytes (52 GB) copied, 150.36 s,

Re: 5x slower guest disk performance with virtio disk

2011-12-15 Thread Stefan Pietsch
* Brian J. Murrell br...@interlinx.bc.ca [2011-12-15 15:28]: I have a CentOS 6 host system running a CentOS 6 KVM guest and the guest seems to get about 5x slower disk throughput than the host: host $ sudo dd of=/dev/datavol/disk1 if=/dev/zero bs=1M oflag=direct count=5 5+0 records

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Heiko Carstens
On Thu, Dec 15, 2011 at 11:28:03AM +0100, Carsten Otte wrote: New version below. Changes: - __pmdp_for_addr and ptep_for_addr now take a vma as argument - check if a vma exists has moved to gmap_fault and kvm_s390_keyop - kvm_s390_keyop verifies that a vma is writable so that it's safe to

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Christian Borntraeger
On 15/12/11 17:11, Heiko Carstens wrote: Why again is this needed? Or put in other words: what prevents a guest to change the storage key contents via sske of a page that is mapped read-only into the guest address space? As far as I can see: nothing. Interestingly I could -in theory- do some

Re: 5x slower guest disk performance with virtio disk

2011-12-15 Thread Brian J. Murrell
On 11-12-15 10:47 AM, Stefan Pietsch wrote: Did you try to set the cache of the virtio disk to none? I didn't. It was set at default in virt-manager and I suppose I just assumed that default would be reasonable. Changing to none has had a good effect indeed: host $ ssh guest dd of=/dev/vdb

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Martin Schwidefsky
On Thu, 15 Dec 2011 11:28:03 +0100 Carsten Otte co...@de.ibm.com wrote: + case KVM_S390_KEYOP_SSKE: + if (!(vma-vm_flags (VM_WRITE | VM_MAYWRITE))) { + r = -EACCES; + break; + } Unfortunately I just realized while

Re: 5x slower guest disk performance with virtio disk

2011-12-15 Thread Sasha Levin
On Thu, 2011-12-15 at 11:55 -0500, Brian J. Murrell wrote: So, about 2/3 of host speed now -- which is much better. Is 2/3 about normal or should I be looking for more? aio=native Thats the qemu setting, I'm not sure where libvirt hides that. -- Sasha. -- To unsubscribe from this list:

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Heiko Carstens
On Thu, Dec 15, 2011 at 05:49:19PM +0100, Christian Borntraeger wrote: On 15/12/11 17:11, Heiko Carstens wrote: Why again is this needed? Or put in other words: what prevents a guest to change the storage key contents via sske of a page that is mapped read-only into the guest address space?

Re: 5x slower guest disk performance with virtio disk

2011-12-15 Thread Daniel P. Berrange
On Thu, Dec 15, 2011 at 07:16:22PM +0200, Sasha Levin wrote: On Thu, 2011-12-15 at 11:55 -0500, Brian J. Murrell wrote: So, about 2/3 of host speed now -- which is much better. Is 2/3 about normal or should I be looking for more? aio=native Thats the qemu setting, I'm not sure where

Re: [PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-15 Thread Eric B Munson
On Thu, 15 Dec 2011, Avi Kivity wrote: On 12/14/2011 07:58 PM, Eric B Munson wrote: I don't think you should see a guest softlockup if the host is overloaded. Nor should you see it due to a long live migration pause, or STOP/CONT. You should see a guest softlockup if it is spinning

[PATCH 2/4 V7] Add functions to check if the host has stopped the vm

2011-12-15 Thread Eric B Munson
When a host stops or suspends a VM it will set a flag to show this. The watchdog will use these functions to determine if a softlockup is real, or the result of a suspended VM. Signed-off-by: Eric B Munson emun...@mgebm.net Cc: mi...@redhat.com Cc: h...@zytor.com Cc: a...@arndb.de Cc:

[PATCH 1/4 V7] Add flag to indicate that a vm was stopped by the host

2011-12-15 Thread Eric B Munson
This flag will be used to check if the vm was stopped by the host when a soft lockup was detected. The host will set the flag when it stops the guest. On resume, the guest will check this flag if a soft lockup is detected and skip issuing the warning. Signed-off-by: Eric B Munson

[PATCH 0/4 V7] Avoid soft lockup message when KVM is stopped by host

2011-12-15 Thread Eric B Munson
Changes from V6: Use __this_cpu_and when clearing the PVCLOCK_GUEST_STOPPED flag Changes from V5: Collapse generic check_and_clear_guest_stopped into patch 2 Include check_and_clear_guest_stopped defintion to ia64, s390, and powerpc Change check_and_clear_guest_stopped to use __get_cpu_var

[PATCH 4/4 V7] Add check for suspended vm in softlockup detector

2011-12-15 Thread Eric B Munson
A suspended VM can cause spurious soft lockup warnings. To avoid these, the watchdog now checks if the kernel knows it was stopped by the host and skips the warning if so. When the watchdog is reset successfully, clear the guest paused flag. Signed-off-by: Eric B Munson emun...@mgebm.net Cc:

[PATCH 3/4 V7] Add ioctl for KVMCLOCK_GUEST_STOPPED

2011-12-15 Thread Eric B Munson
Now that we have a flag that will tell the guest it was suspended, create an interface for that communication using a KVM ioctl. Signed-off-by: Eric B Munson emun...@mgebm.net Cc: mi...@redhat.com Cc: h...@zytor.com Cc: a...@arndb.de Cc: ry...@linux.vnet.ibm.com Cc: aligu...@us.ibm.com Cc:

Re: 5x slower guest disk performance with virtio disk

2011-12-15 Thread Brian J. Murrell
On 11-12-15 12:27 PM, Daniel P. Berrange wrote: On Thu, Dec 15, 2011 at 07:16:22PM +0200, Sasha Levin wrote: On Thu, 2011-12-15 at 11:55 -0500, Brian J. Murrell wrote: So, about 2/3 of host speed now -- which is much better. Is 2/3 about normal or should I be looking for more? aio=native

[RFT PATCH] blkio: alloc per cpu data from worker thread context( Re: kvm deadlock)

2011-12-15 Thread Vivek Goyal
On Wed, Dec 14, 2011 at 05:03:54PM +0100, Jens Axboe wrote: On 2011-12-14 14:43, Avi Kivity wrote: On 12/14/2011 02:25 PM, Marcelo Tosatti wrote: On Mon, Dec 05, 2011 at 04:48:16PM -0600, Nate Custer wrote: Hello, I am struggling with repeatable full hardware locks when running 8-12 KVM

Re: [net-next RFC PATCH 0/5] Series short description

2011-12-15 Thread Rusty Russell
On Thu, 15 Dec 2011 01:36:44 +, Ben Hutchings bhutchi...@solarflare.com wrote: On Fri, 2011-12-09 at 16:01 +1030, Rusty Russell wrote: On Wed, 7 Dec 2011 17:02:04 +, Ben Hutchings bhutchi...@solarflare.com wrote: Most multi-queue controllers could support a kind of hash-based

[PATCH] kvm tools: Make the whole guest memory mergeable

2011-12-15 Thread zanghongyong
From: Hongyong Zang zanghongy...@huawei.com If a guest's ram_size exceeds KVM_32BIT_GAP_START, the corresponding kvm tool's virtual address size should be (ram_size + KVM_32BIT_GAP_SIZE), rather than ram_size. Signed-off-by: Hongyong Zang zanghongy...@huawei.com --- tools/kvm/x86/kvm.c |4

[Qemu-devel] [PATCH] virtio-serial: Allow one MSI-X vector per virtqueue

2011-12-15 Thread zanghongyong
From: Hongyong Zang zanghongy...@huawei.com In pci_enable_msix(), the guest's virtio-serial driver tries to set msi-x with one vector per queue. But it fails and eventually all virtio-serial ports share one MSI-X vector. Because every virtio-serial port has *two* virtqueues, virtio-serial needs

Re: 5x slower guest disk performance with virtio disk

2011-12-15 Thread Simon Wilson
- Message from Brian J. Murrell br...@interlinx.bc.ca - Date: Thu, 15 Dec 2011 14:43:23 -0500 From: Brian J. Murrell br...@interlinx.bc.ca Subject: Re: 5x slower guest disk performance with virtio disk To: kvm@vger.kernel.org Cc: Sasha Levin levinsasha...@gmail.com

Re: [PATCH] kvm tools: Make the whole guest memory mergeable

2011-12-15 Thread Sasha Levin
On Fri, 2011-12-16 at 09:01 +0800, zanghongy...@huawei.com wrote: If a guest's ram_size exceeds KVM_32BIT_GAP_START, the corresponding kvm tool's virtual address size should be (ram_size + KVM_32BIT_GAP_SIZE), rather than ram_size. You're right. There are more places than just the

[PATCH 0/2] vhot-net: Use kvm_memslots instead of vhost_memory to translate GPA to HVA

2011-12-15 Thread zanghongyong
From: Hongyong Zang zanghongy...@huawei.com Vhost-net uses its own vhost_memory, which results from user space (qemu) info, to translate GPA to HVA. Since kernel's kvm structure already maintains the address relationship in its member *kvm_memslots*, these patches use kernel's kvm_memslots

[PATCH 2/2] vhost-net: Use kvm_memslots for address translation

2011-12-15 Thread zanghongyong
From: Hongyong Zang zanghongy...@huawei.com Use kvm's memslots instead of vhost_memory to traslate address from GPA to HVA. Signed-off-by: Hongyong Zang zanghongy...@huawei.com --- drivers/vhost/vhost.c | 53 ++-- 1 files changed, 20 insertions(+),

[PATCH 1/2] kvm: Introduce get_kvm_from_task

2011-12-15 Thread zanghongyong
From: Hongyong Zang zanghongy...@huawei.com This function finds the kvm structure from its corresponding user space process, such as qemu process. Signed-off-by: Hongyong Zang zanghongy...@huawei.com --- include/linux/kvm_host.h |2 +- virt/kvm/kvm_main.c | 13 + 2 files

Re: [PATCH] kvm tools: Make the whole guest memory mergeable

2011-12-15 Thread Zang Hongyong
于 2011/12/16,星期五 13:50, Sasha Levin 写道: On Fri, 2011-12-16 at 09:01 +0800, zanghongy...@huawei.com wrote: If a guest's ram_size exceeds KVM_32BIT_GAP_START, the corresponding kvm tool's virtual address size should be (ram_size + KVM_32BIT_GAP_SIZE), rather than ram_size. You're right. There

Re: [PATCH 0/2] vhot-net: Use kvm_memslots instead of vhost_memory to translate GPA to HVA

2011-12-15 Thread Takuya Yoshikawa
(2011/12/16 14:32), zanghongy...@huawei.com wrote: From: Hongyong Zangzanghongy...@huawei.com Vhost-net uses its own vhost_memory, which results from user space (qemu) info, to translate GPA to HVA. Since kernel's kvm structure already maintains the address relationship in its member

Re: [PATCH 0/2] vhot-net: Use kvm_memslots instead of vhost_memory to translate GPA to HVA

2011-12-15 Thread Sasha Levin
On Fri, 2011-12-16 at 13:32 +0800, zanghongy...@huawei.com wrote: From: Hongyong Zang zanghongy...@huawei.com Vhost-net uses its own vhost_memory, which results from user space (qemu) info, to translate GPA to HVA. Since kernel's kvm structure already maintains the address relationship in

Re: [PATCH] kvm tools: Make the whole guest memory mergeable

2011-12-15 Thread Sasha Levin
On Fri, 2011-12-16 at 15:02 +0800, Zang Hongyong wrote: 于 2011/12/16,星期五 13:50, Sasha Levin 写道: On Fri, 2011-12-16 at 09:01 +0800, zanghongy...@huawei.com wrote: If a guest's ram_size exceeds KVM_32BIT_GAP_START, the corresponding kvm tool's virtual address size should be (ram_size +

Re: [PATCH 0/2] vhot-net: Use kvm_memslots instead of vhost_memory to translate GPA to HVA

2011-12-15 Thread Zang Hongyong
于 2011/12/16,星期五 15:05, Sasha Levin 写道: On Fri, 2011-12-16 at 13:32 +0800, zanghongy...@huawei.com wrote: From: Hongyong Zangzanghongy...@huawei.com Vhost-net uses its own vhost_memory, which results from user space (qemu) info, to translate GPA to HVA. Since kernel's kvm structure already

Re: [PATCH v4] kvm: make vcpu life cycle separated from kvm instance

2011-12-15 Thread Liu ping fan
On Thu, Dec 15, 2011 at 5:10 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Dec 15, 2011 at 12:28:48PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu's destruction before kvm

Re: [PATCH 2/2] offb: Add palette hack for qemu standard vga framebuffer

2011-12-15 Thread Benjamin Herrenschmidt
On Thu, 2011-12-15 at 08:49 +0100, Andreas Färber wrote: Am 15.12.2011 00:58, schrieb Benjamin Herrenschmidt: We rename the mach64 hack to simple since that's also applicable to anything using VGA-style DAC IO ports (set to 8-bit DAC) and we use it for qemu vga. Note that this is keyed

[PATCH 0/5] Make use of hardware reference and change bits in HPT

2011-12-15 Thread Paul Mackerras
This series of patches builds on top of my previous series and modifies the Book3S HV memory management code to use the hardware reference and change bits in the guest hashed page table. This makes kvm_age_hva() more efficient, lets us implement the dirty page tracking properly (which in turn

[PATCH 3/5] KVM: PPC: Book3S HV: Use the hardware referenced bit for kvm_age_hva

2011-12-15 Thread Paul Mackerras
This uses the host view of the hardware R (referenced) bit to speed up kvm_age_hva() and kvm_test_age_hva(). Instead of removing all the relevant HPTEs in kvm_age_hva(), we now just reset their R bits if set. Also, kvm_test_age_hva() now scans the relevant HPTEs to see if any of them have R set.

[PATCH 4/5] KVM: PPC: Book3s HV: Implement get_dirty_log using hardware changed bit

2011-12-15 Thread Paul Mackerras
This changes the implementation of kvm_vm_ioctl_get_dirty_log() for Book3s HV guests to use the hardware C (changed) bits in the guest hashed page table. Since this makes the implementation quite different from the Book3s PR case, this moves the existing implementation from book3s.c to