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 re

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 imp

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 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: RFC: proposal for VM reset & shutdown hcall (v3)

2013-07-02 Thread Scott Wood
On 07/02/2013 05:08:02 PM, Yoder Stuart-B08248 wrote: KVM_EXIT_EPAPR_HCALL exit definition /* KVM_EXIT_EPAPR_HCALL */ struct { __u64 nr; __u64

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

2013-07-02 Thread Scott Wood
On 07/02/2013 10:33:58 AM, Yoder Stuart-B08248 wrote: > -Original Message- > From: Alexander Graf [mailto:ag...@suse.de] > Sent: Tuesday, July 02, 2013 10:23 AM > To: Yoder Stuart-B08248 > Cc: Bhushan Bharat-R65777; Wood Scott-B07421; kvm@vger.kernel.org list; kvm-...@vger.kernel.org

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

2013-07-01 Thread Scott Wood
On 07/01/2013 07:18:21 PM, Alexander Graf wrote: On 01.07.2013, at 17:35, Mihai Caraman wrote: > On Book3E some SPE/FP/AltiVec interrupts share the same number. Use > common defines to indentify these numbers. So why didn't this happen from the beginning? Ask Kumar. Why the change? So we

Re: RFC: proposal for VM reset & shutdown hcall

2013-07-01 Thread Scott Wood
On 07/01/2013 06:05:55 PM, Yoder Stuart-B08248 wrote: > -Original Message- > From: Alexander Graf [mailto:ag...@suse.de] > Sent: Monday, July 01, 2013 6:01 PM > To: Yoder Stuart-B08248 > Cc: Bhushan Bharat-R65777; Wood Scott-B07421; kvm@vger.kernel.org list; kvm-...@vger.kernel.org >

Re: RFC: proposal for VM reset hcall

2013-07-01 Thread Scott Wood
On 07/01/2013 12:28:34 PM, Yoder Stuart-B08248 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Monday, July 01, 2013 11:49 AM > To: Yoder Stuart-B08248 > Cc: Alexander Graf; Wood Scott-B07421; Bhushan Bharat-R65777; kvm@vger.kernel.org > Subject: Re: RFC: proposal for V

Re: RFC: proposal for VM reset hcall

2013-07-01 Thread Scott Wood
On 07/01/2013 10:56:54 AM, Yoder Stuart-B08248 wrote: For the e500 PV platform we need a VM reset mechanisms. Hypercall: KVM_HC_VM_RESET Description: Requests that the virtual machine be reset. The hcall takes no arguments. If successful the hcall does not return

Re: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-06-27 Thread Scott Wood
On 06/27/2013 12:02:36 AM, Alexey Kardashevskiy wrote: +/* + * The KVM guest can be backed with 16MB pages. + * In this case, we cannot do page counting from the real mode + * as the compound pages are used - they are linked in a list + * with pointers as virtual addresses which are inaccessible

[PATCH v2] kvm/ppc/booke: Delay kvmppc_lazy_ee_enable

2013-06-11 Thread Scott Wood
: Scott Wood --- Rebased without patches 5 and 6 in the previous patchset. arch/powerpc/kvm/booke.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 5cd7ad0..1a1b511 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch

Re: [PATCH 0/8] kvm/ppc: fixes for 3.10

2013-06-10 Thread Scott Wood
On 06/09/2013 03:09:21 AM, Gleb Natapov wrote: On Thu, Jun 06, 2013 at 07:16:28PM -0500, Scott Wood wrote: > Most of these have been posted before, but I grouped them together as > there are some contextual dependencies between them. > > Gleb/Paolo: As Alex doesn't appear to

[PATCH 5/8] kvm/ppc: Call trace_hardirqs_on before entry

2013-06-06 Thread Scott Wood
() to kvm_fix_ee_before_entry() to reflect that this function now has a role on 32-bit as well. Signed-off-by: Scott Wood --- arch/powerpc/include/asm/kvm_ppc.h | 11 --- arch/powerpc/kvm/book3s_pr.c |4 ++-- arch/powerpc/kvm/booke.c |4 ++-- arch/powerpc/kvm/powe

[PATCH 8/8] kvm/ppc/booke: Don't call kvm_guest_enter twice

2013-06-06 Thread Scott Wood
kvm_guest_enter() was already called by kvmppc_prepare_to_enter(). Don't call it again. Signed-off-by: Scott Wood --- arch/powerpc/kvm/booke.c |2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index f953324..0b4d792 100644 --- a

[PATCH 1/8] kvm/ppc/booke64: Fix AltiVec interrupt numbers and build breakage

2013-06-06 Thread Scott Wood
break for 64-bit booke KVM. Signed-off-by: Mihai Caraman Signed-off-by: Scott Wood --- arch/powerpc/include/asm/kvm_asm.h | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h index b9dd382

[PATCH 2/8] kvm/ppc/booke64: Disable e6500 support

2013-06-06 Thread Scott Wood
The previous patch made 64-bit booke KVM build again, but Altivec support is still not complete, and we can't prevent the guest from turning on Altivec (which can corrupt host state until state save/restore is implemented). Disable e6500 on KVM until this is fixed. Signed-off-by: Scott

[PATCH 7/8] kvm/ppc/booke: Delay kvmppc_fix_ee_before_entry

2013-06-06 Thread Scott Wood
(). Signed-off-by: Scott Wood --- arch/powerpc/kvm/booke.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index c5270a3..f953324 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -671,7 +671,6 @@ int

[PATCH 4/8] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-06-06 Thread Scott Wood
EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood --- arch/powerpc/kvm

[PATCH 6/8] kvm/ppc: IRQ disabling cleanup

2013-06-06 Thread Scott Wood
caller do it. Also move the IRQ enabling on heavyweight exit into kvmppc_prepare_to_enter(). Signed-off-by: Scott Wood --- arch/powerpc/include/asm/kvm_ppc.h |6 ++ arch/powerpc/kvm/book3s_pr.c | 12 +++- arch/powerpc/kvm/booke.c | 11 +++ arch/powerpc/kvm

[PATCH 3/8] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-06-06 Thread Scott Wood
KVM core expects arch code to acquire the srcu lock when calling gfn_to_memslot and similar functions. Signed-off-by: Scott Wood --- arch/powerpc/kvm/44x_tlb.c |5 + arch/powerpc/kvm/booke.c|7 +++ arch/powerpc/kvm/e500_mmu.c |5 + 3 files changed, 17 insertions

[PATCH 0/8] kvm/ppc: fixes for 3.10

2013-06-06 Thread Scott Wood
ix AltiVec interrupt numbers and build breakage Scott Wood (7): kvm/ppc/booke64: Disable e6500 support kvm/ppc/booke: Hold srcu lock when calling gfn functions kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit() kvm/ppc: Call trace_hardirqs_on before entry kvm/ppc: IRQ disabling cle

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

2013-06-06 Thread Scott Wood
On 06/06/2013 04:42:44 AM, Caraman Mihai Claudiu-B02008 wrote: > > > This looks like a bit much for 3.10 (certainly, subject lines like > > > "refactor" and "enhance" and "add support" aren't going to make > > Linus > > > happy given that we're past rc4) so I think we should apply > > > http://

Re: [RFC PATCH 6/6] KVM: PPC: Book3E: Enhance FPU laziness

2013-06-05 Thread Scott Wood
On 06/05/2013 04:14:21 AM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, June 05, 2013 1:54 AM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org; Caraman Mihai Cl

Re: [RFC PATCH 2/6] KVM: PPC: Book3E: Refactor SPE_FP exit handling

2013-06-05 Thread Scott Wood
On 06/05/2013 02:29:47 AM, Caraman Mihai Claudiu-B02008 wrote: > > case BOOKE_INTERRUPT_SPE_FP_ROUND: > > +#ifdef CONFIG_SPE > > kvmppc_booke_queue_irqprio(vcpu, > > BOOKE_IRQPRIO_SPE_FP_ROUND); > > r = RESUME_GUEST; > > break; > > Why not use kvmpp

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

2013-06-05 Thread Scott Wood
On 06/05/2013 02:10:07 AM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Wednesday, June 05, 2013 12:39 AM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org; Alexander Graf

Re: [RFC PATCH 6/6] KVM: PPC: Book3E: Enhance FPU laziness

2013-06-04 Thread Scott Wood
On 06/03/2013 03:54:28 PM, Mihai Caraman wrote: Adopt AltiVec approach to increase laziness by calling kvmppc_load_guest_fp() just before returning to guest instaed of each sched in. Signed-off-by: Mihai Caraman If you did this *before* adding Altivec it would have saved a question in an

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

2013-06-04 Thread Scott Wood
On 06/03/2013 03:54:27 PM, Mihai Caraman wrote: 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/

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

2013-06-04 Thread Scott Wood
On 06/03/2013 03:54:26 PM, Mihai Caraman wrote: KVM Book3E FPU support gracefully reuse host infrastructure so we do the same for AltiVec. To keep AltiVec lazy call kvmppc_load_guest_altivec() just when returning to guest instead of each sched in. Signed-off-by: Mihai Caraman --- arch/powe

Re: [RFC PATCH 3/6] KVM: PPC: Book3E: Rename IRQPRIO names to accommodate ALTIVEC

2013-06-04 Thread Scott Wood
On 06/03/2013 03:54:25 PM, Mihai Caraman wrote: Rename BOOKE_IRQPRIO_SPE_UNAVAIL and BOOKE_IRQPRIO_SPE_FP_DATA names to accommodate ALTIVEC. Replace BOOKE_INTERRUPT_SPE_UNAVAIL and BOOKE_INTERRUPT_SPE_FP_DATA with the common version. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c

Re: [RFC PATCH 2/6] KVM: PPC: Book3E: Refactor SPE_FP exit handling

2013-06-04 Thread Scott Wood
On 06/03/2013 03:54:24 PM, Mihai Caraman wrote: SPE_FP interrupts are shared with ALTIVEC. Refactor SPE_FP exit handling to detect KVM support for the featured unit at run-time, in order to accommodate ALTIVEC later. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 80

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

2013-06-04 Thread Scott Wood
On 06/03/2013 03:54:22 PM, Mihai Caraman wrote: Mihai Caraman (6): KVM: PPC: Book3E: Fix AltiVec interrupt numbers and build breakage KVM: PPC: Book3E: Refactor SPE_FP exit handling KVM: PPC: Book3E: Rename IRQPRIO names to accommodate ALTIVEC KVM: PPC: Book3E: Add AltiVec support KVM:

Re: [PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-30 Thread Scott Wood
On 05/10/2013 02:15:34 PM, Scott Wood wrote: On 05/10/2013 02:06:53 PM, Caraman Mihai Claudiu-B02008 wrote: > > > I didn't see Tiejun's patch... My goal was just to fix the build > > break > > > without exposing problems, and to encourage a patch to fix it &

Re: [PATCH] KVM: PPC: Book3S: Add support for H_IPOLL and H_XIRR_X in XICS emulation

2013-05-29 Thread Scott Wood
On 05/29/2013 06:57:32 PM, Benjamin Herrenschmidt wrote: On Wed, 2013-05-29 at 18:38 -0500, Scott Wood wrote: > > Yes. I'd like to have them in. Their implementation is actually fairly > > trivial and they cannot be emulated by qemu if the rest of the XICS is > > i

Re: [PATCH] KVM: PPC: Book3S: Add support for H_IPOLL and H_XIRR_X in XICS emulation

2013-05-29 Thread Scott Wood
On 05/28/2013 07:41:18 PM, Benjamin Herrenschmidt wrote: On Tue, 2013-05-28 at 12:41 -0500, Scott Wood wrote: > I believe Alex is staying far away from e-mail on his vacation. He's > asked me to fill in for him while he's gone. > > The patch itself seems reasonable (th

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-29 Thread Scott Wood
On 05/29/2013 06:29:13 PM, Alexey Kardashevskiy wrote: On 05/30/2013 09:14 AM, Scott Wood wrote: > On 05/29/2013 06:10:33 PM, Alexey Kardashevskiy wrote: >> On 05/30/2013 06:05 AM, Scott Wood wrote: >> > But you didn't put it in the same section as KVM_CREATE_SPAPR_TC

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-29 Thread Scott Wood
On 05/29/2013 06:10:33 PM, Alexey Kardashevskiy wrote: On 05/30/2013 06:05 AM, Scott Wood wrote: > On 05/28/2013 07:12:32 PM, Alexey Kardashevskiy wrote: >> On 05/29/2013 09:35 AM, Scott Wood wrote: >> > On 05/28/2013 06:30:40 PM, Alexey Kardashevskiy wrote: >> &g

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-29 Thread Scott Wood
On 05/28/2013 07:12:32 PM, Alexey Kardashevskiy wrote: On 05/29/2013 09:35 AM, Scott Wood wrote: > On 05/28/2013 06:30:40 PM, Alexey Kardashevskiy wrote: >> >> >>> @@ -939,6 +940,9 @@ struct kvm_s390_ucas_mapping { >> >> >>> #define KVM_G

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-28 Thread Scott Wood
On 05/28/2013 06:30:40 PM, Alexey Kardashevskiy wrote: >> >>> @@ -939,6 +940,9 @@ struct kvm_s390_ucas_mapping { >> >>> #define KVM_GET_DEVICE_ATTR _IOW(KVMIO, 0xe2, struct >> >>> kvm_device_attr) >> >>> #define KVM_HAS_DEVICE_ATTR _IOW(KVMIO, 0xe3, struct >> >>> kvm_device_attr) >> >

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-28 Thread Scott Wood
On 05/26/2013 09:44:24 PM, Alexey Kardashevskiy wrote: On 05/25/2013 12:45 PM, David Gibson wrote: > On Wed, May 22, 2013 at 04:06:57PM -0500, Scott Wood wrote: >> On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: >>> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/pow

Re: [PATCH] KVM: PPC: Book3S: Add support for H_IPOLL and H_XIRR_X in XICS emulation

2013-05-28 Thread Scott Wood
On 05/23/2013 08:42:21 PM, Paul Mackerras wrote: This adds the remaining two hypercalls defined by PAPR for manipulating the XICS interrupt controller, H_IPOLL and H_XIRR_X. H_IPOLL returns information about the priority and pending interrupts for a virtual cpu, without changing any state. H_

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-28 Thread Scott Wood
On 05/24/2013 09:45:24 PM, David Gibson wrote: On Wed, May 22, 2013 at 04:06:57PM -0500, Scott Wood wrote: > On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: > >diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > >index 8465c2a..da6bf61 100644 > &

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-22 Thread Scott Wood
On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 8465c2a..da6bf61 100644 --- a/arch/powerpc/kvm/powerpc.c @@ -396,6 +396,7 @@ int kvm_dev_ioctl_check_extension(long ext) +++ b/arch/powerpc/kvm/powerpc.c

[RESEND][PATCH v2] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-05-17 Thread Scott Wood
KVM core expects arch code to acquire the srcu lock when calling gfn_to_memslot and similar functions. Signed-off-by: Scott Wood --- Resending as it doesn't seem to have made it to the mailing list archives or patchwork. v2: Eliminate need_srcu and move the locking into the switch cases

[PATCH v3 1/3] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-05-13 Thread Scott Wood
EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood --- v3: Add comment

[PATCH v3 0/3] kvm/ppc: interrupt disabling fixes

2013-05-13 Thread Scott Wood
's still better than the current situation on booke64 (which involves not just a different WARN, but a possible host kernel hang), so I wouldn't use it as a reason to delay these patches from going via the KVM tree. Any testing that people can provide on book3s_pr would be appreciated.

[PATCH v3 2/3] kvm/ppc: Call trace_hardirqs_on before entry

2013-05-13 Thread Scott Wood
() to kvm_fix_ee_before_entry() to reflect that this function now has a role on 32-bit as well. Signed-off-by: Scott Wood --- arch/powerpc/include/asm/kvm_ppc.h | 11 --- arch/powerpc/kvm/book3s_pr.c |4 ++-- arch/powerpc/kvm/booke.c |4 ++-- arch/powerpc/kvm/powe

[PATCH v3 3/3] kvm/ppc: IRQ disabling cleanup

2013-05-13 Thread Scott Wood
caller do it. Also move the IRQ enabling on heavyweight exit into kvmppc_prepare_to_enter(). Signed-off-by: Scott Wood --- v3: - local_irq_disable -> hard_irq_disable in MSR_WE code (just for consistency -- MSR_WE and 64-bit don't overlap). - Check that IRQs are hard-disabled before ente

Re: [PATCH] KVM: PPC: Add userspace debug stub support

2013-05-13 Thread Scott Wood
On 05/11/2013 08:18:50 AM, Alexander Graf wrote: Am 11.05.2013 um 12:24 schrieb Bhushan Bharat-R65777 : > We do not want to keep the delayed debug events as they does not carry much value. Example: taking h/w breakpoint at some other execution address. That's for the guest to decide, no

Re: [PATCH v2 4/4] kvm/ppc: IRQ disabling cleanup

2013-05-10 Thread Scott Wood
On 05/10/2013 12:01:38 AM, Bhushan Bharat-R65777 wrote: > -Original Message- > From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc-ow...@vger.kernel.org] On > Behalf Of Scott Wood > Sent: Friday, May 10, 2013 8:40 AM > To: Alexander Graf; Benjamin Herrensc

Re: [PATCH v2 2/4] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-05-10 Thread Scott Wood
On 05/10/2013 12:01:19 AM, Bhushan Bharat-R65777 wrote: > -Original Message- > From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc-ow...@vger.kernel.org] On > Behalf Of Scott Wood > Sent: Friday, May 10, 2013 8:40 AM > To: Alexander Graf; Benjamin Herrensc

Re: [PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-10 Thread Scott Wood
On 05/10/2013 02:06:53 PM, Caraman Mihai Claudiu-B02008 wrote: > > > I didn't see Tiejun's patch... My goal was just to fix the build > > break > > > without exposing problems, and to encourage a patch to fix it > > properly > > > to happen sooner rather than later. With Tiejun's patch, which

Re: [PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-10 Thread Scott Wood
On 05/10/2013 01:20:33 PM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, May 10, 2013 8:42 PM > To: Caraman Mihai Claudiu-B02008 > Cc: Alexander Graf; Wood Scott-B07421; kvm-...@vger.kernel.org; > kvm@vger.kernel.org > Subject: Re: [P

Re: [v2][KVM][PATCH 1/1] kvm:ppc: enable doorbell exception with CONFIG_PPC_DOORBELL

2013-05-10 Thread Scott Wood
On 05/10/2013 01:14:27 PM, Alexander Graf wrote: On 07.05.2013, at 12:23, Tiejun Chen wrote: > CONFIG_PPC_DOORBELL is enough to cover all variants. > > Signed-off-by: Tiejun Chen > --- > arch/powerpc/kvm/booke.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/po

Re: [PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-10 Thread Scott Wood
On 05/10/2013 01:03:27 PM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc- > ow...@vger.kernel.org] On Behalf Of Alexander Graf > Sent: Friday, May 10, 2013 7:51 PM > To: Caraman Mihai Claudiu-B02008 > Cc: Wood Scott-B07421;

Re: [PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-10 Thread Scott Wood
On 05/10/2013 09:11:24 AM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Alexander Graf [mailto:ag...@suse.de] > Sent: Friday, May 10, 2013 4:16 PM > To: Caraman Mihai Claudiu-B02008 > Cc: Wood Scott-B07421; kvm-...@vger.kernel.org; kvm@vger.kernel.org > Subject: Re: [P

Re: [PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-10 Thread Scott Wood
On 05/10/2013 04:40:01 AM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, May 10, 2013 6:15 AM > To: Alexander Graf > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; Wood Scott-B07421; > Caraman Mihai Claudiu-B02008 > Subject: [PATCH]

[PATCH] kvm/ppc/booke64: fix build breakage from Altivec, and disable e6500

2013-05-09 Thread Scott Wood
(which can corrupt host state until state save/restore is implemented). Disable e6500 on KVM until this is fixed. Signed-off-by: Scott Wood Cc: Mihai Caraman --- arch/powerpc/kvm/bookehv_interrupts.S |4 arch/powerpc/kvm/e500mc.c |2 -- 2 files changed, 4 insertions(+), 2

[PATCH v2 1/4] powerpc: hard_irq_disable(): Call trace_hardirqs_off after disabling

2013-05-09 Thread Scott Wood
rn; Since irqs_disabled() is based on soft_enabled(), that (not just the hard EE bit) needs to be 0 before we call trace_hardirqs_off. Signed-off-by: Scott Wood --- arch/powerpc/include/asm/hw_irq.h |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/h

[PATCH v2 3/4] kvm/ppc: Call trace_hardirqs_on before entry

2013-05-09 Thread Scott Wood
() to kvm_fix_ee_before_entry() to reflect that this function now has a role on 32-bit as well. Signed-off-by: Scott Wood --- arch/powerpc/include/asm/kvm_ppc.h | 11 --- arch/powerpc/kvm/book3s_pr.c |4 ++-- arch/powerpc/kvm/booke.c |4 ++-- arch/powerpc/kvm/powe

[PATCH v2 0/4] kvm/ppc: interrupt disabling fixes

2013-05-09 Thread Scott Wood
v2: - Split into separate changes - Rebase on top of (and fix a bug in) powerpc: Make hard_irq_disable() do the right thing vs. irq tracing - Move interrupt diasbling/enabling into kvmppc_handle_exit Based on Ben's next branch. Scott Wood (4): powerpc: hard_irq_disable():

[PATCH v2 4/4] kvm/ppc: IRQ disabling cleanup

2013-05-09 Thread Scott Wood
done). Signed-off-by: Scott Wood --- arch/powerpc/include/asm/kvm_ppc.h |6 ++ arch/powerpc/kvm/book3s_pr.c | 12 +++- arch/powerpc/kvm/booke.c |9 ++--- arch/powerpc/kvm/powerpc.c | 21 - 4 files changed, 19 insertions(+

[PATCH v2 2/4] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-05-09 Thread Scott Wood
EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood --- arch/powerpc/kvm

Re: [v1][KVM][PATCH 1/1] kvm:ppc:booehv: direct ISI exception to Guest

2013-05-07 Thread Scott Wood
On 05/07/2013 06:06:30 AM, Tiejun Chen wrote: We also can direct ISI exception to Guest like DSI. Signed-off-by: Tiejun Chen --- arch/powerpc/kvm/booke_emulate.c |3 +++ arch/powerpc/kvm/e500mc.c|3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) Are you seeing a real per

[PATCH] kvm/ppc: interrupt disabling fixes

2013-05-06 Thread Scott Wood
3s_pr and booke, always hard-disable interrupts before kvmppc_prepare_to_enter(), but leave them soft-enabled. On book3s, this should results in the right lazy EE state when the asm code hard-enables on an exit. On booke, we call hard_irq_disable() rather than hard-enable immediately. Signed-off-by:

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-06 Thread Scott Wood
On 05/06/2013 07:03:14 PM, Benjamin Herrenschmidt wrote: On Mon, 2013-05-06 at 18:53 -0500, Scott Wood wrote: > > > Ie. The last stage of entry will hard enable, so they should be > > soft-enabled too... if not, latency trackers will consider the whole > > guest periods a

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-06 Thread Scott Wood
On 05/05/2013 04:03:08 PM, Benjamin Herrenschmidt wrote: On Fri, 2013-05-03 at 18:45 -0500, Scott Wood wrote: > kvmppc_lazy_ee_enable() was causing interrupts to be soft-enabled > (albeit hard-disabled) in kvmppc_restart_interrupt(). This led to > warnings, and possibly breaka

Re: [PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-03 Thread Scott Wood
On 05/03/2013 06:45:23 PM, Scott Wood wrote: While we could just set PACA_IRQ_HARD_DIS after an exit to compensate, instead hard-disable interrupts before entering the guest. This way, we won't have to worry about interactions if we take an interrupt during the guest entry code. While I

[PATCH] kvm/ppc/booke64: Hard disable interrupts when entering the guest

2013-05-03 Thread Scott Wood
t would be bad if the non-hv code were used on 64-bit or if 32-bit guest lazy interrupt disabling, since the non-hv code changes IVPR among other things). Signed-off-by: Scott Wood Cc: Mihai Caraman --- arch/powerpc/kvm/booke.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) di

Re: [PATCH] KVM: PPC: Book3E 64: Fix IRQs warnings and hangs

2013-05-03 Thread Scott Wood
On 05/03/2013 05:59:32 PM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Saturday, May 04, 2013 1:07 AM > To: Caraman Mihai Claudiu-B02008 > Cc: Wood Scott-B07421; kvm-...@vger.kernel.org; kvm@vger.kernel.org; > linuxppc-...@lists.ozlabs.org >

Re: [PATCH] KVM: PPC: Book3E 64: Fix IRQs warnings and hangs

2013-05-03 Thread Scott Wood
On 05/03/2013 03:56:47 PM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, May 03, 2013 11:15 PM > To: Caraman Mihai Claudiu-B02008 > Cc: Wood Scott-B07421; kvm-...@vger.kernel.org; kvm@vger.kernel.org; > linuxppc-...@lists.ozlabs.org > S

Re: [PATCH] KVM: PPC: Book3E 64: Fix IRQs warnings and hangs

2013-05-03 Thread Scott Wood
On 05/03/2013 03:01:26 PM, Caraman Mihai Claudiu-B02008 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Friday, May 03, 2013 9:05 PM > To: Caraman Mihai Claudiu-B02008 > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org; Caraman Mihai Claudi

Re: [PATCH] KVM: PPC: Book3E 64: Fix IRQs warnings and hangs

2013-05-03 Thread Scott Wood
On 05/03/2013 11:11:10 AM, Mihai Caraman wrote: A change in the generic code highlighted that we were running with IRQs (soft) enabled on Book3E 64-bit when trying to restart interrupts from handle_exit(). This is a lesson to configure lockdep often :) There is no reason to exit guest with sof

Re: [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-05-02 Thread Scott Wood
On 05/02/2013 09:37:53 AM, Marcelo Tosatti wrote: On Wed, May 01, 2013 at 07:27:23PM -0500, Scott Wood wrote: > On 05/01/2013 07:15:53 PM, Marcelo Tosatti wrote: > >On Fri, Apr 26, 2013 at 07:53:38PM -0500, Scott Wood wrote: > >> diff --git a/arch/powerpc/kvm/booke.c b/arch/p

Re: [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-05-01 Thread Scott Wood
On 05/01/2013 07:27:23 PM, Scott Wood wrote: On 05/01/2013 07:15:53 PM, Marcelo Tosatti wrote: This is not good practice (codepaths should either hold srcu or not hold it, unconditionally). How is it different from moving the srcu lock into individual cases of the switch? I just did it

Re: [PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-05-01 Thread Scott Wood
On 05/01/2013 07:15:53 PM, Marcelo Tosatti wrote: On Fri, Apr 26, 2013 at 07:53:38PM -0500, Scott Wood wrote: > diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c > index 1020119..506c87d 100644 > --- a/arch/powerpc/kvm/booke.c > +++ b/arch/powerpc/kvm/booke.c > @

[PATCH] kvm: Add compat_ioctl for device control API

2013-04-30 Thread Scott Wood
This API shouldn't have 32/64-bit issues, but VFS assumes it does unless told otherwise. Signed-off-by: Scott Wood --- virt/kvm/kvm_main.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 54a14fa..ee0adad 100644 --- a/virt/kvm/kvm_m

[PATCH 1/2] kvm/ppc/mpic: fix mmio region lists when multiple guests used

2013-04-30 Thread Scott Wood
Keeping a linked list of statically defined objects doesn't work very well when we have multiple guests. :-P Switch to an array of constant objects. This fixes a hang when multiple guests are used. Signed-off-by: Scott Wood --- arch/powerpc/kvm/mpic.c |

[PATCH 2/2] kvm/ppc/mpic: remove users

2013-04-30 Thread Scott Wood
This is an unused (no pun intended) leftover from when this code did reference counting. Signed-off-by: Scott Wood --- arch/powerpc/kvm/mpic.c |1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c index 80ea3cb..c30a04b 100644 --- a/arch/powerpc

[PATCH] kvm/ppc/mpic: remove default routes from documentation

2013-04-29 Thread Scott Wood
The default routes were removed from the code during patchset respinning, but were not removed from the documentation. Signed-off-by: Scott Wood --- Documentation/virtual/kvm/devices/mpic.txt |3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/virtual/kvm/devices/mpic.txt b

[PATCH 2/3] kvm/ppc: Hold srcu lock when calling kvm_io_bus_read/write

2013-04-26 Thread Scott Wood
These functions do an srcu_dereference without acquiring the srcu lock themselves. Signed-off-by: Scott Wood --- arch/powerpc/kvm/powerpc.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c

[PATCH 1/3] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-04-26 Thread Scott Wood
KVM core expects arch code to acquire the srcu lock when calling gfn_to_memslot and similar functions. Signed-off-by: Scott Wood --- arch/powerpc/kvm/44x_tlb.c |5 + arch/powerpc/kvm/booke.c| 19 +++ arch/powerpc/kvm/e500_mmu.c |5 + 3 files changed, 29

[PATCH 3/3] kvm: Fix obsolete comment about locking for kvm_io_bus_read/write

2013-04-26 Thread Scott Wood
Nobody is actually calling these functions with slots_lock held. The srcu read lock, OTOH, is required. Signed-off-by: Scott Wood --- virt/kvm/kvm_main.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 5da9f02..54a14fa

Re: [PATCH v5 0/8] In-kernel XICS interrupt controller emulation

2013-04-26 Thread Scott Wood
On 04/26/2013 06:52:47 PM, Paul Mackerras wrote: On Fri, Apr 26, 2013 at 12:13:33PM -0500, Scott Wood wrote: > Also please note that we no longer hold kvm->lock during device > creation, so your EEXIST check looks racy. Huh? Patch 2/8 adds this code: + mutex_lock(&

Re: [PATCH v5 0/8] In-kernel XICS interrupt controller emulation

2013-04-26 Thread Scott Wood
ment that defines IBM's > pSeries platform architecture). This version of the patch series uses > the latest device API as posted by Scott Wood, that is, i.e., the > version where the core device code provides the file descriptor and > ioctl handler. I have structured the

[PATCH 1/2] kvm: destroy emulated devices on VM exit

2013-04-25 Thread Scott Wood
The hassle of getting refcounting right was greater than the hassle of keeping a list of devices to destroy on VM exit. Signed-off-by: Scott Wood --- arch/powerpc/kvm/mpic.c |2 -- include/linux/kvm_host.h |3 ++- virt/kvm/kvm_main.c | 29 - 3 files

[PATCH 2/2] kvm/ppc/mpic: Eliminate mmio_mapped

2013-04-25 Thread Scott Wood
We no longer need to keep track of this now that MPIC destruction always happens either during VM destruction (after MMIO has been destroyed) or during a failed creation (before the fd has been exposed to userspace, and thus before the MMIO region could have been registered). Signed-off-by: Scott

Re: [PATCH 16/17] KVM: PPC: MPIC: Add support for KVM_IRQ_LINE

2013-04-25 Thread Scott Wood
On 04/25/2013 09:49:23 AM, Alexander Graf wrote: On 25.04.2013, at 13:30, Alexander Graf wrote: > > On 19.04.2013, at 20:51, Scott Wood wrote: > >> On 04/19/2013 09:06:27 AM, Alexander Graf wrote: >>> Now that all pieces are in place for reusing generic irq infrast

Re: [PATCH v4 1/6] kvm: add device control API

2013-04-25 Thread Scott Wood
On 04/25/2013 01:22:04 PM, Gleb Natapov wrote: On Thu, Apr 25, 2013 at 11:51:08AM -0500, Scott Wood wrote: > On 04/25/2013 05:47:39 AM, Alexander Graf wrote: > > > >On 25.04.2013, at 11:43, Gleb Natapov wrote: > > > >>> +void kvm_device_put(struct kvm_dev

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-25 Thread Scott Wood
On 04/25/2013 04:58:51 AM, Alexander Graf wrote: On 19.04.2013, at 20:02, Scott Wood wrote: > On 04/19/2013 09:06:26 AM, Alexander Graf wrote: >> + if (notify_eoi != -1) { >> + spin_unlock_irq(&opp->lock); >> + kvm_notify_acked

Re: [PATCH v4 1/6] kvm: add device control API

2013-04-25 Thread Scott Wood
On 04/25/2013 05:47:39 AM, Alexander Graf wrote: On 25.04.2013, at 11:43, Gleb Natapov wrote: >> +void kvm_device_put(struct kvm_device *dev) >> +{ >> + if (atomic_dec_and_test(&dev->users)) >> + dev->ops->destroy(dev); >> +} >> + >> +static int kvm_device_release(struct inode

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-22 Thread Scott Wood
On 04/18/2013 07:15:46 PM, Alexander Graf wrote: On 18.04.2013, at 23:39, Scott Wood wrote: > Do we really want any default routes? There's no platform notion of GSI > here, so how is userspace to know how the kernel set it up (or what GSIs > are free to be used for new ro

Re: [PATCH 16/17] KVM: PPC: MPIC: Add support for KVM_IRQ_LINE

2013-04-19 Thread Scott Wood
On 04/19/2013 09:06:27 AM, Alexander Graf wrote: Now that all pieces are in place for reusing generic irq infrastructure, we can copy x86's implementation of KVM_IRQ_LINE irq injection and simply reuse it for PPC, as it will work there just as well. Signed-off-by: Alexander Graf --- arch/p

<    1   2   3   4   5   6   7   8   >