Re: [PATCH 2/2] KVM: PPC: Book3E: Add LRAT error exception handler

2013-07-03 Thread Benjamin Herrenschmidt
On Thu, 2013-07-04 at 06:47 +, Caraman Mihai Claudiu-B02008 wrote: > This is a solid reason. Ben it's ok for you to apply the combined > patch? If so I will respin it. Sure, but nowadays, all that stuff goes via Scott and Alex. Cheers, Ben. -- To unsubscribe from this list: send the line "u

Re: [PATCH v4 2/2] KVM: s390: use cookies for ioeventfd

2013-07-03 Thread Paolo Bonzini
Il 03/07/2013 18:33, Cornelia Huck ha scritto: > On Wed, 03 Jul 2013 17:30:40 +0200 > Paolo Bonzini wrote: > >> Il 03/07/2013 16:30, Cornelia Huck ha scritto: >>> + /* >>> +* Return cookie in gpr 2, but don't overwrite the register if the >>> +* diagnose will be handled by userspace. >>

RE: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- > ow...@vger.kernel.org] On Behalf Of Alexander Graf > Sent: Wednesday, July 03, 2013 9:40 PM > To: Wood Scott-B07421 > Cc: Caraman Mihai Claudiu-B02008; kvm-...@vger.kernel.org; > kvm@vger.kernel.org; linuxppc-..

RE: [PATCH 2/2] KVM: PPC: Book3E: Add LRAT error exception handler

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, July 03, 2013 11:17 PM > To: Caraman Mihai Claudiu-B02008 > Cc: linuxppc-...@lists.ozlabs.org; kvm-...@vger.kernel.org; > kvm@vger.kernel.org; Caraman Mihai Claudiu-B02008 > Subject: Re: [PATCH 2/2] KVM: PPC: Book3E: Add LRAT

RE: [PATCH 1/2] powerpc/booke64: Add LRAT error exception handler

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, July 03, 2013 11:18 PM > To: Caraman Mihai Claudiu-B02008 > Cc: linuxppc-...@lists.ozlabs.org; kvm-...@vger.kernel.org; > kvm@vger.kernel.org; Caraman Mihai Claudiu-B02008 > Subject: Re: [PATCH 1/2] powerpc/booke64: Add LRAT

Re: [PATCH] KVM : Set success rflags when emulate VMXON/VMXOFF in nested virt

2013-07-03 Thread Gleb Natapov
On Thu, Jul 04, 2013 at 12:09:32AM +0800, Arthur Chunqi Li wrote: > Before moving the 3 functions ahead, they will be declared twice in > the same file before handle_vmon(). I don't know if this small change > can be committed together in one patch. If this change is needless or > should be committ

Re: [PATCH] KVM : Set success rflags when emulate VMXON/VMXOFF in nested virt

2013-07-03 Thread Jan Kiszka
On 2013-07-03 18:05, Arthur Chunqi Li wrote: > Set success rflags after emulating VMXON/VMXOFF in nested environment. > > Re-arrange the code sequence of 3 functions, > nested_vmx_succeed()/failValid()/failInvalid(), to avoid double > declaration in the same file. Just don't forget to provide cor

[PATCH v2 2/2] KVM: x86: Avoid zapping mmio sptes twice for generation wraparound

2013-07-03 Thread Takuya Yoshikawa
Now that kvm_arch_memslots_updated() catches every increment of the memslots->generation, checking if the mmio generation has reached its maximum value is enough. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/mmu.c |5 + arch/x86/kvm/x86.c | 10 +- 2 files changed, 6 inserti

[PATCH 1/2] KVM: Introduce kvm_arch_memslots_updated()

2013-07-03 Thread Takuya Yoshikawa
This is called right after the memslots is updated, i.e. when the result of update_memslots() gets installed in install_new_memslots(). Since the memslots needs to be updated twice when we delete or move a memslot, kvm_arch_commit_memory_region() does not correspond to this exactly. In the follow

[PATCH 0/2] KVM: Introduce kvm_arch_memslots_updated() and use it for x86's mmio optimization

2013-07-03 Thread Takuya Yoshikawa
Patch 1: KVM-arch maintainers, please review this one. {x86, power, s390, arm}-kvm maintainers CCed. Could not find mips-kvm maintainer in MAINTAINERS. Patch 2: I did not move the body of kvm_mmu_invalidate_mmio_sptes() into x86.c because it looked like mmu details. Takuya Yoshikawa (2):

Re: watchdog: print stolen time increment at softlockup detection

2013-07-03 Thread Marcelo Tosatti
On Wed, Jul 03, 2013 at 12:44:01PM -0400, Don Zickus wrote: > > And why overcommitment is not a valid reason to generate a softlockup in > > the first place ? > > For the guest I don't believe it is. It isn't the guest's fault it > couldn't run processes. A warning should be scheduled on the hos

Re: watchdog: print stolen time increment at softlockup detection

2013-07-03 Thread Marcelo Tosatti
On Wed, Jul 03, 2013 at 12:44:01PM -0400, Don Zickus wrote: > On Fri, Jun 28, 2013 at 05:37:39PM -0300, Marcelo Tosatti wrote: > > On Fri, Jun 28, 2013 at 10:12:15AM -0400, Don Zickus wrote: > > > On Thu, Jun 27, 2013 at 11:57:23PM -0300, Marcelo Tosatti wrote: > > > > > > > > One possibility for

Re: RFC: vfio interface for platform devices (v2)

2013-07-03 Thread Scott Wood
On 07/03/2013 05:53:09 PM, Alex Williamson wrote: Seems like it should work. My only API concern with this model of appending structs is that a user needs to know the size of each struct even if they don't otherwise care about it in order to step over it. In that case, it might be better to ma

Re: RFC: vfio interface for platform devices (v2)

2013-07-03 Thread Alex Williamson
On Wed, 2013-07-03 at 21:40 +, Yoder Stuart-B08248 wrote: > Version 2 > -VFIO_GROUP_GET_DEVICE_FD-- specified that the path is a sysfs path > -VFIO_DEVICE_GET_INFO-- defined 2 flags instead of 1 > -deleted VFIO_DEVICE_GET_DEVTREE_INFO ioctl > -VFIO_DEVICE_GET_REGION_INFO-- updated as pe

Re: RFC: vfio interface for platform devices

2013-07-03 Thread Scott Wood
On 07/02/2013 06:25:59 PM, Yoder Stuart-B08248 wrote: The write-up below is the first draft of a proposal for how the kernel can expose platform devices to user space using vfio. In short, I'm proposing a new ioctl VFIO_DEVICE_GET_DEVTREE_INFO which allows user space to correlate regions and i

Re: [PATCH 2/2] KVM: PPC: Book3E: Add LRAT error exception handler

2013-07-03 Thread Scott Wood
On 07/03/2013 04:42:40 PM, Alexander Graf wrote: On 03.07.2013, at 22:16, Scott Wood wrote: > On 07/03/2013 11:56:06 AM, Mihai Caraman wrote: >> With LRAT (Logical to Real Address Translation) error exception handler in kernel >> KVM needs to add the counterpart otherwise will break the buil

Re: [PATCH 2/2] KVM: PPC: Book3E: Add LRAT error exception handler

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 22:16, Scott Wood wrote: > On 07/03/2013 11:56:06 AM, Mihai Caraman wrote: >> With LRAT (Logical to Real Address Translation) error exception handler in >> kernel >> KVM needs to add the counterpart otherwise will break the build. >> Signed-off-by: Mihai Caraman >> --- >> arch

Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 22:16, Yoder Stuart-B08248 wrote: > > >> -Original Message- >> From: Alexander Graf [mailto:ag...@suse.de] >> Sent: Wednesday, July 03, 2013 2:32 PM >> To: Yoder Stuart-B08248 >> Cc: Bhushan Bharat-R65777; Wood Scott-B07421; kvm@vger.kernel.org list; >> kvm-...@vger.k

RFC: vfio interface for platform devices (v2)

2013-07-03 Thread Yoder Stuart-B08248
Version 2 -VFIO_GROUP_GET_DEVICE_FD-- specified that the path is a sysfs path -VFIO_DEVICE_GET_INFO-- defined 2 flags instead of 1 -deleted VFIO_DEVICE_GET_DEVTREE_INFO ioctl -VFIO_DEVICE_GET_REGION_INFO-- updated as per AlexW's suggestion, defined 5 new flags and associated structs -V

Re: [PATCH 1/2] powerpc/booke64: Add LRAT error exception handler

2013-07-03 Thread Scott Wood
On 07/03/2013 11:56:05 AM, Mihai Caraman wrote: @@ -1410,6 +1423,7 @@ _GLOBAL(setup_doorbell_ivors) _GLOBAL(setup_ehv_ivors) SET_IVOR(40, 0x300) /* Embedded Hypervisor System Call */ SET_IVOR(41, 0x320) /* Embedded Hypervisor Privilege */ + SET_IVOR(42, 0x340) /* LRAT Error

RE: PPC: RFC: proposal for VM reset & shutdown hcall (v4)

2013-07-03 Thread Yoder Stuart-B08248
> -Original Message- > From: Alexander Graf [mailto:ag...@suse.de] > Sent: Wednesday, July 03, 2013 2:32 PM > To: Yoder Stuart-B08248 > Cc: Bhushan Bharat-R65777; Wood Scott-B07421; kvm@vger.kernel.org list; > kvm-...@vger.kernel.org > Subject: Re: PPC: RFC: proposal for VM reset & shutd

Re: [PATCH 2/2] KVM: PPC: Book3E: Add LRAT error exception handler

2013-07-03 Thread Scott Wood
On 07/03/2013 11:56:06 AM, Mihai Caraman wrote: With LRAT (Logical to Real Address Translation) error exception handler in kernel KVM needs to add the counterpart otherwise will break the build. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/bookehv_interrupts.S |2 ++ 1 files changed

Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)

2013-07-03 Thread Scott Wood
On 07/03/2013 02:32:07 PM, Alexander Graf wrote: On 03.07.2013, at 21:29, Yoder Stuart-B08248 wrote: > Version 4 changes > -clarified that KVM zeros the upper half of the struct fields >if the VM is not in 64-bit mode > > -

Re: PPC: RFC: proposal for VM reset & shutdown hcall (v4)

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 21:29, Yoder Stuart-B08248 wrote: > Version 4 changes > -clarified that KVM zeros the upper half of the struct fields >if the VM is not in 64-bit mode > > > KVM_CAP_EXIT_EPAPR_HCALL Capability > >

PPC: RFC: proposal for VM reset & shutdown hcall (v4)

2013-07-03 Thread Yoder Stuart-B08248
Version 4 changes -clarified that KVM zeros the upper half of the struct fields if the VM is not in 64-bit mode KVM_CAP_EXIT_EPAPR_HCALL Capability A new capability KVM_CAP_EXIT_EPAPR_HCALL is defined to advertise th

RE: RFC: vfio interface for platform devices

2013-07-03 Thread Yoder Stuart-B08248
[cut] > > So overall the interface and extension makes sense. My only question is > > whether it's better to get complete reuse out of GET_REGION_INFO and > > GET_IRQ_INFO and then add another device tree specific ioctl or is it > > better to add a device tree index and path to the existing GET_*_

RE: RFC: vfio interface for platform devices

2013-07-03 Thread Yoder Stuart-B08248
> -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, July 03, 2013 1:52 PM > To: Alexander Graf > Cc: Yoder Stuart-B08248; Alex Williamson; Wood Scott-B07421; Bhushan > Bharat-R65777; Sethi Varun-B16395; > virtualizat...@lists.linux-foundation.org; Antonios Motakis; > kvm@v

Re: RFC: vfio interface for platform devices

2013-07-03 Thread Scott Wood
On 07/02/2013 08:07:53 PM, Alexander Graf wrote: On 03.07.2013, at 01:25, Yoder Stuart-B08248 wrote: > 8. Open Issues > > -how to handle cases where VFIO is requested to handle >a device where the valid, mappable range for a region >is less than a page size. See example above where

Re: [PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Scott Wood
On 07/03/2013 01:42:12 PM, Alexander Graf wrote: On 03.07.2013, at 20:28, Scott Wood wrote: > On 07/03/2013 10:13:57 AM, Alexander Graf wrote: >> There is no chip that supports SPE and HV at the same time. So we'll never hit this anyway, since kvmppc_supports_spe() always returns false on H

Re: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 20:36, Scott Wood wrote: > On 07/03/2013 12:07:30 PM, Alexander Graf wrote: >> On 03.07.2013, at 18:49, Caraman Mihai Claudiu-B02008 wrote: >> Do we need to do this even when the guest doesn't use Altivec? Can't >> >> we >> just load it on demand then once we fault? Th

Re: [PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 20:28, Scott Wood wrote: > On 07/03/2013 10:13:57 AM, Alexander Graf wrote: >> On 03.07.2013, at 15:53, Caraman Mihai Claudiu-B02008 wrote: >> >>> -#ifdef CONFIG_SPE >> >>> case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: { >> >>> -if (vcpu->arch.shared->msr & MSR_SPE)

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 20:37, Scott Wood wrote: > On 07/03/2013 07:42:36 AM, Mihai Caraman wrote: >> Increase FPU laziness by calling kvmppc_load_guest_fp() just before >> returning to guest instead of each sched in. Without this improvement >> an interrupt may also claim floting point corrupting gues

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 19:44, Scott Wood wrote: > On 07/03/2013 12:23:16 PM, Alexander Graf wrote: >> On 03.07.2013, at 19:18, Scott Wood wrote: >> > On 07/03/2013 07:42:36 AM, Mihai Caraman wrote: >> >> Increase FPU laziness by calling kvmppc_load_guest_fp() just before >> >> returning to guest inste

Re: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Scott Wood
On 07/03/2013 07:42:37 AM, Mihai Caraman wrote: Add KVM Book3E AltiVec support. KVM Book3E FPU support gracefully reuse host infrastructure so follow the same approach for AltiVec. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 72

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Scott Wood
On 07/03/2013 07:42:36 AM, Mihai Caraman wrote: Increase FPU laziness by calling kvmppc_load_guest_fp() just before returning to guest instead of each sched in. Without this improvement an interrupt may also claim floting point corrupting guest state. Signed-off-by: Mihai Caraman --- arch/powe

Re: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Scott Wood
On 07/03/2013 12:07:30 PM, Alexander Graf wrote: On 03.07.2013, at 18:49, Caraman Mihai Claudiu-B02008 wrote: Do we need to do this even when the guest doesn't use Altivec? Can't >> we just load it on demand then once we fault? This code path really >> should only be a prefetc

Re: [RFC PATCH 5/6] KVM: PPC: Book3E: Add ONE_REG AltiVec support

2013-07-03 Thread Scott Wood
On 07/03/2013 07:11:52 AM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, June 05, 2013 1:40 AM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org; Caraman Mihai Cl

Re: [PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Scott Wood
On 07/03/2013 10:13:57 AM, Alexander Graf wrote: On 03.07.2013, at 15:53, Caraman Mihai Claudiu-B02008 wrote: >>> -#ifdef CONFIG_SPE >>>case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: { >>> - if (vcpu->arch.shared->msr & MSR_SPE) >>> - kvmppc_vcpu_enable_spe(vcpu); >>>

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Scott Wood
On 07/03/2013 12:23:16 PM, Alexander Graf wrote: On 03.07.2013, at 19:18, Scott Wood wrote: > On 07/03/2013 07:42:36 AM, Mihai Caraman wrote: >> Increase FPU laziness by calling kvmppc_load_guest_fp() just before >> returning to guest instead of each sched in. Without this improvement >> an

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 19:18, Scott Wood wrote: > On 07/03/2013 07:42:36 AM, Mihai Caraman wrote: >> Increase FPU laziness by calling kvmppc_load_guest_fp() just before >> returning to guest instead of each sched in. Without this improvement >> an interrupt may also claim floting point corrupting gues

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 19:17, Scott Wood wrote: > On 07/03/2013 11:59:45 AM, Alexander Graf wrote: >> On 03.07.2013, at 17:41, Caraman Mihai Claudiu-B02008 wrote: >> > Increase FPU laziness by calling kvmppc_load_guest_fp() just before >> > returning to guest instead of each sched in. Without

RE: RFC: vfio interface for platform devices

2013-07-03 Thread Yoder Stuart-B08248
[cut] > So overall the interface and extension makes sense. My only question is > whether it's better to get complete reuse out of GET_REGION_INFO and > GET_IRQ_INFO and then add another device tree specific ioctl or is it > better to add a device tree index and path to the existing GET_*_INFO >

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Scott Wood
On 07/03/2013 07:42:36 AM, Mihai Caraman wrote: Increase FPU laziness by calling kvmppc_load_guest_fp() just before returning to guest instead of each sched in. Without this improvement an interrupt may also claim floting point corrupting guest state. Signed-off-by: Mihai Caraman --- arch/powe

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Scott Wood
On 07/03/2013 11:59:45 AM, Alexander Graf wrote: On 03.07.2013, at 17:41, Caraman Mihai Claudiu-B02008 wrote: > Increase FPU laziness by calling kvmppc_load_guest_fp() just before > returning to guest instead of each sched in. Without this improvement > an interrupt may also cla

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 19:07, Scott Wood wrote: > On 07/03/2013 10:11:50 AM, Alexander Graf wrote: >> On 03.07.2013, at 15:55, Caraman Mihai Claudiu-B02008 wrote: >> >> -Original Message- >> >> From: Alexander Graf [mailto:ag...@suse.de] >> >> Sent: Wednesday, July 03, 2013 4:45 PM >> >> To: C

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Scott Wood
On 07/03/2013 10:11:50 AM, Alexander Graf wrote: On 03.07.2013, at 15:55, Caraman Mihai Claudiu-B02008 wrote: >> -Original Message- >> From: Alexander Graf [mailto:ag...@suse.de] >> Sent: Wednesday, July 03, 2013 4:45 PM >> To: Caraman Mihai Claudiu-B02008 >> Cc: kvm-...@vger.kernel.org

Re: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 18:49, Caraman Mihai Claudiu-B02008 wrote: > + > if (!vcpu->arch.sane) { > kvm_run->exit_reason = KVM_EXIT_INTERNAL_ERROR; > return -EINVAL; > @@ -716,6 +750,22 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 17:41, Caraman Mihai Claudiu-B02008 wrote: > Increase FPU laziness by calling kvmppc_load_guest_fp() just before > returning to guest instead of each sched in. Without this improvement > an interrupt may also claim floting point corrupting guest state. Not

[PATCH 2/2] KVM: PPC: Book3E: Add LRAT error exception handler

2013-07-03 Thread Mihai Caraman
With LRAT (Logical to Real Address Translation) error exception handler in kernel KVM needs to add the counterpart otherwise will break the build. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/bookehv_interrupts.S |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arc

[PATCH 1/2] powerpc/booke64: Add LRAT error exception handler

2013-07-03 Thread Mihai Caraman
Add LRAT (Logical to Real Address Translation) error exception handler to Booke3E 64-bit kernel. LRAT support in KVM will follow afterwards. Signed-off-by: Mihai Caraman --- arch/powerpc/include/asm/kvm_asm.h |1 + arch/powerpc/include/asm/reg_booke.h |1 + arch/powerpc/kernel/exceptio

RE: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> >>> + > >>> if (!vcpu->arch.sane) { > >>> kvm_run->exit_reason = KVM_EXIT_INTERNAL_ERROR; > >>> return -EINVAL; > >>> @@ -716,6 +750,22 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, > >> struct kvm_vcpu *vcpu) > >>> kvmppc_load_guest_fp(vcpu); > >>> #endif > >>> > >>> +#

Re: watchdog: print stolen time increment at softlockup detection

2013-07-03 Thread Don Zickus
On Fri, Jun 28, 2013 at 05:37:39PM -0300, Marcelo Tosatti wrote: > On Fri, Jun 28, 2013 at 10:12:15AM -0400, Don Zickus wrote: > > On Thu, Jun 27, 2013 at 11:57:23PM -0300, Marcelo Tosatti wrote: > > > > > > One possibility for a softlockup report in a Linux VM, is that the host > > > system is ov

Re: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 18:09, Caraman Mihai Claudiu-B02008 wrote: >>> + * Simulate AltiVec unavailable fault to load guest state >>> + * from thread to AltiVec unit. >>> + * It requires to be called with preemption disabled. >>> + */ >>> +static inline void kvmppc_load_guest_altivec(struct kvm_vcpu *v

Re: [PATCH v4 2/2] KVM: s390: use cookies for ioeventfd

2013-07-03 Thread Cornelia Huck
On Wed, 03 Jul 2013 17:30:40 +0200 Paolo Bonzini wrote: > Il 03/07/2013 16:30, Cornelia Huck ha scritto: > > + /* > > +* Return cookie in gpr 2, but don't overwrite the register if the > > +* diagnose will be handled by userspace. > > +*/ > > + if (ret != -EOPNOTSUPP) > > +

Re: [PATCH] KVM : Set success rflags when emulate VMXON/VMXOFF in nested virt

2013-07-03 Thread Arthur Chunqi Li
Before moving the 3 functions ahead, they will be declared twice in the same file before handle_vmon(). I don't know if this small change can be committed together in one patch. If this change is needless or should be committed in a separate patch, tell me and I will commit another version. Arthur

RE: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> > + * Simulate AltiVec unavailable fault to load guest state > > + * from thread to AltiVec unit. > > + * It requires to be called with preemption disabled. > > + */ > > +static inline void kvmppc_load_guest_altivec(struct kvm_vcpu *vcpu) > > +{ > > + if (kvmppc_supports_altivec()) { > > +

[PATCH] KVM : Set success rflags when emulate VMXON/VMXOFF in nested virt

2013-07-03 Thread Arthur Chunqi Li
Set success rflags after emulating VMXON/VMXOFF in nested environment. Re-arrange the code sequence of 3 functions, nested_vmx_succeed()/failValid()/failInvalid(), to avoid double declaration in the same file. Signed-off-by: Arthur Chunqi Li --- arch/x86/kvm/vmx.c | 85 +++

RE: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> >>> Increase FPU laziness by calling kvmppc_load_guest_fp() just before > >>> returning to guest instead of each sched in. Without this improvement > >>> an interrupt may also claim floting point corrupting guest state. > >> > >> Not sure I follow. Could you please describe exactly what's happeni

Re: [PATCH v4 2/2] KVM: s390: use cookies for ioeventfd

2013-07-03 Thread Paolo Bonzini
Il 03/07/2013 16:30, Cornelia Huck ha scritto: > + /* > + * Return cookie in gpr 2, but don't overwrite the register if the > + * diagnose will be handled by userspace. > + */ > + if (ret != -EOPNOTSUPP) > + vcpu->run->s.regs.gprs[2] = ret; I think this should no

Re: [PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 14:42, Mihai Caraman wrote: > Add KVM Book3E AltiVec support. KVM Book3E FPU support gracefully reuse host > infrastructure so follow the same approach for AltiVec. > > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/booke.c | 72 +++

Re: [PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 15:53, Caraman Mihai Claudiu-B02008 wrote: >>> -#ifdef CONFIG_SPE >>> case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: { >>> - if (vcpu->arch.shared->msr & MSR_SPE) >>> - kvmppc_vcpu_enable_spe(vcpu); >>> - else >>> - kvmppc_b

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 15:55, Caraman Mihai Claudiu-B02008 wrote: >> -Original Message- >> From: Alexander Graf [mailto:ag...@suse.de] >> Sent: Wednesday, July 03, 2013 4:45 PM >> To: Caraman Mihai Claudiu-B02008 >> Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- >> d...@lists.ozla

Re: [PATCH v4 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Gleb Natapov
On Wed, Jul 03, 2013 at 04:30:53PM +0200, Cornelia Huck wrote: > Add new functions kvm_io_bus_{read,write}_cookie() that allows users of > the kvm io infrastructure to use a cookie value to speed up lookup of a > device on an io bus. > > Signed-off-by: Cornelia Huck Looks good to me now. > --- >

Re: IA32_FEATURE_CONTROL MSR in nested virt

2013-07-03 Thread Gleb Natapov
On Wed, Jul 03, 2013 at 10:48:33AM -0400, Bandan Das wrote: > Gleb Natapov writes: > > > On Wed, Jul 03, 2013 at 04:24:33PM +0800, Arthur Chunqi Li wrote: > >> Hi Gleb and Paolo, > >> When I write test cases for nested virt and found that reading/writing > >> IA32_FEATURE_CONTROL will be simply

Re: IA32_FEATURE_CONTROL MSR in nested virt

2013-07-03 Thread Bandan Das
Gleb Natapov writes: > On Wed, Jul 03, 2013 at 04:24:33PM +0800, Arthur Chunqi Li wrote: >> Hi Gleb and Paolo, >> When I write test cases for nested virt and found that reading/writing >> IA32_FEATURE_CONTROL will be simply ignored or return 0 (in >> arch/x86/kvm/vmx.c) in VM. Checking this MSR

[PATCH v4 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Cornelia Huck
Add new functions kvm_io_bus_{read,write}_cookie() that allows users of the kvm io infrastructure to use a cookie value to speed up lookup of a device on an io bus. Signed-off-by: Cornelia Huck --- include/linux/kvm_host.h | 4 ++ virt/kvm/kvm_main.c | 106

[PATCH v4 2/2] KVM: s390: use cookies for ioeventfd

2013-07-03 Thread Cornelia Huck
Make use of cookies for the virtio ccw notification hypercall to speed up lookup of devices on the io bus. Signed-off-by: Cornelia Huck --- arch/s390/kvm/diag.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c index

[PATCH v4 0/2] KVM: ioeventfd cookies

2013-07-03 Thread Cornelia Huck
Hi, fourth version of this patch set. Changes: - make the cookie-less read/write function return 0 again on success and drop the changes at the callsites Cornelia Huck (2): KVM: kvm-io: support cookies KVM: s390: use cookies for ioeventfd arch/s390/kvm/diag.c | 15 +-- include/l

Re: [PATCH v3 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Gleb Natapov
On Wed, Jul 03, 2013 at 04:14:39PM +0200, Cornelia Huck wrote: > On Wed, 3 Jul 2013 16:56:42 +0300 > Gleb Natapov wrote: > > > On Wed, Jul 03, 2013 at 03:50:38PM +0200, Cornelia Huck wrote: > > > Add new functions kvm_io_bus_{read,write}_cookie() that allows users of > > > the kvm io infrastructu

Re: [PATCH v3 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Cornelia Huck
On Wed, 3 Jul 2013 16:56:42 +0300 Gleb Natapov wrote: > On Wed, Jul 03, 2013 at 03:50:38PM +0200, Cornelia Huck wrote: > > Add new functions kvm_io_bus_{read,write}_cookie() that allows users of > > the kvm io infrastructure to use a cookie value to speed up lookup of a > > device on an io bus. >

Re: [PATCH v3 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Gleb Natapov
On Wed, Jul 03, 2013 at 03:50:38PM +0200, Cornelia Huck wrote: > Add new functions kvm_io_bus_{read,write}_cookie() that allows users of > the kvm io infrastructure to use a cookie value to speed up lookup of a > device on an io bus. > > kvm_io_bus_{read,write} now returns the index on the bus; ex

RE: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: Alexander Graf [mailto:ag...@suse.de] > Sent: Wednesday, July 03, 2013 4:45 PM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org > Subject: Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU lazi

RE: [PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> > -#ifdef CONFIG_SPE > > case BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL: { > > - if (vcpu->arch.shared->msr & MSR_SPE) > > - kvmppc_vcpu_enable_spe(vcpu); > > - else > > - kvmppc_booke_queue_irqprio(vcpu, > > - > BOOKE_IRQPRIO_SPE_ALTIVEC_UNAV

[PATCH v3 0/2] KVM: ioeventfd cookies

2013-07-03 Thread Cornelia Huck
Hi, here's version 3 of the ioevent cookies patches. Changes: - x86 style fix - fix returning index for reads - refactored read/write functions to avoid double srcu_deference() Cornelia Huck (2): KVM: kvm-io: support cookies KVM: s390: use cookies for ioeventfd arch/ia64/kvm/kvm-ia64.c |

[PATCH v3 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Cornelia Huck
Add new functions kvm_io_bus_{read,write}_cookie() that allows users of the kvm io infrastructure to use a cookie value to speed up lookup of a device on an io bus. kvm_io_bus_{read,write} now returns the index on the bus; existing callers have been fixed up to accept return codes > 0. Signed-off

[PATCH v3 2/2] KVM: s390: use cookies for ioeventfd

2013-07-03 Thread Cornelia Huck
Make use of cookies for the virtio ccw notification hypercall to speed up lookup of devices on the io bus. Signed-off-by: Cornelia Huck --- arch/s390/kvm/diag.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c index

Re: [PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 14:42, Mihai Caraman wrote: > Increase FPU laziness by calling kvmppc_load_guest_fp() just before > returning to guest instead of each sched in. Without this improvement > an interrupt may also claim floting point corrupting guest state. Not sure I follow. Could you please desc

[PATCH] KVM : Fix read/write to IA32_FEATURE_CONTROL MSR in nested virt

2013-07-03 Thread Arthur Chunqi Li
Fix read/write to IA32_FEATURE_CONTROL MSR in nested environment. Simply return 0x5 when read and generate #GP(0) when write. Delete handling codes in vmx_set_vmx_msr() and generate #GP(0) in handle_wrmsr(). Signed-off-by: Arthur Chunqi Li --- arch/x86/kvm/vmx.c |5 + 1 file changed, 1 i

[PATCH 2/2] KVM: PPC: Book3E: Emulate MCSRR0/1 SPR and rfmci instruction

2013-07-03 Thread Mihai Caraman
Some guests are making use of return from machine check instruction to do crazy things even though the 64-bit kernel doesn't handle yet this interrupt. Emulate MCSRR0/1 SPR and rfmci instruction accordingly. Signed-off-by: Mihai Caraman --- arch/powerpc/include/asm/kvm_host.h |1 + arch/powe

[PATCH 1/2] KVM: PPC: Fix kvm_exit_names array

2013-07-03 Thread Mihai Caraman
Some exit ids where left out from kvm_exit_names array. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/timing.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c index 07b6110..c392d26 100644 --- a/arch/powerpc/kv

Re: [PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Alexander Graf
On 03.07.2013, at 14:42, Mihai Caraman wrote: > SPE/FP/AltiVec interrupts share the same numbers. Refactor SPE/FP exit > handling > to accommodate AltiVec later. Detect the targeted unit at run time since it > can > be configured in the kernel but not featured on hardware. > > Signed-off-by: M

Re: [PATCH v2 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Gleb Natapov
On Wed, Jul 03, 2013 at 02:48:35PM +0200, Cornelia Huck wrote: > Add new functions kvm_io_bus_{read,write}_cookie() that allows users of > the kvm io infrastructure to use a cookie value to speed up lookup of a > device on an io bus. > > kvm_io_bus_{read,write} now returns the index on the bus; ex

[PATCH v2 2/2] KVM: s390: use cookies for ioeventfd

2013-07-03 Thread Cornelia Huck
Make use of cookies for the virtio ccw notification hypercall to speed up lookup of devices on the io bus. Signed-off-by: Cornelia Huck --- arch/s390/kvm/diag.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c index

[PATCH v2 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Cornelia Huck
Add new functions kvm_io_bus_{read,write}_cookie() that allows users of the kvm io infrastructure to use a cookie value to speed up lookup of a device on an io bus. kvm_io_bus_{read,write} now returns the index on the bus; existing callers have been fixed up to accept return codes > 0. Signed-off

[PATCH v2 0/2] KVM: ioeventfd cookies

2013-07-03 Thread Cornelia Huck
Hi, here's the second version of the ioeventfd cookies support. Changes: - provide kvm_io_bus_read_cookie as well - refactoring of the cookie code in kvm_main.c - adapt callers to changes Cornelia Huck (2): KVM: kvm-io: support cookies KVM: s390: use cookies for ioeventfd arch/ia64/kvm/kvm

[PATCH 6/6] KVM: PPC: Book3E: Enable e6500 core

2013-07-03 Thread Mihai Caraman
Now that AltiVec support is in place enable e6500 core. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/e500mc.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c index 09da1ac..bec897c 100644 --- a/arch/pow

[PATCH 2/6] KVM: PPC: Book3E: Refactor SPE/FP exit handling

2013-07-03 Thread Mihai Caraman
SPE/FP/AltiVec interrupts share the same numbers. Refactor SPE/FP exit handling to accommodate AltiVec later. Detect the targeted unit at run time since it can be configured in the kernel but not featured on hardware. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 102 +

[PATCH 0/6] KVM: PPC: Book3E: AltiVec support

2013-07-03 Thread Mihai Caraman
Add KVM Book3E AltiVec support and enable e6500 core. Mihai Caraman (6): KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers KVM: PPC: Book3E: Refactor SPE/FP exit handling KVM: PPC: Book3E: Increase FPU laziness KVM: PPC: Book3E: Add AltiVec support KVM: PPC: Book3E: Add

[PATCH 3/6] KVM: PPC: Book3E: Increase FPU laziness

2013-07-03 Thread Mihai Caraman
Increase FPU laziness by calling kvmppc_load_guest_fp() just before returning to guest instead of each sched in. Without this improvement an interrupt may also claim floting point corrupting guest state. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c |1 + arch/powerpc/kvm/e500mc

[PATCH 4/6] KVM: PPC: Book3E: Add AltiVec support

2013-07-03 Thread Mihai Caraman
Add KVM Book3E AltiVec support. KVM Book3E FPU support gracefully reuse host infrastructure so follow the same approach for AltiVec. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 72 - 1 files changed, 70 insertions(+), 2 deletions(-)

[PATCH 5/6] KVM: PPC: Book3E: Add ONE_REG AltiVec support

2013-07-03 Thread Mihai Caraman
Add ONE_REG support for AltiVec on Book3E. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index c3c3af6..6ac1f68 100644 --- a/ar

[PATCH 1/6] KVM: PPC: Book3E: Use common defines for SPE/FP/AltiVec int numbers

2013-07-03 Thread Mihai Caraman
Use common BOOKE_IRQPRIO and BOOKE_INTERRUPT defines for SPE/FP/AltiVec which share the same interrupts numbers. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 16 arch/powerpc/kvm/booke.h |4 ++-- arch/powerpc/kvm/bookehv_interrupts.

RE: [PATCH 1/2] powerpc/booke64: Use common defines for AltiVec interrupts numbers

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> So we can remove this hack in kvm_asm.h: Not yet, this comment was added in the context of AltiVec RFC patches which intended to remove a similar dependency. > > /* > * TODO: Unify 32-bit and 64-bit kernel exception handlers to use same > defines > */ > #define BOOKE_INTERRUPT_SPE_UNAVAIL

RE: [RFC PATCH 5/6] KVM: PPC: Book3E: Add ONE_REG AltiVec support

2013-07-03 Thread Caraman Mihai Claudiu-B02008
> -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, June 05, 2013 1:40 AM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org; Caraman Mihai Claudiu-B02008 > Subject: Re: [RFC PATCH 5/6] KVM: PPC: Book3E: Add

Re: [PATCH 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Paolo Bonzini
Il 03/07/2013 13:45, Cornelia Huck ha scritto: > On Wed, 03 Jul 2013 12:58:00 +0200 > Paolo Bonzini wrote: > >> Il 03/07/2013 12:51, Cornelia Huck ha scritto: >>> On Wed, 03 Jul 2013 11:21:23 +0200 >>> Paolo Bonzini wrote: >>> Il 03/07/2013 11:05, Paolo Bonzini ha scritto: > Nice idea,

Re: [PATCH 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Cornelia Huck
On Wed, 03 Jul 2013 12:58:00 +0200 Paolo Bonzini wrote: > Il 03/07/2013 12:51, Cornelia Huck ha scritto: > > On Wed, 03 Jul 2013 11:21:23 +0200 > > Paolo Bonzini wrote: > > > >> Il 03/07/2013 11:05, Paolo Bonzini ha scritto: > >>> Nice idea, though I don't really like the duplication between >

Re: [PATCH 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Paolo Bonzini
Il 03/07/2013 12:51, Cornelia Huck ha scritto: > On Wed, 03 Jul 2013 11:21:23 +0200 > Paolo Bonzini wrote: > >> Il 03/07/2013 11:05, Paolo Bonzini ha scritto: >>> Nice idea, though I don't really like the duplication between >>> kvm_io_bus_write and kvm_io_bus_write_cookie. >>> >>> Can you make k

Re: [PATCH 1/2] KVM: kvm-io: support cookies

2013-07-03 Thread Cornelia Huck
On Wed, 03 Jul 2013 11:21:23 +0200 Paolo Bonzini wrote: > Il 03/07/2013 11:05, Paolo Bonzini ha scritto: > > Nice idea, though I don't really like the duplication between > > kvm_io_bus_write and kvm_io_bus_write_cookie. > > > > Can you make kvm_io_bus_write, and perhaps kvm_io_bus_read too, ret

Re: RFC: vfio interface for platform devices

2013-07-03 Thread Antonios Motakis
On Wed, Jul 3, 2013 at 5:07 AM, Alex Williamson wrote: > On Tue, 2013-07-02 at 23:25 +, Yoder Stuart-B08248 wrote: >> The write-up below is the first draft of a proposal for how the kernel can >> expose >> platform devices to user space using vfio. >> >> In short, I'm proposing a new ioctl VF

Re: IA32_FEATURE_CONTROL MSR in nested virt

2013-07-03 Thread Gmail
OK, I will write a patch as what Paolo says. Anything else need to be taken into consideration, Paolo? Arthur Chunqi Li Department of Computer Science School of EECS Peking University Beijing, China >From my iPhone 在 2013-7-3,17:14,Gleb Natapov 写道: > On Wed, Jul 03, 2013 at 04:24:33PM +0800,

  1   2   >