Re: [PATCH 3/4] KVM: x86: inject nested page faults on emulated instructions

2014-09-04 Thread Gleb Natapov
On Tue, Sep 02, 2014 at 05:13:49PM +0200, Paolo Bonzini wrote: This is required for the following patch to work correctly. If a nested page fault happens during emulation, we must inject a vmexit, not a page fault. Luckily we already have the required machinery: it is enough to return

Re: [PATCH v2 03/15] arm/arm64: KVM: refactor vgic_handle_mmio() function

2014-09-04 Thread wanghaibin
On 2014/8/21 21:06, Andre Przywara wrote: Currently we only need to deal with one MMIO region for the GIC emulation, but we soon need to extend this. Refactor the existing code to allow easier addition of different ranges without code duplication. Signed-off-by: Andre Przywara

Re: [Qemu-devel] [question] virtio-blk performance degradationhappenedwith virito-serial

2014-09-04 Thread Zhang Haoyu
If virtio-blk and virtio-serial share an IRQ, the guest operating system has to check each virtqueue for activity. Maybe there is some inefficiency doing that. AFAIK virtio-serial registers 64 virtqueues (on 31 ports + console) even if everything is unused. That could be the

Re: kvm-unit-test failures

2014-09-04 Thread Paolo Bonzini
Il 03/09/2014 20:25, Chris J Arges ha scritto: snip I'm not sure about the reason for the warp, but indeed the offset and uptime match (I'll check them against the trace tomorrow) so it's just that the VM's TSC base is not taken into account correctly. Can you gather another trace with the

[RFC][patch 3/6] KVM: s390: Add GISA support

2014-09-04 Thread frank . blaschka
From: Frank Blaschka frank.blasc...@de.ibm.com This patch adds GISA (Guest Interrupt State Area) support to s390 kvm. GISA can be used for exitless interrupts. The patch provides a set of functions for GISA related operations like accessing GISA fields or registering ISCs for alert. Exploiters of

[RFC][patch 5/6] s390: Add PCI bus support

2014-09-04 Thread frank . blaschka
From: Frank Blaschka frank.blasc...@de.ibm.com This patch implements a pci bus for s390x together with some infrastructure to generate and handle hotplug events. It also provides device configuration/unconfiguration via sclp instruction interception. Signed-off-by: Frank Blaschka

[RFC][patch 4/6] KVM: s390: Add PCI pass-through support

2014-09-04 Thread frank . blaschka
From: Frank Blaschka frank.blasc...@de.ibm.com This patch implemets PCI pass-through kernel support for s390. Design approach is very similar to the x86 device assignment. User space executes the KVM_ASSIGN_PCI_DEVICE ioctl to create a proxy instance in the kernel KVM and connect this instance to

[RFC][patch 2/6] s390: pci: export pci functions for pass-through usage

2014-09-04 Thread frank . blaschka
From: Frank Blaschka frank.blasc...@de.ibm.com This patch exports a couple of zPCI functions. The new pci pass-through driver for KVM will use this functions to enable the device with virtualization information and update the device dma translation table on the host. We add a new interface to

[RFC][patch 6/6] s390: Add PCI pass-through device support

2014-09-04 Thread frank . blaschka
From: Frank Blaschka frank.blasc...@de.ibm.com This patch adds a new device class handling s390 pci pass-through device assignment. The approach is very similar to the x86 device assignment. The device executes the KVM_ASSIGN_PCI_DEVICE ioctl to create a proxy instance in the kernel KVM and

[RFC][patch 0/6] pci pass-through support for qemu/KVM on s390

2014-09-04 Thread frank . blaschka
This set of patches implements pci pass-through support for qemu/KVM on s390. PCI support on s390 is very different from other platforms. Major differences are: 1) all PCI operations are driven by special s390 instructions 2) all s390 PCI instructions are privileged 3) PCI config and memory

[RFC][patch 1/6] s390: cio: chsc function to register GIB

