Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-04 Thread Denis V. Lunev
On 12/04/2015 08:38 PM, Paolo Bonzini wrote: On 04/12/2015 17:55, Denis V. Lunev wrote: On 12/04/2015 05:41 PM, Paolo Bonzini wrote: On 04/12/2015 15:33, Denis V. Lunev wrote: On 12/02/2015 03:22 PM, Paolo Bonzini wrote: On 30/11/2015 17:22, Andrey Smetanin wrote: enum hv_message_type

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-04 Thread Paolo Bonzini
> >> we are now comparing enum with enum which are the same type. > >> With the change you are proposing we will compare enum > >> with u32 which are different. > > This is only an issue in C++. > > > >> Original suggestion from Andrey was safe in this respect. > > Sure, but it makes code less

Re: [PATCH v2 0/5] Add virtio transport for AF_VSOCK

2015-12-03 Thread Michael S. Tsirkin
On Wed, Dec 02, 2015 at 02:43:58PM +0800, Stefan Hajnoczi wrote: > v2: > * Rebased onto Linux v4.4-rc2 > * vhost: Refuse to assign reserved CIDs > * vhost: Refuse guest CID if already in use > * vhost: Only accept correctly addressed packets (no spoofing!) > * vhost: Support flexible rx/tx

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-03 Thread Lan, Tianyu
On 12/2/2015 10:31 PM, Michael S. Tsirkin wrote: >We hope >to find a better way to make SRIOV NIC work in these cases and this is >worth to do since SRIOV NIC provides better network performance compared >with PV NIC. If this is a performance optimization as the above implies, you need to

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Pavel Fedin
Hello! > > > Cc: sta...@vger.kernel.org > > > Fixes: e6fab5442345 ("ARM/arm64: KVM: test properly for a PTE's > > > uncachedness") > > > > > > > That commit is not in a release yet, so no need for cc stable > [...] > > But it is cc'd to stable, so unless it is going to be nacked at review >

Re: [PATCH 1/3] KVM: arm64: Correctly handle zero register during MMIO

2015-12-03 Thread Marc Zyngier
On 03/12/15 09:58, Pavel Fedin wrote: > On ARM64 register index of 31 corresponds to both zero register and SP. > However, all memory access instructions, use ZR as transfer register. SP > is used only as a base register in indirect memory addressing, or by > register-register arithmetics, which

