Re: [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-11 Thread Jan Kiszka
On 2014-09-11 07:06, Zhang Haoyu wrote: Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery (system bus latency?). So we need to emulate this behavior.

Re: [PATCH] KVM: ioapic: add check for RTC_GSI

2014-09-11 Thread Jan Kiszka
On 2014-09-10 18:53, Chris J Arges wrote: cppcheck found the following error: [ioapic.c:114]: (error) Array index -1 is out of bounds. If CONFIG_X86 is not defined, RTC_GSI == -1U which means that an out of bounds That issue is limited to the dead ia64 architecture, no other builds ioapic.c

Re: [PATCH 1/2] virtio-rng cleanup: move some code out of mutex protection

2014-09-11 Thread Amit Shah
On (Wed) 10 Sep 2014 [17:07:06], Amos Kong wrote: It doesn't save too much cpu time as expected, just a cleanup. Frankly I won't bother with this. It doesn't completely remove all copying from the mutex, so it's not worthwhile. Signed-off-by: Amos Kong ak...@redhat.com ---

Re: [PATCH 2/2] virtio-rng: fix stuck in catting hwrng attributes

2014-09-11 Thread Amit Shah
On (Wed) 10 Sep 2014 [17:07:07], Amos Kong wrote: When I check hwrng attributes in sysfs, cat process always gets stuck if guest has only 1 vcpu and uses a slow rng backend. Currently we check if there is any tasks waiting to be run on current cpu in rng_dev_read() by need_resched(). But

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

2014-09-11 Thread Amit Shah
On (Sun) 07 Sep 2014 [17:46:26], Zhang Haoyu wrote: Hi, Paolo, Amit, any ideas? I'll check this, thanks for testing with Linux guests. Amit -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] KVM: EVENTFD: remove inclusion of irq.h

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 05:09, Christoffer Dall ha scritto: On Mon, Sep 01, 2014 at 12:11:19PM +0200, Paolo Bonzini wrote: Il 01/09/2014 10:36, Eric Auger ha scritto: No more needed. irq.h would be void on ARM. Signed-off-by: Eric Auger eric.au...@linaro.org --- I don't think irq.h is needed

Re: [PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Zhang Haoyu
Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery (system bus latency?). So we need to emulate this behavior. Otherwise, for a guest who haven't

Re: [PATCH v3] ARM: KVM: add irqfd support

2014-09-11 Thread Eric Auger
On 09/11/2014 05:09 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 10:53:04AM +0200, Eric Auger wrote: This patch enables irqfd on ARM. irqfd framework enables to inject a virtual IRQ into a guest upon an eventfd trigger. User-side uses KVM_IRQFD VM ioctl to provide KVM with a kvm_irqfd

Re: [RFC v2 4/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:43PM +0200, Eric Auger wrote: In case the IRQ is forwarded, the VFIO platform IRQ handler does not need to disable the IRQ anymore. In that mode, when the handler completes add a comma after completes Hi

Re: [RFC v2 5/9] KVM: KVM-VFIO: update user API to program forwarded IRQ

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:44PM +0200, Eric Auger wrote: add new device group commands: - KVM_DEV_VFIO_DEVICE_FORWARD_IRQ and KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ which enable to turn forwarded IRQ mode on/off. the kvm_arch_forwarded_irq

Re: [RFC v2 6/9] VFIO: Extend external user API

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:45PM +0200, Eric Auger wrote: New functions are added to be called from ARM KVM-VFIO device. This commit message seems somewhat random. This patch doesn't deal with anything ARM specific, it introduces some

Re: [RFC v2 7/9] KVM: KVM-VFIO: add new VFIO external API hooks

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:46PM +0200, Eric Auger wrote: add functions that implement the gateway to the extended Capital letter when beginning a new sentence. Also the reference to 'the extended VFIO API' feels a bit weird. Can't you make

[PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Zhang Haoyu
Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery (system bus latency?). So we need to emulate this behavior. Otherwise, for a guest who haven't register a

Re: [PATCH] KVM: ioapic: add check for RTC_GSI

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 08:01, Jan Kiszka ha scritto: That issue is limited to the dead ia64 architecture, no other builds ioapic.c (besides x86, of course). Maybe finally remove KVM support for that arch instead of bloating otherwise correct code? Yes, we should. I've just been too busy to do it.

Re: [PATCH v5 1/7] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address.

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: We have APIC_DEFAULT_PHYS_BASE defined as 0xfee0, which is also the address of apic access page. So use this macro. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Gleb Natapov g...@kernel.org --- arch/x86/kvm/svm.c | 3 ++-

Re: [GIT PULL 0/7] KVM: s390: Fixes and features for next (3.18)

2014-09-11 Thread Paolo Bonzini
Il 10/09/2014 15:53, Christian Borntraeger ha scritto: Paolo, please have a look at the next bunch of s390 patches and consider to apply: The following changes since commit fd2752352bbc98850d83b5448a288d8991590317: KVM: x86: use guest maxphyaddr to check MTRR values (2014-08-29

Re: [PATCH v5 2/7] kvm: Remove ept_identity_pagetable from struct kvm_arch.

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: kvm_arch-ept_identity_pagetable holds the ept identity pagetable page. But it is never used to refer to the page at all. In vcpu initialization, it indicates two things: 1. indicates if ept page is allocated 2. indicates if a memory slot for

Re: [PATCH v5 3/7] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: In init_rmode_identity_map(), there two variables indicating the return value, r and ret, and it return 0 on error, 1 on success. The function is only called by vmx_create_vcpu(), and r is redundant. This patch removes the redundant variable r, and

Re: [PATCH] KVM: ioapic: add check for RTC_GSI

2014-09-11 Thread Jan Kiszka
On 2014-09-11 11:08, Paolo Bonzini wrote: Il 11/09/2014 08:01, Jan Kiszka ha scritto: That issue is limited to the dead ia64 architecture, no other builds ioapic.c (besides x86, of course). Maybe finally remove KVM support for that arch instead of bloating otherwise correct code? Yes, we

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: apic access page is pinned in memory. As a result, it cannot be migrated/hot-removed. Actually, it is not necessary to be pinned. The hpa of apic access page is stored in VMCS APIC_ACCESS_ADDR pointer. When the page is migrated,

Re: [PATCH v5 5/7] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running.

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: This patch only handle L1 and L2 vm share one apic access page situation. When L1 vm is running, if the shared apic access page is migrated, mmu_notifier will request all vcpus to exit to L0, and reload apic access page physical address for all

RE: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Gonglei (Arei)
Subject: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery

Re: [PATCH v5 7/7] kvm, mem-hotplug: Unpin and remove nested_vmx-apic_access_page.

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: Just like we removed kvm_arch-apic_access_page, nested_vmx-apic_access_page becomes useless for the same reason. This patch removes nested_vmx-apic_access_page, and use gfn_to_page() to pin it in memory when we need it, and unpin it after then.

Re: [PATCH v5 6/7] kvm, mem-hotplug: Unpin and remove kvm_arch-apic_access_page.

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 07:38, Tang Chen ha scritto: + if (vm_need_virtualize_apic_accesses(vmx-vcpu.kvm)) { + struct page *page = gfn_to_page(vmx-vcpu.kvm, + APIC_DEFAULT_PHYS_BASE PAGE_SHIFT); + vmcs_write64(APIC_ACCESS_ADDR,

Re: [PATCH] KVM: ioapic: add check for RTC_GSI

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 11:19, Jan Kiszka ha scritto: On 2014-09-11 11:08, Paolo Bonzini wrote: Il 11/09/2014 08:01, Jan Kiszka ha scritto: That issue is limited to the dead ia64 architecture, no other builds ioapic.c (besides x86, of course). Maybe finally remove KVM support for that arch instead of

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Eric Auger
On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: This patch introduces a new KVM_DEV_VFIO_DEVICE attribute. This is a new control channel which enables KVM to cooperate with viable VFIO devices. The kvm-vfio device now holds a list

Re: [PATCH v5 7/7] kvm, mem-hotplug: Unpin and remove nested_vmx-apic_access_page.

2014-09-11 Thread tangchen
On 09/11/2014 05:33 PM, Paolo Bonzini wrote: This patch is not against the latest KVM tree. The call to nested_get_page is now in nested_get_vmcs12_pages, and you have to handle virtual_apic_page in a similar manner. Hi Paolo, Thanks for the reviewing. This patch-set is against Linux

Re: [BUG] Guest kernel divide error in kvm_unlock_kick

2014-09-11 Thread Paolo Bonzini
Il 08/09/2014 15:28, Chris Webb ha scritto: divide error: [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 743 Comm: syslogd Not tainted 3.16.2-guest #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014

[PATCH] KVM: x86: make apic_accept_irq tracepoint more generic

2014-09-11 Thread Paolo Bonzini
Initially the tracepoint was added only to the APIC_DM_FIXED case, also because it reported coalesced interrupts that only made sense for that case. However, the coalesced argument is not used anymore and tracing other delivery modes is useful, so hoist the call out of the switch statement.

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Gleb Natapov
On Thu, Sep 11, 2014 at 11:21:49AM +0200, Paolo Bonzini wrote: Il 11/09/2014 07:38, Tang Chen ha scritto: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 63c4c3e..da6d55d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -7093,6 +7093,11 @@ static void

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread tangchen
On 09/11/2014 05:21 PM, Paolo Bonzini wrote: Il 11/09/2014 07:38, Tang Chen ha scritto: apic access page is pinned in memory. As a result, it cannot be migrated/hot-removed. Actually, it is not necessary to be pinned. The hpa of apic access page is stored in VMCS APIC_ACCESS_ADDR pointer.

Re: [PATCH v2] ARM/arm64: KVM: fix use of WnR bit in kvm_is_write_fault()

2014-09-11 Thread Marc Zyngier
On 11/09/14 04:12, Christoffer Dall wrote: On Tue, Sep 09, 2014 at 12:02:59PM +0100, Marc Zyngier wrote: [resending, as ARM email server seems to be in some mood] On 09/09/14 11:27, Ard Biesheuvel wrote: The ISS encoding for an exception from a Data Abort has a WnR bit[6] that indicates

Re: [PATCH v5 3/7] kvm: Make init_rmode_identity_map() return 0 on success.

2014-09-11 Thread tangchen
On 09/11/2014 05:17 PM, Paolo Bonzini wrote: .. @@ -7645,7 +7642,7 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) kvm-arch.ept_identity_map_addr = VMX_EPT_IDENTITY_PAGETABLE_ADDR; err =

Re: [PATCH] KVM: EVENTFD: remove inclusion of irq.h

2014-09-11 Thread Marc Zyngier
On 11/09/14 08:11, Paolo Bonzini wrote: Il 11/09/2014 05:09, Christoffer Dall ha scritto: On Mon, Sep 01, 2014 at 12:11:19PM +0200, Paolo Bonzini wrote: Il 01/09/2014 10:36, Eric Auger ha scritto: No more needed. irq.h would be void on ARM. Signed-off-by: Eric Auger eric.au...@linaro.org

blk-mq crash under KVM in multiqueue block code (with virtio-blk and ext4)

2014-09-11 Thread Christian Borntraeger
Folks, we have seen the following bug with 3.16 as a KVM guest. It suspect the blk-mq rework that happened between 3.15 and 3.16, but it can be something completely different. [ 65.992022] Unable to handle kernel pointer dereference in virtual kernel address space [ 65.992187] failing

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 12:20, tangchen ha scritto: +vmcs_write64(APIC_ACCESS_ADDR, hpa); This has to be guarded by if (!is_guest_mode(vcpu)). Since we cannot get vcpu through kvm, I'd like to move this check to vcpu_reload_apic_access_page() when kvm_x86_ops-set_apic_access_page_addr() is

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 12:12, Gleb Natapov ha scritto: On Thu, Sep 11, 2014 at 11:21:49AM +0200, Paolo Bonzini wrote: Il 11/09/2014 07:38, Tang Chen ha scritto: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 63c4c3e..da6d55d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@

[PATCH v4 2/8] arm/arm64: KVM: vgic: switch to dynamic allocation

2014-09-11 Thread Marc Zyngier
So far, all the VGIC data structures are statically defined by the *maximum* number of vcpus and interrupts it supports. It means that we always have to oversize it to cater for the worse case. Start by changing the data structures to be dynamically sizeable, and allocate them at runtime. The

[PATCH v4 0/8] arm/arm64: KVM: dynamic VGIC sizing

2014-09-11 Thread Marc Zyngier
So far, the VGIC data structures have been statically sized, meaning that we always have to support more interrupts than we actually want, and more CPU interfaces than we should. This is a waste of resource, and is the kind of things that should be tuneable. This series addresses that issue by

[PATCH v4 3/8] arm/arm64: KVM: vgic: Parametrize VGIC_NR_SHARED_IRQS

2014-09-11 Thread Marc Zyngier
Having a dynamic number of supported interrupts means that we cannot relly on VGIC_NR_SHARED_IRQS being fixed anymore. Instead, make it take the distributor structure as a parameter, so it can return the right value. Reviewed-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Marc

[PATCH v4 1/8] KVM: ARM: vgic: plug irq injection race

2014-09-11 Thread Marc Zyngier
As it stands, nothing prevents userspace from injecting an interrupt before the guest's GIC is actually initialized. This goes unnoticed so far (as everything is pretty much statically allocated), but ends up exploding in a spectacular way once we switch to a more dynamic allocation (the GIC data

[PATCH v4 5/8] arm/arm64: KVM: vgic: handle out-of-range MMIO accesses

2014-09-11 Thread Marc Zyngier
Now that we can (almost) dynamically size the number of interrupts, we're facing an interesting issue: We have to evaluate at runtime whether or not an access hits a valid register, based on the sizing of this particular instance of the distributor. Furthermore, the GIC spec says that accessing a

[PATCH v4 8/8] arm/arm64: KVM: vgic: make number of irqs a configurable attribute

2014-09-11 Thread Marc Zyngier
In order to make the number of interrupts configurable, use the new fancy device management API to add KVM_DEV_ARM_VGIC_GRP_NR_IRQS as a VGIC configurable attribute. Userspace can now specify the exact size of the GIC (by increments of 32 interrupts). Signed-off-by: Marc Zyngier

[PATCH v4 6/8] arm/arm64: KVM: vgic: kill VGIC_NR_IRQS

2014-09-11 Thread Marc Zyngier
Nuke VGIC_NR_IRQS entierly, now that the distributor instance contains the number of IRQ allocated to this GIC. Also add VGIC_NR_IRQS_LEGACY to preserve the current API. Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- include/kvm/arm_vgic.h | 6 +++--- virt/kvm/arm/vgic.c| 17

[PATCH v4 7/8] arm/arm64: KVM: vgic: delay vgic allocation until init time

2014-09-11 Thread Marc Zyngier
It is now quite easy to delay the allocation of the vgic tables until we actually require it to be up and running (when the first vcpu is kicking around, or someones tries to access the GIC registers). This allow us to allocate memory for the exact number of CPUs we have. As nobody configures the

[PATCH v4 4/8] arm/arm64: KVM: vgic: kill VGIC_MAX_CPUS

2014-09-11 Thread Marc Zyngier
We now have the information about the number of CPU interfaces in the distributor itself. Let's get rid of VGIC_MAX_CPUS, and just rely on KVM_MAX_VCPUS where we don't have the choice. Yet. Reviewed-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Marc Zyngier marc.zyng...@arm.com

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Gleb Natapov
On Thu, Sep 11, 2014 at 12:47:16PM +0200, Paolo Bonzini wrote: Il 11/09/2014 12:12, Gleb Natapov ha scritto: On Thu, Sep 11, 2014 at 11:21:49AM +0200, Paolo Bonzini wrote: Il 11/09/2014 07:38, Tang Chen ha scritto: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

Re: [PATCH 2/2] virtio-rng: fix stuck in catting hwrng attributes

2014-09-11 Thread Rusty Russell
Amos Kong ak...@redhat.com writes: When I check hwrng attributes in sysfs, cat process always gets stuck if guest has only 1 vcpu and uses a slow rng backend. Currently we check if there is any tasks waiting to be run on current cpu in rng_dev_read() by need_resched(). But need_resched()

Howto connect to a terminal in an emalated linux-livecd?

2014-09-11 Thread Oliver Rath
Hi list, after hours for searching in google-world, i didnt find any appropriate for this problem: I want to boot a live-cd (i.e. ubuntu 14.04.1-desktop) in qemu, which starts with an graphical interface, done i.e. by qemu-system-x86_64 -m 3G -smp 2 -drive

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Eric Auger
On 09/11/2014 07:05 AM, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: This patch introduces a new KVM_DEV_VFIO_DEVICE attribute. This is a new control channel which enables KVM to cooperate with

Re: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-11 Thread Zhang Haoyu
Subject: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 13:30, Gleb Natapov ha scritto: + vmcs_write64(APIC_ACCESS_ADDR, page_to_phys(page)); + /* + * Do not pin apic access page in memory so that memory + * hotplug process is able to migrate it. +

[PATCH] KVM: PPC: Convert openpic lock to raw_spinlock

2014-09-11 Thread Bogdan Purcareata
This patch enables running intensive I/O workloads, e.g. netperf, in a guest deployed on a RT host. No change for !RT kernels. The openpic spinlock becomes a sleeping mutex on a RT system. This no longer guarantees that EPR is atomic with exception delivery. The guest VCPU thread fails due to a

[PATCH v2] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Zhang Haoyu
Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some dealy between the EOI writing and irq delivery (system bus latency?). So we need to emulate this behavior. Otherwise, for a guest who haven't register a

Re: [Qemu-devel] QEMU with KVM does not start Win8 on kernel 3.4.67 and core2duo

2014-09-11 Thread Erik Rull
On August 6, 2014 at 1:19 PM Erik Rull erik.r...@rdsoftware.de wrote: Hi all, I did already several tests and I'm not completely sure what's going wrong, but here my scenario: When I start up QEMU w/ KVM 1.7.0 on a Core2Duo machine running a vanilla kernel 3.4.67 to run a Windows 8.0

Re: [Qemu-devel] QEMU with KVM does not start Win8 on kernel 3.4.67 and core2duo

2014-09-11 Thread Jan Kiszka
On 2014-09-11 15:25, Erik Rull wrote: On August 6, 2014 at 1:19 PM Erik Rull erik.r...@rdsoftware.de wrote: Hi all, I did already several tests and I'm not completely sure what's going wrong, but here my scenario: When I start up QEMU w/ KVM 1.7.0 on a Core2Duo machine running a vanilla

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Gleb Natapov
On Thu, Sep 11, 2014 at 03:05:05PM +0200, Paolo Bonzini wrote: Il 11/09/2014 13:30, Gleb Natapov ha scritto: +vmcs_write64(APIC_ACCESS_ADDR, page_to_phys(page)); +/* + * Do not pin apic access page in memory so

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 15:59, Gleb Natapov ha scritto: Suppose vmcs01-APIC_ACCESS_ADDR = 0xf000. During L2 entry vmcs02-APIC_ACCESS_ADDR is set to 0xf000 too (by prepare_vmcs02). Now 0xf000 is migrated to 0x8000, mmu notifier is called, it forces vmexit, but vcpu is in a guest mode so

Re: [Qemu-devel] QEMU with KVM does not start Win8 on kernel 3.4.67 and core2duo

2014-09-11 Thread Erik Rull
On September 11, 2014 at 3:32 PM Jan Kiszka jan.kis...@siemens.com wrote: On 2014-09-11 15:25, Erik Rull wrote: On August 6, 2014 at 1:19 PM Erik Rull erik.r...@rdsoftware.de wrote: Hi all, I did already several tests and I'm not completely sure what's going wrong, but here my

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 16:21, Gleb Natapov ha scritto: As far as I can tell the if that is needed there is: if (!is_guest_mode() || !(vmcs12-secondary_vm_exec_control ECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) write(PIC_ACCESS_ADDR) In other words if L2 shares L1 apic access page then reload,

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Gleb Natapov
On Thu, Sep 11, 2014 at 04:06:58PM +0200, Paolo Bonzini wrote: Il 11/09/2014 15:59, Gleb Natapov ha scritto: Suppose vmcs01-APIC_ACCESS_ADDR = 0xf000. During L2 entry vmcs02-APIC_ACCESS_ADDR is set to 0xf000 too (by prepare_vmcs02). Now 0xf000 is migrated to 0x8000, mmu notifier is

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Gleb Natapov
On Thu, Sep 11, 2014 at 04:24:04PM +0200, Paolo Bonzini wrote: Il 11/09/2014 16:21, Gleb Natapov ha scritto: As far as I can tell the if that is needed there is: if (!is_guest_mode() || !(vmcs12-secondary_vm_exec_control ECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES))

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Paolo Bonzini
Il 11/09/2014 16:31, Gleb Natapov ha scritto: What if the page being swapped out is L1's APIC access page? We don't run prepare_vmcs12 in that case because it's an L2-L0-L2 entry, so we need to do something. We will do something on L2-L1 exit. We will call kvm_reload_apic_access_page().

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread Gleb Natapov
On Thu, Sep 11, 2014 at 04:37:39PM +0200, Paolo Bonzini wrote: Il 11/09/2014 16:31, Gleb Natapov ha scritto: What if the page being swapped out is L1's APIC access page? We don't run prepare_vmcs12 in that case because it's an L2-L0-L2 entry, so we need to do something. We will do

Re: [PATCH v3 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu

2014-09-11 Thread Andre Przywara
Hi Anup, On 08/09/14 09:17, Anup Patel wrote: Instead, of trying out each and every target type we should use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target type for KVM ARM/ARM64. If KVM_ARM_PREFERRED_TARGET vm ioctl fails then we fallback to old method of trying all known target

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Alex Williamson
On Thu, 2014-09-11 at 14:04 +0200, Eric Auger wrote: On 09/11/2014 07:05 AM, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: This patch introduces a new KVM_DEV_VFIO_DEVICE attribute. This is a

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Alex Williamson
On Thu, 2014-09-11 at 11:35 +0200, Eric Auger wrote: On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: This patch introduces a new KVM_DEV_VFIO_DEVICE attribute. This is a new control channel which enables KVM to cooperate with

Re: [PATCH v3 2/4] kvmtool: ARM64: Add target type potenza for aarch64

2014-09-11 Thread Andre Przywara
Anup, On 08/09/14 09:17, Anup Patel wrote: The VCPU target type KVM_ARM_TARGET_XGENE_POTENZA is available in latest Linux-3.16-rcX or higher hence register aarch64 target type for it. This patch enables us to run KVMTOOL on X-Gene Potenza host. Why do you need this still if the previous

Re: [PATCH v3 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

2014-09-11 Thread Andre Przywara
On 08/09/14 09:17, Anup Patel wrote: The KVM_EXIT_SYSTEM_EVENT exit reason was added to define architecture independent system-wide events for a Guest. Currently, it is used by in-kernel PSCI-0.2 emulation of KVM ARM/ARM64 to inform user space about PSCI SYSTEM_OFF or PSCI SYSTEM_RESET

Re: [PATCH v3] ARM: KVM: add irqfd support

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 10:14:13AM +0200, Eric Auger wrote: On 09/11/2014 05:09 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 10:53:04AM +0200, Eric Auger wrote: This patch enables irqfd on ARM. irqfd framework enables to inject a virtual IRQ into a guest upon an eventfd trigger.

Re: [BUG] Guest kernel divide error in kvm_unlock_kick

2014-09-11 Thread Chris Webb
Paolo Bonzini pbonz...@redhat.com wrote: This is a hypercall that should have kicked VCPU 3 (see rcx). Can you please apply this patch and gather a trace of the host (using trace-cmd -e kvm qemu-kvm arguments)? Sure, no problem. I've built the trace-cmd tool against udis86 (I hope) and have

Re: [RFC v2 4/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 10:44:02AM +0200, Eric Auger wrote: On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:43PM +0200, Eric Auger wrote: In case the IRQ is forwarded, the VFIO platform IRQ handler does not need to disable the IRQ anymore. In that mode, when

Re: [RFC v2 5/9] KVM: KVM-VFIO: update user API to program forwarded IRQ

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 10:49:08AM +0200, Eric Auger wrote: On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:44PM +0200, Eric Auger wrote: [...] + +It is up to the caller of this API to make sure the IRQ is not +outstanding when the FORWARD/UNFORWARD is

Re: [RFC v2 4/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-09-11 Thread Antonios Motakis
On Thu, Sep 11, 2014 at 10:44 AM, Eric Auger eric.au...@linaro.org wrote: On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:43PM +0200, Eric Auger wrote: In case the IRQ is forwarded, the VFIO platform IRQ handler does not need to disable the IRQ anymore. In

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Christoffer Dall
On Wed, Sep 10, 2014 at 11:05:49PM -0600, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: [...] +#ifdef __KVM_HAVE_ARCH_KVM_VFIO_FORWARD +int kvm_arch_set_fwd_state(struct kvm_fwd_irq

Re: [PATCH v3 0/4] Make kvm_device_ops registration dynamic

2014-09-11 Thread Will Deacon
Hi Paolo, On Tue, Sep 02, 2014 at 10:27:32AM +0100, Will Deacon wrote: Hi all, This is version 3 of the patches originally posted here: v1: http://www.spinics.net/lists/kvm-arm/msg10219.html v2: http://www.spinics.net/lists/kvm/msg105197.html Changes since v2 include: -

Re: [RFC PATCH v6 15/20] vfio/platform: support for maskable and automasked interrupts

2014-09-11 Thread Antonios Motakis
On Wed, Sep 10, 2014 at 12:13 PM, Christoffer Dall christoffer.d...@linaro.org wrote: On Tue, Sep 02, 2014 at 06:06:17PM +0200, Antonios Motakis wrote: On Sun, Jun 8, 2014 at 12:17 PM, Christoffer Dall christoffer.d...@linaro.org wrote: On Thu, Jun 05, 2014 at 07:03:23PM +0200, Antonios

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 02:04:39PM +0200, Eric Auger wrote: On 09/11/2014 07:05 AM, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: This patch introduces a new KVM_DEV_VFIO_DEVICE attribute.

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 09:59:24AM -0600, Alex Williamson wrote: On Thu, 2014-09-11 at 14:04 +0200, Eric Auger wrote: On 09/11/2014 07:05 AM, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote:

Re: [RFC v2 2/9] KVM: ARM: VGIC: add forwarded irq rbtree lock

2014-09-11 Thread Eric Auger
On 09/11/2014 05:09 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:41PM +0200, Eric Auger wrote: add a lock related to the rb tree manipulation. The rb tree can be Ok, I can't hold myself back any longer. Please begin sentences with a capital letter. You don't do this in

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 11:35:56AM +0200, Eric Auger wrote: On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: [...] + if (!pfwd) + return -ENOMEM; + pfwd-index = fwd_irq-index; + pfwd-gsi = fwd_irq-gsi; +

hardware problem + travelling

2014-09-11 Thread Paolo Bonzini
An OOPS has just bricked my main machine (or so it seems---firmware doesn't show up at all, not even with disks removed), so I'll likely spend part of tomorrow reviving an older one which I've luckily kept. Plus, I'll be travelling most of next week. For this reason I might be slow answering the

Re: [RFC v2 4/9] VFIO: platform: handler tests whether the IRQ is forwarded

2014-09-11 Thread Alex Williamson
On Thu, 2014-09-11 at 19:05 +0200, Christoffer Dall wrote: On Thu, Sep 11, 2014 at 10:44:02AM +0200, Eric Auger wrote: On 09/11/2014 05:10 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:43PM +0200, Eric Auger wrote: In case the IRQ is forwarded, the VFIO platform IRQ handler

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Alex Williamson
On Thu, 2014-09-11 at 19:10 +0200, Christoffer Dall wrote: On Wed, Sep 10, 2014 at 11:05:49PM -0600, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM +0200, Eric Auger wrote: [...] +#ifdef

Re: [RFC v2 1/9] KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ

2014-09-11 Thread Eric Auger
On 09/11/2014 05:09 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:40PM +0200, Eric Auger wrote: Fix multiple injection of level sensitive forwarded IRQs. With current code, the second injection fails since the state bitmaps are not reset (process_maintenance is not called anymore).

Re: [PATCH] KVM: PPC: Convert openpic lock to raw_spinlock

2014-09-11 Thread Scott Wood
On Thu, 2014-09-11 at 15:25 -0400, Bogdan Purcareata wrote: This patch enables running intensive I/O workloads, e.g. netperf, in a guest deployed on a RT host. No change for !RT kernels. The openpic spinlock becomes a sleeping mutex on a RT system. This no longer guarantees that EPR is

Recommended Kernel and KVM version

2014-09-11 Thread Flávio Ramalho
Hi, I am running an OpenStack infrastructure and some compute nodes are frequently having kernel panic, as far as I see, the kernel panics are related with KVM. Do you guys have any recommendation about the kernel and KVM version to be used in an production environment? Thanks, Flávio -- To

Re: [RFC v2 8/9] KVM: KVM-VFIO: generic KVM_DEV_VFIO_DEVICE command and IRQ forwarding control

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 12:14:10PM -0600, Alex Williamson wrote: On Thu, 2014-09-11 at 19:10 +0200, Christoffer Dall wrote: On Wed, Sep 10, 2014 at 11:05:49PM -0600, Alex Williamson wrote: On Thu, 2014-09-11 at 05:10 +0200, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:47PM

Re: [RFC v2 1/9] KVM: ARM: VGIC: fix multiple injection of level sensitive forwarded IRQ

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 08:17:49PM +0200, Eric Auger wrote: On 09/11/2014 05:09 AM, Christoffer Dall wrote: On Mon, Sep 01, 2014 at 02:52:40PM +0200, Eric Auger wrote: Fix multiple injection of level sensitive forwarded IRQs. With current code, the second injection fails since the state

Re: [PATCH v4 2/8] arm/arm64: KVM: vgic: switch to dynamic allocation

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 12:09:09PM +0100, Marc Zyngier wrote: So far, all the VGIC data structures are statically defined by the *maximum* number of vcpus and interrupts it supports. It means that we always have to oversize it to cater for the worse case. Start by changing the data

Re: [PATCH v4 6/8] arm/arm64: KVM: vgic: kill VGIC_NR_IRQS

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 12:09:13PM +0100, Marc Zyngier wrote: Nuke VGIC_NR_IRQS entierly, now that the distributor instance contains the number of IRQ allocated to this GIC. Also add VGIC_NR_IRQS_LEGACY to preserve the current API. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Did

Re: [PATCH v4 8/8] arm/arm64: KVM: vgic: make number of irqs a configurable attribute

2014-09-11 Thread Christoffer Dall
On Thu, Sep 11, 2014 at 12:09:15PM +0100, Marc Zyngier wrote: In order to make the number of interrupts configurable, use the new fancy device management API to add KVM_DEV_ARM_VGIC_GRP_NR_IRQS as a VGIC configurable attribute. Userspace can now specify the exact size of the GIC (by

Re: [PATCH 1/2] KVM: document KVM_SET_GUEST_DEBUG api

2014-09-11 Thread Christoffer Dall
On Tue, Sep 09, 2014 at 05:27:18PM +0100, Alex Bennée wrote: In preparation for working on the ARM implementation I noticed the debug interface was missing from the API document. I've pieced together the expected behaviour from the code and commit messages written it up as best I can.

Re: [PATCH 0/2] KVM API documentation patches

2014-09-11 Thread Christoffer Dall
On Wed, Sep 10, 2014 at 11:34:53AM +0200, Paolo Bonzini wrote: Il 09/09/2014 18:27, Alex Bennée ha scritto: Hi, I'm preparing to add ARM KVM GDB support and I went to read the API documentation and found it surprisingly mute on the subject ;-) The first patch documents the new

Re: [PATCH] KVM: arm64: add gic-400 compatible

2014-09-11 Thread Christoffer Dall
On Mon, Sep 08, 2014 at 10:21:44PM +, Joel Schopp wrote: Add a one liner to identify the gic-400. It's gicv2 with optional MSI extensions. Cc: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Joel Schopp joel.sch...@amd.com --- virt/kvm/arm/vgic.c |1 + 1 file

Re: [PATCH v3 1/2] virtio-rng: fix stuck of hot-unplugging busy device

2014-09-11 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Wed) 10 Sep 2014 [14:11:36], Amos Kong wrote: When we try to hot-remove a busy virtio-rng device from QEMU monitor, the device can't be hot-removed. Because virtio-rng driver hangs at wait_for_completion_killable(). This patch exits the waiting by

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread tangchen
Hi Gleb, Paolo, On 09/11/2014 10:47 PM, Gleb Natapov wrote: On Thu, Sep 11, 2014 at 04:37:39PM +0200, Paolo Bonzini wrote: Il 11/09/2014 16:31, Gleb Natapov ha scritto: What if the page being swapped out is L1's APIC access page? We don't run prepare_vmcs12 in that case because it's an

Re: [PATCH v5 4/7] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().

2014-09-11 Thread tangchen
Hi Paolo, On 09/11/2014 10:24 PM, Paolo Bonzini wrote: Il 11/09/2014 16:21, Gleb Natapov ha scritto: As far as I can tell the if that is needed there is: if (!is_guest_mode() || !(vmcs12-secondary_vm_exec_control ECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) write(PIC_ACCESS_ADDR) In other

Re: [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial

2014-09-11 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

[PATCH] KVM: Refactor making request to makes it meaningful

2014-09-11 Thread guohliu
This patch replace the set_bit method by kvm_make_request to makes it more readable and consistency. Signed-off-by: Guo Hui Liu liuguo...@gmail.com --- arch/x86/kvm/x86.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

  1   2   >