2014-09-04 Thread frank . blaschka
From: Frank Blaschka frank.blasc...@de.ibm.com This patch provides a new chsc function to register/unregister a GIB (Guest Information Block). Signed-off-by: Frank Blaschka frank.blasc...@de.ibm.com --- arch/s390/include/asm/cio.h |1 drivers/s390/cio/chsc.c | 50

Re: kvm-unit-test failures

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 11:53, Paolo Bonzini ha scritto: Il 03/09/2014 20:25, Chris J Arges ha scritto: snip I'm not sure about the reason for the warp, but indeed the offset and uptime match (I'll check them against the trace tomorrow) so it's just that the VM's TSC base is not taken into account

Re: kvm-unit-test failures

2014-09-04 Thread Wanpeng Li
On Thu, Sep 04, 2014 at 01:33:10PM +0200, Paolo Bonzini wrote: Il 04/09/2014 11:53, Paolo Bonzini ha scritto: Il 03/09/2014 20:25, Chris J Arges ha scritto: snip I'm not sure about the reason for the warp, but indeed the offset and uptime match (I'll check them against the trace tomorrow) so

[PATCH v5 0/3] ivshmem: update documentation, add client/server tools

2014-09-04 Thread David Marchand
Here is a patchset containing an update on ivshmem specs documentation and importing ivshmem server and client tools. These tools have been written from scratch and are not related to what is available in nahanni repository. I put them in contrib/ directory as the qemu-doc.texi was already telling

[PATCH v5 3/3] ivshmem: add check on protocol version in QEMU

2014-09-04 Thread David Marchand
Send a protocol version as the first message from server, clients must close communication if they don't support this protocol version. Older QEMUs should be fine with this change in the protocol since they overrides their own vm_id on reception of an id associated to no eventfd. Signed-off-by:

[PATCH v5 1/3] contrib: add ivshmem client and server

2014-09-04 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz olivier.m...@6wind.com Signed-off-by: David Marchand david.march...@6wind.com ---

[PATCH v5 2/3] docs: update ivshmem device spec

2014-09-04 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand david.march...@6wind.com

[PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) forgot to add tk-xtime_sec, thus breaking kvmclock on hosts that have a reliable TSC. Add it back; and since the field boot_ns is not anymore related to the host boot-based clock, rename

Re: kvm-unit-test failures

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 14:24, Wanpeng Li ha scritto: On Thu, Sep 04, 2014 at 01:33:10PM +0200, Paolo Bonzini wrote: Il 04/09/2014 11:53, Paolo Bonzini ha scritto: Il 03/09/2014 20:25, Chris J Arges ha scritto: snip I'm not sure about the reason for the warp, but indeed the offset and uptime match

Re: [RFC][patch 0/6] pci pass-through support for qemu/KVM on s390

2014-09-04 Thread Alex Williamson
On Thu, 2014-09-04 at 12:52 +0200, frank.blasc...@de.ibm.com wrote: This set of patches implements pci pass-through support for qemu/KVM on s390. PCI support on s390 is very different from other platforms. Major differences are: 1) all PCI operations are driven by special s390 instructions

Re: [PATCH 3/4] KVM: x86: inject nested page faults on emulated instructions

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 09:02, Gleb Natapov ha scritto: On Tue, Sep 02, 2014 at 05:13:49PM +0200, Paolo Bonzini wrote: This is required for the following patch to work correctly. If a nested page fault happens during emulation, we must inject a vmexit, not a page fault. Luckily we already have

Re: [RFC][patch 3/6] KVM: s390: Add GISA support

2014-09-04 Thread Heiko Carstens
On Thu, Sep 04, 2014 at 12:52:26PM +0200, frank.blasc...@de.ibm.com wrote: +void kvm_s390_gisa_register_alert(struct kvm *kvm, u32 gisc) +{ + int bito = BITS_PER_BYTE * 7 + gisc; + + set_bit(bito ^ (BITS_PER_LONG - 1), kvm-arch.iam); +} Just a very minor nit: you could also use

Re: [PATCH 3/4] KVM: x86: inject nested page faults on emulated instructions