Re: [PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-03 Thread Marc Zyngier
On 03/12/15 10:53, Pavel Fedin wrote: > Hello! > >>> The problem has been discovered by performing an operation >>> >>> *((volatile int *)reg) = 0; >>> >>> which compiles as "str xzr, [xx]", and resulted in strange values being >>> written. >> >> Interesting find. Which compiler is that? > > $

RE: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Pavel Fedin
Hello! > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > > index 87a64e8..a667228 100644 > > --- a/arch/arm64/kvm/sys_regs.c > > +++ b/arch/arm64/kvm/sys_regs.c > > @@ -102,7 +102,7 @@ static bool access_vm_reg(struct kvm_vcpu *vcpu, > > > > BUG_ON(!p->is_write); > > >

Re: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Marc Zyngier
On 03/12/15 11:08, Pavel Fedin wrote: > Hello! > >>> diff --git a/arch/arm64/kvm/sys_regs.c >>> b/arch/arm64/kvm/sys_regs.c index 87a64e8..a667228 100644 --- >>> a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ >>> -102,7 +102,7 @@ static bool access_vm_reg(struct kvm_vcpu >>>

RE: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Pavel Fedin
Hello! > > It's simply more convenient to use a pointer for exchange with > > userspace, see vgic_v3_cpu_regs_access() and callers. I wouldn't like > > to refactor the code again. What's your opinion on this? > > I still don't think this is a good idea. You can still store the value > as an

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Ard Biesheuvel
On 3 December 2015 at 08:14, Pavel Fedin wrote: > Hello! > >> > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >> > index 7dace90..51ad98f 100644 >> > --- a/arch/arm/kvm/mmu.c >> > +++ b/arch/arm/kvm/mmu.c >> > @@ -310,7 +310,8 @@ static void stage2_flush_ptes(struct

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-03 Thread Marc Zyngier
On Wed, 2 Dec 2015 16:34:56 -0600 Andrew Jones wrote: > On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > > KVM so far relies on code patching, and is likely to use it more > > in the future. The main issue is that our alternative system works > > at the

Re: [RFC PATCH V2 09/10] Qemu/VFIO: Add SRIOV VF migration support

2015-12-03 Thread Lan, Tianyu
On 12/3/2015 6:25 AM, Alex Williamson wrote: On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: This patch is to add SRIOV VF migration support. Create new device type "vfio-sriov" and add faked PCI migration capability to the type device. The purpose of the new capability 1) sync

Re: [RFC PATCH V2 06/10] Qemu/PCI: Add macros for faked PCI migration capability

2015-12-03 Thread Lan, Tianyu
On 12/3/2015 6:25 AM, Alex Williamson wrote: This will of course break if the PCI SIG defines that capability index. Couldn't this be done within a vendor defined capability? Thanks, Yes, it should work and thanks for suggestion. -- To unsubscribe from this list: send the line "unsubscribe

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Pavel Fedin
Hello! > >> I think your analysis is correct, but does that not apply to both > >> instances? > > > > No no, another one is correct, since it operates on real PFN (at least > > looks like so). I > have verified my fix against the original problem (crash on Exynos5410 > without generic

RE: [PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-03 Thread Pavel Fedin
Hello! > > The problem has been discovered by performing an operation > > > > *((volatile int *)reg) = 0; > > > > which compiles as "str xzr, [xx]", and resulted in strange values being > > written. > > Interesting find. Which compiler is that? $ aarch64-linux-gnu-gcc --version

Re: [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition

2015-12-03 Thread Lan, Tianyu
On 12/3/2015 6:25 AM, Alex Williamson wrote: I didn't seen a matching kernel patch series for this, but why is the kernel more capable of doing this than userspace is already? The following link is the kernel patch. http://marc.info/?l=kvm=144837328920989=2 These seem like pointless ioctls,

Re: [PATCH 0/3] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-03 Thread Marc Zyngier
On 03/12/15 09:58, Pavel Fedin wrote: > ARM64 CPU has zero register which is read-only, with a value of 0. > However, KVM currently incorrectly recognizes it being SP (because > Rt == 31, and in struct user_pt_regs 'regs' array is followed by SP), > resulting in invalid value being read, or even

Re: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Marc Zyngier
Pavel, On 03/12/15 09:58, Pavel Fedin wrote: > System register accesses also use zero register for Rt == 31, and > therefore using it will also result in getting SP value instead. This > patch makes them also using new accessors, introduced by the previous > patch. > > Additionally, got rid of

RE: [PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-12-03 Thread Pavel Fedin
Hello! > I like that you're making this transparent > for the user, but at the same time, directly calling function pointers > through the msi_domain_ops is quite ugly. Do you mean dereferencing info->ops->vfio_map() in .c code? I can introduce some wrappers in include/linux/msi.h like

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-03 Thread Lan, Tianyu
On 12/2/2015 10:31 PM, Michael S. Tsirkin wrote: >We hope >to find a better way to make SRIOV NIC work in these cases and this is >worth to do since SRIOV NIC provides better network performance compared >with PV NIC. If this is a performance optimization as the above implies, you need to

Re: [PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-12-03 Thread Marc Zyngier
On Thu, 3 Dec 2015 16:16:54 +0300 Pavel Fedin wrote: Pavel, > Hello! > > > I like that you're making this transparent > > for the user, but at the same time, directly calling function pointers > > through the msi_domain_ops is quite ugly. > > Do you mean dereferencing

Re: [PATCH 2/3] KVM: arm64: Correctly handle zero register in system register accesses

2015-12-03 Thread Marc Zyngier
On 03/12/15 11:55, Pavel Fedin wrote: > Hello! > >>> It's simply more convenient to use a pointer for exchange with >>> userspace, see vgic_v3_cpu_regs_access() and callers. I wouldn't like >>> to refactor the code again. What's your opinion on this? >> >> I still don't think this is a good

Re: [PATCH] KVM: VMX: fix the writing POSTED_INTR_NV

2015-12-03 Thread Paolo Bonzini
On 03/12/2015 06:29, roy.qing...@gmail.com wrote: > From: Li RongQing > > POSTED_INTR_NV is 16bit, should not use 64bit write function > > [ 5311.676074] vmwrite error: reg 3 value 0 (err 12) > [ 5311.680001] CPU: 49 PID: 4240 Comm: qemu-system-i38 Tainted: G I >

Re: [PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-12-03 Thread Alex Williamson
On Thu, 2015-12-03 at 16:16 +0300, Pavel Fedin wrote: > Hello! > > > I like that you're making this transparent > > for the user, but at the same time, directly calling function pointers > > through the msi_domain_ops is quite ugly. > > Do you mean dereferencing info->ops->vfio_map() in .c

Re: [PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-12-03 Thread Marc Zyngier
On 14/11/15 22:12, Mario Smarduch wrote: > This patch adds vcpu fields to track lazy state, save host FPEXC, and > offsets to fields. > > Signed-off-by: Mario Smarduch > --- > arch/arm/include/asm/kvm_host.h | 6 ++ > arch/arm/kernel/asm-offsets.c | 2 ++ > 2 files

Re: [PATCH v4 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-12-03 Thread Marc Zyngier
On 14/11/15 22:12, Mario Smarduch wrote: > This patch tracks armv7 fp/simd hardware state with a vcpu lazy flag. > On vcpu_load saves host fpexc and enables FP access, and later enables fp/simd > trapping if lazy flag is not set. On first fp/simd access trap to handler > to save host and restore

Re: [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition

2015-12-03 Thread Alex Williamson
On Thu, 2015-12-03 at 16:40 +0800, Lan, Tianyu wrote: > On 12/3/2015 6:25 AM, Alex Williamson wrote: > > I didn't seen a matching kernel patch series for this, but why is the > > kernel more capable of doing this than userspace is already? > The following link is the kernel patch. >

Re: [PATCH v4 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-03 Thread Marc Zyngier
On 14/11/15 22:12, Mario Smarduch wrote: > This patch tracks armv7 and armv8 fp/simd hardware state with a vcpu lazy > flag. > On vcpu_load for 32 bit guests enable FP access, and later enable fp/simd > trapping for 32 and 64 bit guests if lazy flag is not set. On first fp/simd > access trap to

Re: [PATCH v2 0/5] Add virtio transport for AF_VSOCK

2015-12-03 Thread David Miller
From: Stefan Hajnoczi Date: Wed, 2 Dec 2015 14:43:58 +0800 > This patch series adds a virtio transport for AF_VSOCK (net/vmw_vsock/). Series applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to

Re: [PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-12-03 Thread Mario Smarduch
On 12/3/2015 7:46 AM, Marc Zyngier wrote: > On 14/11/15 22:12, Mario Smarduch wrote: >> This patch adds vcpu fields to track lazy state, save host FPEXC, and >> offsets to fields. >> >> Signed-off-by: Mario Smarduch >> --- >> arch/arm/include/asm/kvm_host.h | 6 ++

Re: [PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-12-03 Thread Marc Zyngier
On 03/12/15 19:21, Mario Smarduch wrote: > > > On 12/3/2015 7:46 AM, Marc Zyngier wrote: >> On 14/11/15 22:12, Mario Smarduch wrote: >>> This patch adds vcpu fields to track lazy state, save host FPEXC, and >>> offsets to fields. >>> >>> Signed-off-by: Mario Smarduch >>>

Re: [PATCH 0/5] Threaded MSI interrupt for VFIO PCI device

2015-12-03 Thread Yunhong Jiang
On Thu, Dec 03, 2015 at 11:55:53AM -0700, Alex Williamson wrote: > On Thu, 2015-12-03 at 10:22 -0800, Yunhong Jiang wrote: > > When assigning a VFIO device to a KVM guest with low latency requirement, > > it > > is better to handle the interrupt in the hard interrupt context, to reduce > > the

Re: [PATCH 0/5] Threaded MSI interrupt for VFIO PCI device

2015-12-03 Thread Alex Williamson
On Thu, 2015-12-03 at 10:22 -0800, Yunhong Jiang wrote: > When assigning a VFIO device to a KVM guest with low latency requirement, it > is better to handle the interrupt in the hard interrupt context, to reduce > the context switch to/from the IRQ thread. > > Based on discussion on

Re: [PATCH v4 1/3] KVM/arm/arm64: add hooks for armv7 fp/simd lazy switch support

2015-12-03 Thread Mario Smarduch
On 12/3/2015 11:24 AM, Marc Zyngier wrote: > On 03/12/15 19:21, Mario Smarduch wrote: >> >> >> On 12/3/2015 7:46 AM, Marc Zyngier wrote: >>> On 14/11/15 22:12, Mario Smarduch wrote: This patch adds vcpu fields to track lazy state, save host FPEXC, and offsets to fields.

Re: [PATCH] KVM: VMX: fix the writing POSTED_INTR_NV

2015-12-03 Thread Li RongQing
On Thu, Dec 3, 2015 at 9:58 PM, Paolo Bonzini wrote: > Indeed this is a problem for 32-bit hosts. I meet this error when I run a 32bit kernel on Intel Wildcat Pass platform -Roy -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to

Re: [PATCH 4/5] KVM: Add the irq handling consumer

2015-12-03 Thread kbuild test robot
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system] Hi Yunhong, [auto build test ERROR on kvm/linux-next] [also build test ERROR on v4.4-rc3 next-20151202] url:

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-03 Thread Alexander Duyck
On Wed, Dec 2, 2015 at 6:08 AM, Lan, Tianyu wrote: > On 12/1/2015 11:02 PM, Michael S. Tsirkin wrote: >>> >>> But >>> it requires guest OS to do specific configurations inside and rely on >>> bonding driver which blocks it work on Windows. >>> From performance side, >>>

Re: [PATCH v4 3/3] KVM/arm/arm64: enable enhanced armv8 fp/simd lazy switch

2015-12-03 Thread Mario Smarduch
On 12/3/2015 8:13 AM, Marc Zyngier wrote: > On 14/11/15 22:12, Mario Smarduch wrote: >> This patch tracks armv7 and armv8 fp/simd hardware state with a vcpu lazy >> flag. >> On vcpu_load for 32 bit guests enable FP access, and later enable fp/simd >> trapping for 32 and 64 bit guests if lazy

Re: [PATCH] KVM: VMX: fix the writing POSTED_INTR_NV

2015-12-03 Thread Yang Zhang
On 2015/12/3 13:29, roy.qing...@gmail.com wrote: From: Li RongQing POSTED_INTR_NV is 16bit, should not use 64bit write function [ 5311.676074] vmwrite error: reg 3 value 0 (err 12) [ 5311.680001] CPU: 49 PID: 4240 Comm: qemu-system-i38 Tainted: G I

Re: [PATCH v4 2/3] KVM/arm/arm64: enable enhanced armv7 fp/simd lazy switch

2015-12-03 Thread Mario Smarduch
On 12/3/2015 7:58 AM, Marc Zyngier wrote: > On 14/11/15 22:12, Mario Smarduch wrote: >> This patch tracks armv7 fp/simd hardware state with a vcpu lazy flag. >> On vcpu_load saves host fpexc and enables FP access, and later enables >> fp/simd >> trapping if lazy flag is not set. On first

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-03 Thread Ben Hutchings
On Wed, 2015-12-02 at 18:41 +0100, Ard Biesheuvel wrote: > Hi Pavel, > > Thanks for getting to the bottom of this. > > On 1 December 2015 at 14:03, Pavel Fedin wrote: > > This function takes stage-II physical addresses (A.K.A. IPA), on input, not > > real physical

Re: [PATCH] KVM: VMX: fix read/write sizes of VMCS fields

2015-12-03 Thread Yang Zhang
On 2015/12/3 23:11, Paolo Bonzini wrote: In theory this should have broken EPT on 32-bit kernels (due to reading the high part of natural-width field GUEST_CR3). Not sure if no one noticed or the processor behaves differently from the documentation. It seems we will check the success of

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-03 Thread Jason Wang
On 12/02/2015 08:36 PM, Michael S. Tsirkin wrote: > On Wed, Dec 02, 2015 at 01:04:03PM +0800, Jason Wang wrote: >> >> On 12/01/2015 10:43 PM, Michael S. Tsirkin wrote: >>> On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: > On

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 10:22:04AM +, Marc Zyngier wrote: > On 02/12/15 09:49, Shannon Zhao wrote: > > > > > > On 2015/12/2 16:45, Marc Zyngier wrote: > >> On 02/12/15 02:40, Shannon Zhao wrote: > > > On 2015/12/2 0:57, Marc Zyngier wrote: > >> On 01/12/15 16:26, Shannon

Re: [PATCH v2 19/21] arm64: KVM: Turn system register numbers to an enum

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:51, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:13PM +, Marc Zyngier wrote: >> Having the system register numbers as #defines has been a pain >> since day one, as the ordering is pretty fragile, and moving >> things around leads to renumbering and epic conflict

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 01:19:22PM +, Marc Zyngier wrote: > On 02/12/15 11:53, Christoffer Dall wrote: > > On Wed, Dec 02, 2015 at 09:47:43AM +, Marc Zyngier wrote: > >> On 02/12/15 09:27, Christoffer Dall wrote: > >>> On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: > On

Re: [PATCH v2 16/21] arm64: KVM: Add compatibility aliases

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:49, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:10PM +, Marc Zyngier wrote: >> So far, we've implemented the new world switch with a completely >> different namespace, so that we could have both implementation >> compiled in. >> >> Let's take things one step further

Re: [PATCH v2 12/21] arm64: KVM: Implement fpsimd save/restore

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:53, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:06PM +, Marc Zyngier wrote: >> Implement the fpsimd save restore, keeping the lazy part in >> assembler (as returning to C would be overkill). >> >> Signed-off-by: Marc Zyngier >> --- >>

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:47, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: >> As we've now switched to the new world switch implementation, >> remove the weak attributes, as nobody is supposed to override >> it anymore. > > Why not remove the aliases and change the

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 03:21:49PM +, Marc Zyngier wrote: > On 02/12/15 11:47, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: > >> As we've now switched to the new world switch implementation, > >> remove the weak attributes, as nobody is supposed to

Re: [PATCH v2 12/21] arm64: KVM: Implement fpsimd save/restore

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 03:29:50PM +, Marc Zyngier wrote: > On 02/12/15 11:53, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:06PM +, Marc Zyngier wrote: > >> Implement the fpsimd save restore, keeping the lazy part in > >> assembler (as returning to C would be overkill). > >> >

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-02 Thread Michael S. Tsirkin
On Wed, Dec 02, 2015 at 10:08:25PM +0800, Lan, Tianyu wrote: > On 12/1/2015 11:02 PM, Michael S. Tsirkin wrote: > >>But > >>it requires guest OS to do specific configurations inside and rely on > >>bonding driver which blocks it work on Windows. > >> From performance side, > >>putting VF and

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Marc Zyngier
On 02/12/15 16:21, Christoffer Dall wrote: > On Wed, Dec 02, 2015 at 03:21:49PM +, Marc Zyngier wrote: >> On 02/12/15 11:47, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: As we've now switched to the new world switch implementation, remove

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Ard Biesheuvel
Hi Pavel, Thanks for getting to the bottom of this. On 1 December 2015 at 14:03, Pavel Fedin wrote: > This function takes stage-II physical addresses (A.K.A. IPA), on input, not > real physical addresses. This causes kvm_is_device_pfn() to return wrong > values, depending

Re: [PATCH] KVM: arm/arm64: vgic: make vgic_io_ops static

2015-12-02 Thread Christoffer Dall
On Thu, Nov 12, 2015 at 07:59:14PM +0800, Jisheng Zhang wrote: > vgic_io_ops is only referenced within vgic.c, so it can be declared > static. > > Signed-off-by: Jisheng Zhang Applied to queue, -Christoffer -- To unsubscribe from this list: send the line "unsubscribe kvm"

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Ard Biesheuvel
On 2 December 2015 at 19:50, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: >> This function takes stage-II physical addresses (A.K.A. IPA), on input, not >> real physical addresses. This causes kvm_is_device_pfn() to return

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 08:04:42PM +0100, Ard Biesheuvel wrote: > On 2 December 2015 at 19:50, Christoffer Dall > wrote: > > On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: > >> This function takes stage-II physical addresses (A.K.A. IPA), on input, not >

Re: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 04:03:52PM +0300, Pavel Fedin wrote: > This function takes stage-II physical addresses (A.K.A. IPA), on input, not > real physical addresses. This causes kvm_is_device_pfn() to return wrong > values, depending on how much guest and host memory maps match. This > results in

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Marc Zyngier
On 02/12/15 02:40, Shannon Zhao wrote: > > > On 2015/12/2 0:57, Marc Zyngier wrote: >> On 01/12/15 16:26, Shannon Zhao wrote: >>> >>> >>> On 2015/12/1 23:41, Marc Zyngier wrote: > The reason is that when guest clear the overflow register, it will trap >> to kvm and call

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Christoffer Dall
On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: > On 01/12/15 15:39, Christoffer Dall wrote: > > On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > >> KVM so far relies on code patching, and is likely to use it more > >> in the future. The main issue is that our

RE: BUG ALERT: ARM32 KVM does not work in 4.4-rc3

2015-12-02 Thread Pavel Fedin
Hello! > > My project involves ARM64, but from time to time i also test ARM32 > > KVM. I have discovered that it stopped working in 4.4-rc3. The same > > virtual machine works perfectly under current kvmarm/next, but gets > > stuck at random point under 4.4-rc3 from linux-stable. I'm not sure >

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Andrew Jones
On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > KVM so far relies on code patching, and is likely to use it more > in the future. The main issue is that our alternative system works > at the instruction level, while we'd like to have alternatives at > the function level. How about

Re: [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > Signed-off-by: Lan Tianyu > --- > linux-headers/linux/vfio.h | 16 > 1 file changed, 16 insertions(+) > > diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h > index 0508d0b..732b0bd

Re: [PATCH v2 0/3] Introduce MSI hardware mapping for VFIO

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 16:50 +0300, Pavel Fedin wrote: > On some architectures (e.g. ARM64) if the device is behind an IOMMU, and > is being mapped by VFIO, it is necessary to also add mappings for MSI > translation register for interrupts to work. This series implements the > necessary API to do

Re: [RFC PATCH V2 09/10] Qemu/VFIO: Add SRIOV VF migration support

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > This patch is to add SRIOV VF migration support. > Create new device type "vfio-sriov" and add faked PCI migration capability > to the type device. > > The purpose of the new capability > 1) sync migration status with VF driver in the VM > 2)

Re: [RFC PATCH V2 06/10] Qemu/PCI: Add macros for faked PCI migration capability

2015-12-02 Thread Alex Williamson
On Tue, 2015-11-24 at 21:35 +0800, Lan Tianyu wrote: > This patch is to extend PCI CAP id for migration cap and > add reg macros. The CAP ID is trial and we may find better one if the > solution is feasible. > > *PCI_VF_MIGRATION_CAP > For VF driver to control that triggers mailbox irq or not

RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes().

2015-12-02 Thread Pavel Fedin
Hello! > > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c > > index 7dace90..51ad98f 100644 > > --- a/arch/arm/kvm/mmu.c > > +++ b/arch/arm/kvm/mmu.c > > @@ -310,7 +310,8 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t > > *pmd, > > > > pte = pte_offset_kernel(pmd, addr);

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Shannon Zhao
On 2015/12/2 16:45, Marc Zyngier wrote: > On 02/12/15 02:40, Shannon Zhao wrote: >> > >> > >> > On 2015/12/2 0:57, Marc Zyngier wrote: >>> >> On 01/12/15 16:26, Shannon Zhao wrote: >>> >>> >>> On 2015/12/1 23:41, Marc Zyngier wrote: >> > The reason is that when guest

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Marc Zyngier
On 02/12/15 09:27, Christoffer Dall wrote: > On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: >> On 01/12/15 15:39, Christoffer Dall wrote: >>> On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: KVM so far relies on code patching, and is likely to use it more in

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-02 Thread Marc Zyngier
On 02/12/15 09:49, Shannon Zhao wrote: > > > On 2015/12/2 16:45, Marc Zyngier wrote: >> On 02/12/15 02:40, Shannon Zhao wrote: On 2015/12/2 0:57, Marc Zyngier wrote: >> On 01/12/15 16:26, Shannon Zhao wrote: On 2015/12/1 23:41, Marc Zyngier wrote:

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-02 Thread Michael S. Tsirkin
On Tue, Dec 01, 2015 at 10:36:33AM -0800, Alexander Duyck wrote: > On Tue, Dec 1, 2015 at 9:37 AM, Michael S. Tsirkin wrote: > > On Tue, Dec 01, 2015 at 09:04:32AM -0800, Alexander Duyck wrote: > >> On Tue, Dec 1, 2015 at 7:28 AM, Michael S. Tsirkin wrote: > >

Re: [PATCH v2 16/21] arm64: KVM: Add compatibility aliases

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:10PM +, Marc Zyngier wrote: > So far, we've implemented the new world switch with a completely > different namespace, so that we could have both implementation > compiled in. > > Let's take things one step further by adding weak aliases that > have the same names

Re: [PATCH v2 12/21] arm64: KVM: Implement fpsimd save/restore

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:06PM +, Marc Zyngier wrote: > Implement the fpsimd save restore, keeping the lazy part in > assembler (as returning to C would be overkill). > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile| 1 + >

Re: [PATCH v2 13/21] arm64: KVM: Implement TLB handling

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:07PM +, Marc Zyngier wrote: > Implement the TLB handling as a direct translation of the assembly > code version. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/Makefile | 1 + > arch/arm64/kvm/hyp/tlb.c| 72 >

Re: [PATCH v2 15/21] arm64: KVM: Add panic handling

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:09PM +, Marc Zyngier wrote: > Add the panic handler, together with the small bits of assembly > code to call the kernel's panic implementation. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/hyp-entry.S | 11 ++- >

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Christoffer Dall
On Wed, Dec 02, 2015 at 09:47:43AM +, Marc Zyngier wrote: > On 02/12/15 09:27, Christoffer Dall wrote: > > On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: > >> On 01/12/15 15:39, Christoffer Dall wrote: > >>> On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: >

Re: [PATCH v2 14/21] arm64: KVM: HYP mode entry points

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:08PM +, Marc Zyngier wrote: > Add the entry points for HYP mode (both for hypercalls and > exception handling). > > Signed-off-by: Marc Zyngier Reviewed-by: Christoffer Dall -- To unsubscribe from this list:

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-02 Thread Michael S. Tsirkin
On Wed, Dec 02, 2015 at 01:04:03PM +0800, Jason Wang wrote: > > > On 12/01/2015 10:43 PM, Michael S. Tsirkin wrote: > > On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: > >> > >> On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: > >>> On Wed, Nov 25, 2015 at 03:11:29PM +0800, Jason

Re: [PATCH v2 21/21] arm64: KVM: Remove weak attributes

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:15PM +, Marc Zyngier wrote: > As we've now switched to the new world switch implementation, > remove the weak attributes, as nobody is supposed to override > it anymore. Why not remove the aliases and change the callers? -Christoffer > > Signed-off-by: Marc

Re: [PATCH v2 20/21] arm64: KVM: Cleanup asm-offset.c

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:14PM +, Marc Zyngier wrote: > As we've now rewritten most of our code-base in C, most of the > KVM-specific code in asm-offset.c is useless. Delete-time again! > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall

Re: [PATCH v2 19/21] arm64: KVM: Turn system register numbers to an enum

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:13PM +, Marc Zyngier wrote: > Having the system register numbers as #defines has been a pain > since day one, as the ordering is pretty fragile, and moving > things around leads to renumbering and epic conflict resolutions. > > Now that we're mostly acessing the

Re: [PATCH v2 18/21] arm64: KVM: Move away from the assembly version of the world switch

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:12PM +, Marc Zyngier wrote: > This is it. We remove all of the code that has now been rewritten. > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall -- To unsubscribe from this list: send the line

Re: [PATCH v2 17/21] arm64: KVM: Map the kernel RO section into HYP

2015-12-02 Thread Christoffer Dall
On Fri, Nov 27, 2015 at 06:50:11PM +, Marc Zyngier wrote: > In order to run C code in HYP, we must make sure that the kernel's > RO section in mapped into HYP (otherwise things break badly). > > Signed-off-by: Marc Zyngier Acked-by: Christoffer Dall

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 12:06, Christian Borntraeger wrote: > + memcpy(>run->s.regs.gprs[14], >arch.sie_block->gg14, 16); This is preexisting but... boy it's ugly. :) Do you gain much over the simpler vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14;

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-02 Thread Paolo Bonzini
On 30/11/2015 17:22, Andrey Smetanin wrote: > enum hv_message_type inside struct hv_message, hv_post_message > is not size portable. Replace enum by u32. It's only non-portable inside structs. Okay to apply just these: @@ -172,7 +174,7 @@ union hv_message_flags { /* Define synthetic

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Christian Borntraeger
On 12/02/2015 01:20 PM, Paolo Bonzini wrote: > > > On 02/12/2015 12:06, Christian Borntraeger wrote: >> +memcpy(>run->s.regs.gprs[14], >arch.sie_block->gg14, 16); > > This is preexisting but... boy it's ugly. :) > > Do you gain much over the simpler > > vcpu->run->s.regs.gprs[14] =

Re: [GIT PULL 00/23] KVM: s390 features, kvm_get_vcpu_by_id and stat for 4.5

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 12:06, Christian Borntraeger wrote: > Paolo, > > here is the first s390 pull request for 4.5. It also contains the > remaining vcpu lookup changes and an improved cleanup of the kvm_stat > exit path. > I have deferred the kvm_stat per VM patches. > > The s390 changes are: > -

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 14:04, Christian Borntraeger wrote: >> > Do you gain much over the simpler >> > >> >vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14; >> >vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15; >> > > Its just legacy code from the old days. > There is a

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Marc Zyngier
On 02/12/15 11:53, Christoffer Dall wrote: > On Wed, Dec 02, 2015 at 09:47:43AM +, Marc Zyngier wrote: >> On 02/12/15 09:27, Christoffer Dall wrote: >>> On Tue, Dec 01, 2015 at 06:51:00PM +, Marc Zyngier wrote: On 01/12/15 15:39, Christoffer Dall wrote: > On Fri, Nov 27, 2015 at

Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC

2015-12-02 Thread Lan, Tianyu
On 12/1/2015 11:02 PM, Michael S. Tsirkin wrote: But it requires guest OS to do specific configurations inside and rely on bonding driver which blocks it work on Windows. From performance side, putting VF and virtio NIC under bonded interface will affect their performance even when not do

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Christian Borntraeger
On 12/02/2015 02:05 PM, Paolo Bonzini wrote: > > > On 02/12/2015 14:04, Christian Borntraeger wrote: Do you gain much over the simpler vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14; vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15; >> Its just

Re: gva_to_gpa function internals

2015-12-01 Thread Yacine HEBBAL
In fact, my tool walks through paging data structures (entry by entry) using the function "kvm_read_guest" (sorry i don't have my machine with me right now to poste my code :-( ). for example to read PDPTEs, I do something like this: for(i = 0; i < 32; i= i + 8) { kvm_read_guest(kvm, cr3

Re: gva_to_gpa function internals

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 19:30, Yacine HEBBAL wrote: > Hi all, > I'm trying to build some tools on top of kvm in order to debug, monitor and > reverse engineer the guest OS (ubuntu 12.04, 32 bits) > One of my tools walks through (and prints) the guest paging data structures > as following: cr3 -> pdpte ->

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Daniel Axtens
"Geyslan G. Bem" writes: > The vcpu_book3s struct is assigned but never used. So remove it. Just out of interest, how did you find this? Compiler warning? Static analysis? Manual inspection? Thanks in advance! Regards, Daniel > > Signed-off-by: Geyslan G. Bem

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Daniel Axtens
"Geyslan G. Bem" writes: > The vcpu_book3s struct is assigned but never used. So remove it. Just out of interest, how did you find this? Compiler warning? Static analysis? Manual inspection? Thanks in advance! Regards, Daniel > > Signed-off-by: Geyslan G. Bem

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Geyslan G. Bem
2015-12-01 21:34 GMT-03:00 Daniel Axtens : > "Geyslan G. Bem" writes: > >> The vcpu_book3s struct is assigned but never used. So remove it. > > Just out of interest, how did you find this? Compiler warning? Static > analysis? Manual inspection? Sorry, I should

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-01 Thread Geyslan G. Bem
2015-12-01 21:34 GMT-03:00 Daniel Axtens : > "Geyslan G. Bem" writes: > >> The vcpu_book3s struct is assigned but never used. So remove it. > > Just out of interest, how did you find this? Compiler warning? Static > analysis? Manual inspection? Sorry, I should

Re: [PATCH v4 18/21] KVM: ARM64: Add PMU overflow interrupt routing

2015-12-01 Thread Shannon Zhao
On 2015/12/2 0:57, Marc Zyngier wrote: > On 01/12/15 16:26, Shannon Zhao wrote: >> >> >> On 2015/12/1 23:41, Marc Zyngier wrote: The reason is that when guest clear the overflow register, it will trap > to kvm and call kvm_pmu_sync_hwstate() as you see above. At this moment, > the

Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-12-01 Thread Alexander Duyck
On Tue, Dec 1, 2015 at 7:28 AM, Michael S. Tsirkin wrote: > On Tue, Dec 01, 2015 at 11:04:31PM +0800, Lan, Tianyu wrote: >> >> >> On 12/1/2015 12:07 AM, Alexander Duyck wrote: >> >They can only be corrected if the underlying assumptions are correct >> >and they aren't. Your

<    3   4   5   6   7   8   9   10   11   12   >