Re: [PATCH] kvm: fix to update memslots properly

2015-03-10 Thread Chen, Tiejun
On 2015/3/10 4:54, Marcelo Tosatti wrote: On Sat, Dec 27, 2014 at 09:41:45PM +0100, Paolo Bonzini wrote: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f528343..6e52f3f 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -672,6 +672,7 @@ static void

Re: [PATCH] kvm: fix to update memslots properly

2015-03-10 Thread Paolo Bonzini
This suggests another fix. We can change the insertion to use a = comparison, as in your first patch. Alone it is not correct, but we only need to take some care and avoid breaking the case of deleting a memslot. It's enough to wrap the second loop (that you patched) with if

Re: 2 CPU Conformance Issue in KVM/x86

2015-03-10 Thread Paolo Bonzini
On 09/03/2015 20:49, Avi Kivity wrote: Yes, and it checked that MAXPHYADDR != 52 before. If you want to set only one bit, making that bit 51 makes sense anyway for simplicity, so it is still 99.9% academic. Once processors appear with MAXPHYADDR = 52, the remaining 0.1% will become more

Re: 2 CPU Conformance Issue in KVM/x86

2015-03-10 Thread Paolo Bonzini
On 09/03/2015 20:50, Avi Kivity wrote: Is the issue emulating a higher MAXPHYADDR on the guest than is available on the host? I don't think there's any need to support that. No, indeed. The only problem is that the failure mode is quite horrible (you get a triple fault, possibly while the

Re: [PATCH] x86: svm: make wbinvd faster

2015-03-10 Thread Radim Krčmář
2015-03-09 20:28-0300, Marcelo Tosatti: On Fri, Feb 27, 2015 at 06:19:18PM -0600, Joel Schopp wrote: From: David Kaplan david.kap...@amd.com No need to re-decode WBINVD since we know what it is from the intercept. Signed-off-by: David Kaplan david.kap...@amd.com [extracted from larger

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Andrey Korolyov
On Sat, Mar 7, 2015 at 3:00 AM, Andrey Korolyov and...@xdel.ru wrote: On Fri, Mar 6, 2015 at 7:57 PM, Bandan Das b...@redhat.com wrote: Andrey Korolyov and...@xdel.ru writes: On Fri, Mar 6, 2015 at 1:14 AM, Andrey Korolyov and...@xdel.ru wrote: Hello, recently I`ve got a couple of shiny new

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Dr. David Alan Gilbert
* Andrey Korolyov (and...@xdel.ru) wrote: On Sat, Mar 7, 2015 at 3:00 AM, Andrey Korolyov and...@xdel.ru wrote: On Fri, Mar 6, 2015 at 7:57 PM, Bandan Das b...@redhat.com wrote: Andrey Korolyov and...@xdel.ru writes: On Fri, Mar 6, 2015 at 1:14 AM, Andrey Korolyov and...@xdel.ru wrote:

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Andrey Korolyov
On Tue, Mar 10, 2015 at 7:57 PM, Dr. David Alan Gilbert dgilb...@redhat.com wrote: * Andrey Korolyov (and...@xdel.ru) wrote: On Sat, Mar 7, 2015 at 3:00 AM, Andrey Korolyov and...@xdel.ru wrote: On Fri, Mar 6, 2015 at 7:57 PM, Bandan Das b...@redhat.com wrote: Andrey Korolyov and...@xdel.ru

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Bandan Das
Dr. David Alan Gilbert dgilb...@redhat.com writes: * Paolo Bonzini (pbonz...@redhat.com) wrote: On 10/03/2015 19:21, Bandan Das wrote: Paolo Bonzini pbonz...@redhat.com writes: On 10/03/2015 17:57, Dr. David Alan Gilbert wrote: I'm seeing something similar; it's very intermittent

Re: [PATCH v5 29/29] vfio: powerpc/spapr: Support Dynamic DMA windows

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: This adds create/remove window ioctls to create and remove DMA windows. sPAPR defines a Dynamic DMA windows capability which allows para-virtualized guests to create additional DMA windows on a PCI bus. The existing linux kernels

CfP 10th Workshop on Virtualization in High-Performance Cloud Computing (VHPC '15)

2015-03-10 Thread VHPC 15
= CALL FOR PAPERS 10th Workshop on Virtualization in High-Performance Cloud Computing (VHPC '15) held in conjunction with Euro-Par 2015, August 24-28, Vienna, Austria (Springer LNCS)

Re: [PATCH] x86: irq_comm: Add check for RH bit in kvm_set_msi_irq

2015-03-10 Thread Radim Krčmář
2015-03-09 23:05-0600, James Sullivan: Hi folks, This is a small patch that implements logic to handle the RH bit being set in the msi message address register. Currently the DM bit is the only thing used to decide irq-dest_mode (logical when DM set, physical when unset). Documentation

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: On 10/03/2015 19:21, Bandan Das wrote: Paolo Bonzini pbonz...@redhat.com writes: On 10/03/2015 17:57, Dr. David Alan Gilbert wrote: I'm seeing something similar; it's very intermittent and generally happening right at boot of the guest;

Re: 2 CPU Conformance Issue in KVM/x86

2015-03-10 Thread Avi Kivity
On 03/10/2015 12:47 PM, Paolo Bonzini wrote: On 09/03/2015 20:49, Avi Kivity wrote: Yes, and it checked that MAXPHYADDR != 52 before. If you want to set only one bit, making that bit 51 makes sense anyway for simplicity, so it is still 99.9% academic. Once processors appear with MAXPHYADDR =

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Paolo Bonzini
On 10/03/2015 19:21, Bandan Das wrote: Paolo Bonzini pbonz...@redhat.com writes: On 10/03/2015 17:57, Dr. David Alan Gilbert wrote: I'm seeing something similar; it's very intermittent and generally happening right at boot of the guest; I'm running this on qemu head+my postcopy world

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:06 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its physical address to the table. Otherwise the hardware gets unwanted access to physical memory between the end of

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Andrey Korolyov
On Tue, Mar 10, 2015 at 9:16 PM, Dr. David Alan Gilbert dgilb...@redhat.com wrote: * Andrey Korolyov (and...@xdel.ru) wrote: On Tue, Mar 10, 2015 at 7:57 PM, Dr. David Alan Gilbert dgilb...@redhat.com wrote: * Andrey Korolyov (and...@xdel.ru) wrote: On Sat, Mar 7, 2015 at 3:00 AM, Andrey

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: On 10/03/2015 17:57, Dr. David Alan Gilbert wrote: I'm seeing something similar; it's very intermittent and generally happening right at boot of the guest; I'm running this on qemu head+my postcopy world (but it's happening right at boot before

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: On 10/03/2015 19:21, Bandan Das wrote: Paolo Bonzini pbonz...@redhat.com writes: On 10/03/2015 17:57, Dr. David Alan Gilbert wrote: I'm seeing something similar; it's very intermittent and generally happening right at boot of the guest;

Re: [Qemu-devel] E5-2620v2 - emulation stop error

2015-03-10 Thread Paolo Bonzini
On 10/03/2015 19:16, Dr. David Alan Gilbert wrote: KVM internal error. Suberror: 1 emulation failure EAX= EBX= ECX= EDX=000fd2bc ESI= EDI= EBP= ESP= EIP=000fd2c5 EFL=00010007 [-PC] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0010

Re: [PATCH] x86: svm: make wbinvd faster

2015-03-10 Thread Marcelo Tosatti
On Tue, Mar 10, 2015 at 12:01:31PM +0100, Radim Krčmář wrote: 2015-03-09 20:28-0300, Marcelo Tosatti: On Fri, Feb 27, 2015 at 06:19:18PM -0600, Joel Schopp wrote: From: David Kaplan david.kap...@amd.com No need to re-decode WBINVD since we know what it is from the intercept.

Re: [PATCH] x86: irq_comm: Add check for RH bit in kvm_set_msi_irq

2015-03-10 Thread James Sullivan
On 03/10/2015 08:47 AM, Radim Krčmář wrote: ... +/* + * Set dest_mode to logical just in case both the RH and DM + * bits are set, otherwise default to physical. + */ +phys = ((e-msi.address_lo (MSI_ADDR_REDIRECTION_LOWPRI | +

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alex Williamson
On Wed, 2015-03-11 at 09:57 +1100, Alexey Kardashevskiy wrote: On 03/11/2015 06:56 AM, Alex Williamson wrote: On Tue, 2015-03-10 at 01:06 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alex Williamson
On Wed, 2015-03-11 at 10:14 +1100, Benjamin Herrenschmidt wrote: On Tue, 2015-03-10 at 17:03 -0600, Alex Williamson wrote: return (PAGE_SHIFT + compound_order(compound_head(page) = page_shift); This won't be bool though. Yes, it will. Don't you have your parenthesis in the

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alexey Kardashevskiy
On 03/11/2015 06:56 AM, Alex Williamson wrote: On Tue, 2015-03-10 at 01:06 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its physical address to the table. Otherwise the hardware gets unwanted

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Benjamin Herrenschmidt
On Tue, 2015-03-10 at 17:03 -0600, Alex Williamson wrote: return (PAGE_SHIFT + compound_order(compound_head(page) = page_shift); This won't be bool though. Yes, it will. Don't you have your parenthesis in the wrong place, Alex ? :-) This will (I'll do this) shift = PAGE_SHIFT

Re: [PATCH v5 07/29] vfio: powerpc/spapr: Moving pinning/unpinning to helpers

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: This is a pretty mechanical patch to make next patches simpler. New tce_iommu_unuse_page() helper does put_page() now but it might skip that after the memory registering patch applied. As we are here, this removes unnecessary

Re: [PATCH trivial] KVM: s390: Spelling s/intance/instance/

2015-03-10 Thread Christian Borntraeger
Am 09.03.2015 um 21:27 schrieb Geert Uytterhoeven: Signed-off-by: Geert Uytterhoeven geert+rene...@glider.be --- arch/s390/kvm/kvm-s390.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index

Re: [PATCH v5 03/29] vfio: powerpc/spapr: Check that TCE page size is equal to it_page_size

2015-03-10 Thread Alexey Kardashevskiy
On 03/11/2015 10:03 AM, Alex Williamson wrote: On Wed, 2015-03-11 at 09:57 +1100, Alexey Kardashevskiy wrote: On 03/11/2015 06:56 AM, Alex Williamson wrote: On Tue, 2015-03-10 at 01:06 +1100, Alexey Kardashevskiy wrote: This checks that the TCE table page size is not bigger that the size of a

Re: [PATCH v3 0/2] kvm: x86: kvm_emulate_*

2015-03-10 Thread Marcelo Tosatti
On Mon, Mar 02, 2015 at 01:43:24PM -0600, Joel Schopp wrote: Review comments from v1 that used kvm_emulate_wbinvd() pointed out that kvm_emulate_* was inconsistant in using skipping, while kvm_emulate() always skips. The first patch cleans up the existing use while the second patch adds use

Re: [PATCH v5 26/29] vfio: powerpc/spapr: Define v2 IOMMU

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: The existing IOMMU code takes/releases ownership over the existing IOMMU tables created by the platform code, i.e. the tables remain in memory all the time. Also, the existing IOMMU requires VFIO_IOMMU_ENABLE call to start working

Re: [PATCH v5 27/29] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework ownership

2015-03-10 Thread Alex Williamson
On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: Before the IOMMU user would take control over the IOMMU table belonging to a specific IOMMU group. This approach did not allow sharing tables between IOMMU groups attached to the same container. This introduces a new IOMMU

Re: [PATCH] kvm: move advertising of KVM_CAP_IRQFD to common code

2015-03-10 Thread Marcelo Tosatti
On Thu, Mar 05, 2015 at 11:54:46AM +0100, Paolo Bonzini wrote: POWER supports irqfds but forgot to advertise them. Some userspace does not check for the capability, but others check it---thus they work on x86 and s390 but not POWER. To avoid that other architectures in the future make the

Re: [PATCH v5 27/29] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework ownership

2015-03-10 Thread Alexey Kardashevskiy
On 03/11/2015 11:09 AM, Alex Williamson wrote: On Tue, 2015-03-10 at 01:07 +1100, Alexey Kardashevskiy wrote: Before the IOMMU user would take control over the IOMMU table belonging to a specific IOMMU group. This approach did not allow sharing tables between IOMMU groups attached to the same