2014-09-04 Thread Gleb Natapov
On Thu, Sep 04, 2014 at 04:12:19PM +0200, Paolo Bonzini wrote: Il 04/09/2014 09:02, Gleb Natapov ha scritto: On Tue, Sep 02, 2014 at 05:13:49PM +0200, Paolo Bonzini wrote: This is required for the following patch to work correctly. If a nested page fault happens during emulation, we

Re: [PATCH v5 0/3] ivshmem: update documentation, add client/server tools

2014-09-04 Thread Michael S. Tsirkin
On Thu, Sep 04, 2014 at 02:50:58PM +0200, David Marchand wrote: Here is a patchset containing an update on ivshmem specs documentation and importing ivshmem server and client tools. These tools have been written from scratch and are not related to what is available in nahanni repository. I

Re: [PATCH v5 1/3] contrib: add ivshmem client and server

2014-09-04 Thread Michael S. Tsirkin
On Thu, Sep 04, 2014 at 02:50:59PM +0200, David Marchand wrote: When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz

Re: [PATCH v5 1/3] contrib: add ivshmem client and server

2014-09-04 Thread Michael S. Tsirkin
On Thu, Sep 04, 2014 at 02:50:59PM +0200, David Marchand wrote: When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Chris J Arges
On 09/04/2014 07:58 AM, Paolo Bonzini wrote: Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) forgot to add tk-xtime_sec, thus breaking kvmclock on hosts that have a reliable TSC. Add it back; and since the field boot_ns is not anymore related

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 18:00, Chris J Arges ha scritto: Uptime: 15:58:02 up 1:00, 1 user, load average: 0.59, 0.60, 0.31 Here is the output: ./x86-run x86/kvmclock_test.flat -smp 2 --append 1000 `date +%s` qemu-system-x86_64 -enable-kvm -device pc-testdev -device

Re: [PATCH 3/4] KVM: x86: inject nested page faults on emulated instructions

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 17:05, Gleb Natapov ha scritto: if (ctxt-have_exception) { inject_emulated_exception(vcpu); - r = EMULATE_DONE; + return EMULATE_DONE; If there was no vmexit we still want to writeback. Perhaps: writeback =

Re: [PATCH 3/4] KVM: x86: inject nested page faults on emulated instructions

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 17:05, Gleb Natapov ha scritto: If you do that, KVM gets down to the if (writeback) and writes the ctxt-eip from L2 into the L1 EIP. Heh, that's a bummer. We should not write back if an instruction caused a vmexit. You're right, that works. Paolo -- 8

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 14:58, Paolo Bonzini ha scritto: Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) forgot to add tk-xtime_sec, thus breaking kvmclock on hosts that have a reliable TSC. Add it back; and since the field boot_ns is not anymore related

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Chris J Arges
On 09/04/2014 12:14 PM, Paolo Bonzini wrote: Il 04/09/2014 18:00, Chris J Arges ha scritto: Uptime: 15:58:02 up 1:00, 1 user, load average: 0.59, 0.60, 0.31 Here is the output: ./x86-run x86/kvmclock_test.flat -smp 2 --append 1000 `date +%s` qemu-system-x86_64 -enable-kvm -device

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread John Stultz
On Thu, Sep 4, 2014 at 9:00 AM, Chris J Arges chris.j.ar...@canonical.com wrote: On 09/04/2014 07:58 AM, Paolo Bonzini wrote: Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) forgot to add tk-xtime_sec, thus breaking kvmclock on hosts that have

[PATCH 2/3] KVM: remove redundant assigment of return value in kvm_dev_ioctl

2014-09-04 Thread Christian Borntraeger
The first statement of kvm_dev_ioctl is long r = -EINVAL; No need to reassign the same value. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- virt/kvm/kvm_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index

[PATCH 1/3] KVM: remove redundant check of in_spin_loop

2014-09-04 Thread Christian Borntraeger
The expression `vcpu-spin_loop.in_spin_loop' is always true, because it is evaluated only when the condition `!vcpu-spin_loop.in_spin_loop' is false. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- virt/kvm/kvm_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[PATCH 0/3] cleanup of redundant statements

