Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Tang Chen
Hi Paolo, I'd like to help to test the patches. Would you please tell me what is the best way to test this patch-set ? I think ept page is being used by regular guest. Is adding "-cpu xxx,-x2apic option" able to make sure guest is using apic page ? Thanks. On 09/24/2014 04:20 PM, Paolo Bonzini

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

2014-09-25 Thread David Marchand
On 09/23/2014 05:58 PM, Stefan Hajnoczi wrote: I'm not sure a full-fledged feature negotiation system is needed. The ivshmem protocol is local to the host and all participants are under control of the administrator. I suggested a protocol version to protect against misconfiguration. For exampl

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

2014-09-25 Thread Shannon Zhao
Hi all, I have a problem that I want to ask for your advice. Before I send this mail to Marc and Christoffer. But it seems that they are busy or not online recently. I git clone Marc's "kvmtool-vgic-dyn" branch and run it on Fastmodel Cortex-A57*4 with qemu 2.1.0. https://git.kernel.org/pub/scm

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

2014-09-25 Thread Christoffer Dall
On Thu, Sep 25, 2014 at 08:44:16PM +0800, Shannon Zhao wrote: > Hi all, > > I have a problem that I want to ask for your advice. > Before I send this mail to Marc and Christoffer. But it seems that they are > busy or not online recently. > > I git clone Marc's "kvmtool-vgic-dyn" branch and run i

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Paolo Bonzini
Il 25/09/2014 10:19, Tang Chen ha scritto: > Hi Paolo, > > I'd like to help to test the patches. > Would you please tell me what is the best way to test this patch-set ? How did _you_ test the patches?... > I think ept page is being used by regular guest. > Is adding "-cpu xxx,-x2apic option" ab

[PATCH] arm/arm64: KVM: Fix set_clear_sgi_pend_reg offset

2014-09-25 Thread Christoffer Dall
The sgi values calculated in read_set_clear_sgi_pend_reg() and write_set_clear_sgi_pend_reg() were horribly incorrectly multiplied by 4 with catastrophic results in that subfunctions ended up overwriting memory not allocated for the expected purpose. This showed up as bugs in kfree() and the kerne

[PATCH] arm/arm64: KVM: Fix VTTBR_BADDR_MASK and pgd alloc

2014-09-25 Thread Christoffer Dall
From: Joel Schopp The current aarch64 calculation for VTTBR_BADDR_MASK masks only 39 bits and not all the bits in the PA range. This is clearly a bug that manifests itself on systems that allocate memory in the higher address space range. [ Modified from Joel's original patch to be based on PHY

[PATCH 0/2] arm/arm64: KVM: Host 48-bit VA support and IPA limits

2014-09-25 Thread Christoffer Dall
The following two patches fixup some missing memory handling in KVM/arm64. The first patch supports 48 bit virtual address space which involves supporting a different number of levels of page tables in the host kernel and the stage-2 page tables. This patch removes "depends on BROKEN" from CONFIG

[PATCH 1/2] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-09-25 Thread Christoffer Dall
This patch adds the necessary support for all host kernel PGSIZE and VA_SPACE configuration options for both EL2 and the Stage-2 page tables. However, for 40bit and 42bit PARange systems, the architecture mandates that VTCR_EL2.SL0 is maximum 1, resulting in fewer levels of stage-2 pagge tables th

[PATCH 2/2] arm/arm64: KVM: Ensure memslots are within KVM_PHYS_SIZE

2014-09-25 Thread Christoffer Dall
When creating or moving a memslot, make sure the IPA space is within the addressable range of the guest. Otherwise, user space can create too large a memslot and KVM would try to access potentially unallocated page table entries when inserting entries in the Stage-2 page tables. Signed-off-by: Ch

Re: [PATCH v2] kvm: Faults which trigger IO release the mmap_sem

2014-09-25 Thread Andrea Arcangeli
Hi Andres, On Wed, Sep 17, 2014 at 10:51:48AM -0700, Andres Lagar-Cavilla wrote: > + if (!locked) { > + VM_BUG_ON(npages != -EBUSY); > + Shouldn't this be VM_BUG_ON(npages)? Alternatively we could patch gup to do: case -EHWPOISON: +

Re: [PATCH v2] kvm: Faults which trigger IO release the mmap_sem

2014-09-25 Thread Andres Lagar-Cavilla
On Thu, Sep 25, 2014 at 2:16 PM, Andrea Arcangeli wrote: > Hi Andres, > > On Wed, Sep 17, 2014 at 10:51:48AM -0700, Andres Lagar-Cavilla wrote: >> + if (!locked) { >> + VM_BUG_ON(npages != -EBUSY); >> + > > Shouldn't this be VM_BUG_ON(npages)? Oh shoot you're right. I was confused

[PATCH] kvm: Fix kvm_get_page_retry_io __gup retval check

2014-09-25 Thread Andres Lagar-Cavilla
Confusion around -EBUSY and zero (inside a BUG_ON no less). Reported-by: AndreA Arcangeli Signed-off-by: Andres Lagar-Cavilla --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 3f16f56..a1cf53e 100644 --- a

Re: [PATCH] kvm: Fix kvm_get_page_retry_io __gup retval check

2014-09-25 Thread Andrea Arcangeli
On Thu, Sep 25, 2014 at 03:26:50PM -0700, Andres Lagar-Cavilla wrote: > Confusion around -EBUSY and zero (inside a BUG_ON no less). > > Reported-by: AndreA Arcangeli > Signed-off-by: Andres Lagar-Cavilla > --- > virt/kvm/kvm_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Review

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

2014-09-25 Thread Shannon Zhao
On 2014/9/25 21:35, Christoffer Dall wrote: > On Thu, Sep 25, 2014 at 08:44:16PM +0800, Shannon Zhao wrote: >> Hi all, >> >> I have a problem that I want to ask for your advice. >> Before I send this mail to Marc and Christoffer. But it seems that they are >> busy or not online recently. >> >> I

Re: [PATCH v8 0/8] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page.

2014-09-25 Thread Tang Chen
On 09/25/2014 09:43 PM, Paolo Bonzini wrote: Il 25/09/2014 10:19, Tang Chen ha scritto: Hi Paolo, I'd like to help to test the patches. Would you please tell me what is the best way to test this patch-set ? How did _you_ test the patches?... I just added "-cpu xxx,-x2apic" option, start the

Re: [PATCH 4/4] vfio/pci: Restore MSIx message prior to enabling

2014-09-25 Thread Gavin Shan
On Wed, Sep 10, 2014 at 06:13:42PM +1000, Gavin Shan wrote: >On Mon, May 19, 2014 at 01:01:10PM +1000, Gavin Shan wrote: >>The MSIx vector table lives in device memory, which may be cleared as >>part of a backdoor device reset. This is the case on the IBM IPR HBA >>when the BIST is run on the devic

Re: [PATCH 4/4] vfio/pci: Restore MSIx message prior to enabling

2014-09-25 Thread Alex Williamson
On Fri, 2014-09-26 at 13:19 +1000, Gavin Shan wrote: > On Wed, Sep 10, 2014 at 06:13:42PM +1000, Gavin Shan wrote: > >On Mon, May 19, 2014 at 01:01:10PM +1000, Gavin Shan wrote: > >>The MSIx vector table lives in device memory, which may be cleared as > >>part of a backdoor device reset. This is th

Re: [PATCH] arm/arm64: KVM: Fix set_clear_sgi_pend_reg offset

2014-09-25 Thread Shannon Zhao
On 2014/9/26 1:49, Christoffer Dall wrote: > The sgi values calculated in read_set_clear_sgi_pend_reg() and > write_set_clear_sgi_pend_reg() were horribly incorrectly multiplied by 4 > with catastrophic results in that subfunctions ended up overwriting > memory not allocated for the expected purpo

[PATCH] kvm: kvmclock: use get_cpu() and put_cpu()

2014-09-25 Thread Tiejun Chen
We can use get_cpu() and put_cpu() to replace preempt_disable()/cpu = smp_processor_id() and preempt_enable() for slightly better code. Signed-off-by: Tiejun Chen --- arch/x86/kernel/kvmclock.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/x86/kern

Re: [Qemu-devel] [RFC patch 0/6] vfio based pci pass-through for qemu/KVM on s390

2014-09-25 Thread Frank Blaschka
On Wed, Sep 24, 2014 at 10:05:57AM -0600, Alex Williamson wrote: > On Wed, 2014-09-24 at 10:47 +0200, Frank Blaschka wrote: > > On Mon, Sep 22, 2014 at 02:47:31PM -0600, Alex Williamson wrote: > > > On Fri, 2014-09-19 at 13:54 +0200, frank.blasc...@de.ibm.com wrote: > > > > This set of patches impl