2014-09-04 Thread Christian Borntraeger
Paolo, I was playing with some static code checkers. Here is some fallout from the kvm common code. Only minor things that are not real error, just redundant statements. One could argue here and there that these statement make the code easier to understand. So, please have a look and either drop

[PATCH 3/3] KVM: remove redundant assignments in __kvm_set_memory_region

2014-09-04 Thread Christian Borntraeger
__kvm_set_memory_region sets r to EINVAL very early. Doing it again is not necessary. The same is true later on, where r is assigned -ENOMEM twice. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- virt/kvm/kvm_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 21:00, John Stultz ha scritto: Hey, thanks for reporting the issue and sending an initial patch (even if its not quite all sorted yet). Is the test you're using here available somewhere? Are there any special requirements to run it? You need KVM on a machine with

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 20:16, Chris J Arges ha scritto: +boot_ns = timespec_to_ns(tk-total_sleep_time) ++ tk-wall_to_monotonic.tv_sec * (u64)NSEC_PER_SEC ++ tk-wall_to_monotonic.tv_nsec ++ tk-xtime_sec * (u64)NSEC_PER_SEC; So this means that the above 3.16-based

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 21:15, Paolo Bonzini ha scritto: Il 04/09/2014 20:16, Chris J Arges ha scritto: + boot_ns = timespec_to_ns(tk-total_sleep_time) + + tk-wall_to_monotonic.tv_sec * (u64)NSEC_PER_SEC + + tk-wall_to_monotonic.tv_nsec + + tk-xtime_sec *

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Chris J Arges
On 09/04/2014 02:42 PM, Paolo Bonzini wrote: Il 04/09/2014 21:15, Paolo Bonzini ha scritto: Il 04/09/2014 20:16, Chris J Arges ha scritto: + boot_ns = timespec_to_ns(tk-total_sleep_time) + + tk-wall_to_monotonic.tv_sec * (u64)NSEC_PER_SEC + + tk-wall_to_monotonic.tv_nsec

Re: [PATCH 0/3] cleanup of redundant statements

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 21:13, Christian Borntraeger ha scritto: Paolo, I was playing with some static code checkers. Here is some fallout from the kvm common code. Only minor things that are not real error, just redundant statements. One could argue here and there that these statement make the

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 22:37, Chris J Arges ha scritto: - boot_ns = ktime_to_ns(ktime_add(tk-tkr.base_mono, tk-offs_boot)); + boot_ns = ktime_to_ns(ktime_sub(tk-offs_real, tk-offs_boot)); write_seqcount_begin(vdata-seq); If it doesn't work, then commit

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Chris J Arges
On 09/04/2014 03:40 PM, Paolo Bonzini wrote: Il 04/09/2014 22:37, Chris J Arges ha scritto: - boot_ns = ktime_to_ns(ktime_add(tk-tkr.base_mono, tk-offs_boot)); + boot_ns = ktime_to_ns(ktime_sub(tk-offs_real, tk-offs_boot)); write_seqcount_begin(vdata-seq); If it doesn't work, then

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Thomas Gleixner
On Thu, 4 Sep 2014, Paolo Bonzini wrote: Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) forgot to add tk-xtime_sec, thus breaking kvmclock on Errm. How is boottime related to xtime_sec? hosts that have a reliable TSC. Add it back; and since

[PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) used the wrong formula for boot_ns, thus breaking kvmclock on hosts that have a reliable TSC. To find the right formula, let's first backport the switch to nanoseconds to 3.16-era timekeeping logic.

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Paolo Bonzini
Il 04/09/2014 22:58, Thomas Gleixner ha scritto: This is simply wrong. It is. Now I have no idea why you think it needs to add xtime_sec. If the result is wrong, then we need to figure out which one of the supplied values is wrong and not blindly add xtime_sec just because that makes it

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Thomas Gleixner
On Thu, 4 Sep 2014, Paolo Bonzini wrote: Commit cbcf2dd3b3d4 (x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based, 2014-07-16) used the wrong formula for boot_ns, thus breaking kvmclock on hosts that have a reliable TSC. To find the right formula, let's first backport the switch

Re: [PATCH] KVM: x86: fix kvmclock breakage from timers branch merge

2014-09-04 Thread Thomas Gleixner
On Thu, 4 Sep 2014, Paolo Bonzini wrote: Il 04/09/2014 22:58, Thomas Gleixner ha scritto: This is simply wrong. It is. Now I have no idea why you think it needs to add xtime_sec. If the result is wrong, then we need to figure out which one of the supplied values is wrong and not

Re: [PATCH 1/4] PCI: Export MSI message relevant functions

2014-09-04 Thread Bjorn Helgaas
On Mon, May 19, 2014 at 01:01:07PM +1000, Gavin Shan wrote: The patch exports 2 MSI message relevant functions, which will be used by VFIO PCI driver. The VFIO PCI driver would be built as a module. Signed-off-by: Gavin Shan gws...@linux.vnet.ibm.com Acked-by: Bjorn Helgaas

[Bug 83381] 4-ports 82576 detect 2 ports when add intel_iommu=on pci=assign-busses.

2014-09-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=83381 Wanpeng Li wanpeng...@linux.intel.com changed: What|Removed |Added CC|

[Bug 83381] 4-ports 82576 detect 2 ports when add intel_iommu=on pci=assign-busses.

2014-09-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=83381 Wanpeng Li wanpeng...@linux.intel.com changed: What|Removed |Added CC|

Re: [PATCH 1/4] PCI: Export MSI message relevant functions

2014-09-04 Thread Gavin Shan
On Thu, Sep 04, 2014 at 04:57:36PM -0600, Bjorn Helgaas wrote: On Mon, May 19, 2014 at 01:01:07PM +1000, Gavin Shan wrote: The patch exports 2 MSI message relevant functions, which will be used by VFIO PCI driver. The VFIO PCI driver would be built as a module. Signed-off-by: Gavin Shan

[Bug 83381] 4-ports 82576 detect 2 ports when add intel_iommu=on pci=assign-busses.

2014-09-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=83381 --- Comment #9 from Alex Williamson alex.william...@redhat.com --- Is this a regression? Has it ever worked? Why is this filed against kvm since it appears to have no relation to qemu or kvm? -- You are receiving this mail because: You are

Re: [PATCH v2 12/15] arm/arm64: KVM: add virtual GICv3 distributor emulation

2014-09-04 Thread wanghaibin
On 2014/8/21 21:06, Andre Przywara wrote: +void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg) +{ + struct kvm *kvm = vcpu-kvm; + struct kvm_vcpu *c_vcpu; + struct vgic_dist *dist = kvm-arch.vgic; + u16 target_cpus; + u64 mpidr, mpidr_h, mpidr_l; + int sgi,

[question] git clone kvm.git failed

2014-09-04 Thread Zhang Haoyu
Hi, all I encounter below error during git clone kvm.git, # git clone git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm_0905 Cloning into 'kvm_0905'... remote: Counting objects: 3819711, done. remote: Compressing objects: 100% (575699/575699), done. remote: Total 3819711 (delta 3219203), reused

Patch - support e500-specific: Performance monitor

2014-09-04 Thread Amit Tomar
Is There specific any reason not to copy extra handler IOVR 35 for e500? --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c @@ -527,7 +527,7 @@ static struct kvmppc_ops kvm_ops_e500 = { static int __init kvmppc_e500_init(void) { int r, i; - unsigned long ivor[3]; +

RE: Patch - support e500-specific: Performance monitor

2014-09-04 Thread bharat.bhus...@freescale.com
-Original Message- From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc-ow...@vger.kernel.org] On Behalf Of Amit Tomar Sent: Thursday, September 04, 2014 8:34 PM To: ag...@suse.de; kvm-ppc@vger.kernel.org; Caraman Mihai Claudiu-B02008; pbonz...@redhat.com Subject: Patch - support