Re: [PATCH 2/2] KVM: PPC: booke/bookehv: Add guest debug support

2012-07-30 Thread Scott Wood
On 07/30/2012 02:37 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Friday, July 27, 2012 7:00 AM >> To: Bhushan Bharat-R65777 >> Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; ag...@suse.de; Bhushan >> Bharat- >> R65777 >> Subject: Re: [

Re: [PATCH 2/2] KVM: PPC: booke/bookehv: Add guest debug support

2012-07-26 Thread Scott Wood
On 07/26/2012 12:32 AM, Bharat Bhushan wrote: > This patch adds: > 1) KVM debug handler added for e500v2. > 2) Guest debug by qemu gdb stub. Does it make sense for these to both be in the same patch? If there's common code used by both, that could be added first. > Signed-off-by: Liu Yu > Sig

Re: [PATCH 1/2] KVM: PPC: booke: Allow multiple exception types

2012-07-26 Thread Scott Wood
On 07/26/2012 12:32 AM, Bharat Bhushan wrote: > _GLOBAL(kvmppc_handlers_start) > KVM_HANDLER BOOKE_INTERRUPT_CRITICAL SPRN_SPRG_RSCRATCH_CRIT SPRN_CSRR0 > KVM_HANDLER BOOKE_INTERRUPT_MACHINE_CHECK SPRN_SPRG_RSCRATCH_MC SPRN_MCSRR0 > @@ -94,6 +98,7 @@ KVM_HANDLER BOOKE_INTERRUPT_DEBUG SPRN_SPRG_

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-25 Thread Scott Wood
On 07/25/2012 03:37 PM, Marcelo Tosatti wrote: > On Fri, Jul 20, 2012 at 04:29:08PM -0500, Scott Wood wrote: >> On 07/20/2012 12:00 AM, Bharat Bhushan wrote: >>> This patch adds the watchdog emulation in KVM. The watchdog >>> emulation is enabled by KVM_ENABLE_CAP(KVM_

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-24 Thread Scott Wood
On 07/24/2012 02:45 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Monday, July 23, 2012 10:00 PM >> To: Bhushan Bharat-R65777 >> Cc: Wood Scott-B07421; kvm-...@vger.kernel.org; kvm@vger.kernel.org; >> ag...@suse.de >> Subject: Re: [PATCH 2/

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-23 Thread Scott Wood
On 07/23/2012 11:04 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Monday, July 23, 2012 9:31 PM >> To: Bhushan Bharat-R65777 >> Cc: Wood Scott-B07421; kvm-...@vger.kernel.org; kvm@vger.kernel.org; >> ag...@suse.de >> Subject: Re: [PATCH 2/2

Re: [PATCH v2] booke: Added ONE_REG interface for IAC/DAC debug registers

2012-07-23 Thread Scott Wood
On 07/23/2012 10:48 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Monday, July 23, 2012 9:12 PM >> To: Bhushan Bharat-R65777 >> Cc: kvm-...@vger.kernel.org; ag...@suse.de; kvm@vger.kernel.org; Bhushan >> Bharat- >> R65777 >> Subject: Re: [

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-23 Thread Scott Wood
On 07/23/2012 10:43 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Monday, July 23, 2012 9:02 PM >> To: Bhushan Bharat-R65777 >> Cc: Wood Scott-B07421; kvm-...@vger.kernel.org; kvm@vger.kernel.org; >> ag...@suse.de >> Subject: Re: [PATCH 2/2

Re: [PATCH v2] booke: Added ONE_REG interface for IAC/DAC debug registers

2012-07-23 Thread Scott Wood
On 07/23/2012 06:19 AM, Bharat Bhushan wrote: > IAC/DAC are defined as 32 bit while they are 64 bit wide. So ONE_REG > interface is added to set/get them. > > Signed-off-by: Bharat Bhushan > --- > v2: > - Using copy_to/from_user() apis. > > arch/powerpc/include/asm/kvm.h | 12 ++ >

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-23 Thread Scott Wood
On 07/21/2012 03:37 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Saturday, July 21, 2012 2:59 AM >> To: Bhushan Bharat-R65777 >> Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; ag...@suse.de; Bhushan >> Bharat- >> R65777 >> Subject: Re:

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-23 Thread Scott Wood
On 07/22/2012 11:10 PM, Bhushan Bharat-R65777 wrote: >>> @@ -386,13 +387,23 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) >>> #ifdef CONFIG_KVM_EXIT_TIMING >>> mutex_init(&vcpu->arch.exit_timing_lock); >>> #endif >>> - >>> +#ifdef CONFIG_BOOKE >>> + spin_lock_init(&vcpu->arch.wdt_lock); >

Re: [PATCH 2/2 v5] KVM: PPC: booke: Add watchdog emulation

2012-07-20 Thread Scott Wood
r expiry, it exit to QEMU > if TCR.WRC is non ZERO. QEMU can reset/shutdown etc depending upon how > it is configured. > > Signed-off-by: Liu Yu > Signed-off-by: Scott Wood > Signed-off-by: Bharat Bhushan > [bharat.bhus...@freescale.com: reworked patch] Typically the []

Re: [PATCH 2/2 v4] KVM: PPC: booke: Add watchdog emulation

2012-07-19 Thread Scott Wood
CAP(KVM_CAP_PPC_WDT) ioctl. >>> The kernel timer are used for watchdog emulation and emulates >>> h/w watchdog state machine. On watchdog timer expiry, it exit to QEMU >>> if TCR.WRC is non ZERO. QEMU can reset/shutdown etc depending upon how >>> it is configured.

Re: [PATCH 2/2 v4] KVM: PPC: booke: Add watchdog emulation

2012-07-18 Thread Scott Wood
r expiry, it exit to QEMU > if TCR.WRC is non ZERO. QEMU can reset/shutdown etc depending upon how > it is configured. > > Signed-off-by: Liu Yu > Signed-off-by: Scott Wood > Signed-off-by: Bharat Bhushan Please put a note before your signoff stating that it's been modifie

Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation

2012-07-17 Thread Scott Wood
On 07/17/2012 11:51 AM, Alexander Graf wrote: > On 07/17/2012 06:27 PM, Scott Wood wrote: >> Determining whether we're on final expiration is based only on the >> previous value of TSR[ENW,WIS] when the timer expires. We look at TCR >> to determine whether we need to

Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation

2012-07-17 Thread Scott Wood
On 07/17/2012 12:10 PM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Tuesday, July 17, 2012 10:31 PM >> To: Bhushan Bharat-R65777 >> Cc: Wood Scott-B07421; Alexander Graf; kvm-...@vger.kernel.org; >> kvm@vger.kernel.org; bharatb.ya...@gmail.co

Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation

2012-07-17 Thread Scott Wood
On 07/17/2012 11:56 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Tuesday, July 17, 2012 10:08 PM >> To: Bhushan Bharat-R65777 >> Cc: Wood Scott-B07421; Alexander Graf; kvm-...@vger.kernel.org; >> kvm@vger.kernel.org; bharatb.ya...@gmail.co

Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation

2012-07-17 Thread Scott Wood
On 07/17/2012 06:31 AM, Bhushan Bharat-R65777 wrote: int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) { -return !(v->arch.shared->msr & MSR_WE) || - !!(v->arch.pending_exceptions) || - v->requests; +bool ret = !(v->arch.shared->msr & MSR_WE) || >

Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation

2012-07-17 Thread Scott Wood
On 07/17/2012 09:35 AM, Alexander Graf wrote: > On 07/17/2012 04:13 PM, Bhushan Bharat-R65777 wrote: >> >>> -Original Message- >>> From: kvm-ppc-ow...@vger.kernel.org >>> [mailto:kvm-ppc-ow...@vger.kernel.org] On >>> Behalf Of Alexander Graf >>> Sent: Tuesday, July 17, 2012 7:31 PM >>> To:

Re: [PATCH 2/2 v2] KVM: PPC: booke: Add watchdog emulation

2012-07-16 Thread Scott Wood
On 07/16/2012 12:18 PM, Alexander Graf wrote: >> +/* >> + * Return the number of jiffies until the next timeout. If the > timeout is >> + * longer than the NEXT_TIMER_MAX_DELTA, that > > then? > >> return NEXT_TIMER_MAX_DELTA >> + * instead. > > I can read code. Come on, it's not exactly x++;

Re: [PATCH 2/2] KVM: PPC: booke: Add watchdog emulation

2012-07-09 Thread Scott Wood
On 07/07/2012 02:50 AM, Alexander Graf wrote: > > On 07.07.2012, at 01:37, Scott Wood wrote: > >> On 07/06/2012 08:17 AM, Alexander Graf wrote: >>> On 28.06.2012, at 08:17, Bharat Bhushan wrote: >>>> +/* >>>> + * The timer system can almost deal w

Re: [PATCH 2/2] KVM: PPC: booke: Add watchdog emulation

2012-07-09 Thread Scott Wood
On 07/09/2012 12:13 AM, Bhushan Bharat-R65777 wrote: > > >> -Original Message- >> From: Alexander Graf [mailto:ag...@suse.de] >> Sent: Saturday, July 07, 2012 1:21 PM >> To: Wood Scott-B07421 >> Cc: Bhushan Bharat-R65777; kvm-...@vger.kernel.org; kvm@vger.kernel.org; >> Bhushan >> Bharat

Re: [PATCH 2/2] KVM: PPC: booke: Add watchdog emulation

2012-07-06 Thread Scott Wood
On 07/06/2012 08:17 AM, Alexander Graf wrote: > On 28.06.2012, at 08:17, Bharat Bhushan wrote: >> +/* >> + * The timer system can almost deal with LONG_MAX timeouts, except that >> + * when you get very close to LONG_MAX, the slack added can cause overflow. >> + * >> + * LONG_MAX/2 is a conservativ

Re: [Qemu-ppc] [RFC PATCH 12/17] PowerPC: booke64: Add DO_KVM kernel hooks

2012-07-05 Thread Scott Wood
On 07/04/2012 01:15 PM, Caraman Mihai Claudiu-B02008 wrote: >> >> From: Alexander Graf [ag...@suse.de] >> Sent: Wednesday, July 04, 2012 6:45 PM >> To: Caraman Mihai Claudiu-B02008 >> Cc: ; KVM list; linuxppc-dev; qemu-...@nongnu.org >> List; Benjamin Herre

Re: [Qemu-ppc] [RFC PATCH 04/17] KVM: PPC64: booke: Add guest computation mode for irq delivery

2012-07-05 Thread Scott Wood
On 07/04/2012 08:40 AM, Alexander Graf wrote: > On 25.06.2012, at 14:26, Mihai Caraman wrote: >> @@ -381,7 +386,8 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu >> *vcpu, >> set_guest_esr(vcpu, vcpu->arch.queued_esr); >> if (update_dear == true) >>

Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation

2012-07-02 Thread Scott Wood
On 07/02/2012 12:53 PM, Timur Tabi wrote: > Scott Wood wrote: >>>> I'm still a little confused. Which inline assembly code is clobbering LR? >>>> Are you talking about the "BL" instruction, which wasn't there before? > >> Yes, I didn&#x

Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation

2012-07-02 Thread Scott Wood
On 07/02/2012 12:34 PM, Timur Tabi wrote: > Scott Wood wrote: > >> Hmm. The comment says, "XER, CTR, and LR are currently listed as >> clobbers because it's uncertain whether they will be clobbered." Maybe >> it dates back to when the ABI was still be

Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation

2012-07-02 Thread Scott Wood
On 07/02/2012 07:30 AM, Alexander Graf wrote: > > On 22.06.2012, at 22:06, Stuart Yoder wrote: > >> From: Liu Yu-B13201 >> >> Signed-off-by: Liu Yu >> Signed-off-by: Stuart Yoder >> --- >> -v11: no changes >> >> arch/powerpc/include/asm/epapr_hcalls.h | 22 +- >> arch/powerpc/

Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation

2012-07-02 Thread Scott Wood
On 07/02/2012 12:17 PM, Alexander Graf wrote: > > On 02.07.2012, at 19:16, Scott Wood wrote: > >> On 07/02/2012 12:13 PM, Alexander Graf wrote: >>> >>> On 02.07.2012, at 19:10, Scott Wood wrote: >>> >>>> On 07/02/2012 07:30 AM, Alexander G

Re: [PATCH v11 8/8] PPC: Don't use hardcoded opcode for ePAPR hcall invocation

2012-07-02 Thread Scott Wood
On 07/02/2012 12:13 PM, Alexander Graf wrote: > > On 02.07.2012, at 19:10, Scott Wood wrote: > >> On 07/02/2012 07:30 AM, Alexander Graf wrote: >>> >>> On 22.06.2012, at 22:06, Stuart Yoder wrote: >>> >>>> From: Liu Yu-B13201 >>>

Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs

2012-06-27 Thread Scott Wood
On 06/27/2012 06:41 AM, Caraman Mihai Claudiu-B02008 wrote: >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Wednesday, June 27, 2012 1:35 AM >> To: Caraman Mihai Claudiu-B02008 >> Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; linuxppc- >> d...@lists.ozlabs.org; qemu-...@nongnu

Re: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs

2012-06-26 Thread Scott Wood
On 06/25/2012 07:26 AM, Mihai Caraman wrote: > Add KVM_SREGS_E_64 feature and EPCR spr support in get/set sregs > for 64-bit hosts. > > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/booke.c | 14 ++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/arch/

Re: [RFC PATCH 13/17] PowerPC: booke64: Use SPRG0/3 scratch for bolted TLB miss & crit int

2012-06-26 Thread Scott Wood
On 06/25/2012 07:26 AM, Mihai Caraman wrote: > Embedded.Hypervisor category defines GSPRG0..3 physical registers for guests. > Avoid SPRG4-7 usage as scratch in host exception handlers, otherwise guest > SPRG4-7 registers will be clobbered. > For bolted TLB miss exception handlers, which is the ver

Re: [PATCH] KVM: PPC: BookE: Include trap in pt_regs

2012-05-17 Thread Scott Wood
On 05/17/2012 04:03 PM, Alexander Graf wrote: > > On 17.05.2012, at 22:58, Scott Wood wrote: > >> On 05/17/2012 03:56 PM, Alexander Graf wrote: >>> >>> On 17.05.2012, at 18:37, Scott Wood wrote: >>> >>>> On 05/16/2012 08:25 AM, Alexander Graf

Re: [PATCH] KVM: PPC: BookE: Include trap in pt_regs

2012-05-17 Thread Scott Wood
On 05/17/2012 03:56 PM, Alexander Graf wrote: > > On 17.05.2012, at 18:37, Scott Wood wrote: > >> On 05/16/2012 08:25 AM, Alexander Graf wrote: >>> When reinjecting host interrupt requests in the exit handler code, >>> let's also tell the interrupt handler w

Re: [PATCH] KVM: PPC: BookE: Include trap in pt_regs

2012-05-17 Thread Scott Wood
On 05/16/2012 08:25 AM, Alexander Graf wrote: > When reinjecting host interrupt requests in the exit handler code, > let's also tell the interrupt handler which interrupt number we're > coming from. > > Signed-off-by: Alexander Graf > --- > arch/powerpc/kvm/booke.c | 12 +++- > 1 files

Re: [PATCH v10 3/5] KVM: PPC: Add support for ePAPR idle hcall in host kernel

2012-05-16 Thread Scott Wood
On 05/08/2012 05:40 AM, Alexander Graf wrote: > > On 15.03.2012, at 21:52, Stuart Yoder wrote: > >> From: Liu Yu-B13201 >> >> And add a new flag definition in kvm_ppc_pvinfo to indicate >> whether the host supports the EV_IDLE hcall. >> >> Signed-off-by: Liu Yu >> [stuart.yo...@freescale.com: c

Re: [PATCH 2/2] KVM: PPC: Book3S: Call into C interrupt handlers

2012-04-27 Thread Scott Wood
On 04/27/2012 06:23 AM, Alexander Graf wrote: > > On 27.04.2012, at 07:48, Paul Mackerras wrote: > >> Have you measured a performance improvement with this patch? If so >> how big was it? > > Yeah, I tried things on 970 in an mfsprg/mtsprg busy loop. I measured 3 > different variants: > > C i

Re: [PATCH 2/2] KVM: PPC: Book3S: Call into C interrupt handlers

2012-04-26 Thread Scott Wood
On 04/26/2012 05:19 AM, Alexander Graf wrote: > + asm("mfmsr %0" : "=r"(msr)); Why not just mfmsr()? > + asm("bl 1f; 1: mflr %0" : "=r"(ip)); You'll want to tell the compiler that you're trashing LR. -Scott -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body o

Re: [PATCH] KVM: PPC: Fix unknown SPR error message in emulation

2012-04-26 Thread Scott Wood
On 04/26/2012 08:25 AM, Alexander Graf wrote: > > On 24.04.2012, at 11:23, Mihai Caraman wrote: > >> mtspr/mfspr emulation prints an error message for unknown SPRs. The message >> was badly formatted displaying the hex value without 0x prefix. Use decimal >> representation in accordance with the

Re: [PATCH 1/2] KVM: PPC: bookehv: Fix r8/r13 storing in level exception handler

2012-04-26 Thread Scott Wood
On 04/26/2012 06:36 AM, Alexander Graf wrote: > > On 16.04.2012, at 16:08, Mihai Caraman wrote: > >> Guest r8 register is held in the scratch register and stored correctly, >> so remove the instruction that clobbers it. Guest r13 was missing from vcpu, >> store it there. >> >> Signed-off-by: Miha

[PATCH] powerpc/e6500: add CPU_FTR_EMB_HV to CPU table

2012-04-11 Thread Scott Wood
s CPU table entry missing CPU_FTR_EMB_HV. Signed-off-by: Scott Wood --- Fixup patch for the KVM merge as requested by Marcelo. arch/powerpc/include/asm/cputable.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable

Re: New git workflow

2012-04-11 Thread Scott Wood
ed which part of the #ifdef E6500 was to go into, but please verify (73196cd364a2, 06aae86799c1b). All looks OK as far as I can see, but I have asked Scott Wood to double-check the e500/e500mc bits. e6500 should have CPU_FTR_EMB_HV. Otherwise looks OK. -Scott -- To unsubscribe from this

Re: [PATCH] Use clockevent multiplier and shifter for decrementer

2012-04-06 Thread Scott Wood
On 04/04/2012 01:51 AM, Bharat Bhushan wrote: Time for which the hrtimer is started for decrementer emulation is calculated using tb_ticks_per_usec. While hrtimer uses the clockevent for DEC reprogramming (if needed) and which calculate timebase ticks using the multiplier and shifter mechanism im

Re: [PATCH 12/38] powerpc/booke: Provide exception macros with interrupt name

2012-03-21 Thread Scott Wood
On 03/21/2012 01:04 PM, Kumar Gala wrote: > > On Feb 28, 2012, at 6:09 PM, Alexander Graf wrote: > >> From: Scott Wood >> >> DO_KVM will need to identify the particular exception type. >> >> There is an existing set of arbitrary numbers that Linux passes

Re: [PATCH v4] KVM: Factor out kvm_vcpu_kick to arch-generic code

2012-03-08 Thread Scott Wood
On 03/08/2012 03:44 PM, Christoffer Dall wrote: > Any news on the status of this? > > On Thu, Feb 9, 2012 at 8:45 PM, Alexander Graf wrote: >> Apart from this little glitch the patch looks fine to me. But I'd like to >> have Scott and Paul ack it too. ACK -Scott -- To unsubscribe from this li

Re: [PATCH] PPC: Don't sync timebase when inside VM

2012-03-08 Thread Scott Wood
On 03/08/2012 12:24 PM, McClintock Matthew-B29882 wrote: > On Thu, Mar 8, 2012 at 12:20 PM, Scott Wood wrote: >> On 03/08/2012 11:31 AM, McClintock Matthew-B29882 wrote: >>> On Fri, Mar 2, 2012 at 11:17 AM, Scott Wood wrote: >>>> On 03/02/2012 10:30 AM, Alexan

Re: [PATCH] PPC: Don't sync timebase when inside VM

2012-03-08 Thread Scott Wood
On 03/08/2012 11:31 AM, McClintock Matthew-B29882 wrote: > On Fri, Mar 2, 2012 at 11:17 AM, Scott Wood wrote: >> On 03/02/2012 10:30 AM, Alexander Graf wrote: >>> >>> On 02.03.2012, at 17:20, Scott Wood wrote: >>>> Again, for 85xx we should *never* sync the

Re: [PATCH v9 4/4] KVM: PPC: epapr: Update other hypercall invoking

2012-03-07 Thread Scott Wood
On 03/07/2012 05:37 PM, Alexander Graf wrote: > > On 08.03.2012, at 00:12, Stuart Yoder wrote: > >> diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig >> index f1ea59b..9ac4bc6 100644 >> --- a/drivers/tty/Kconfig >> +++ b/drivers/tty/Kconfig >> @@ -354,6 +354,7 @@ config TRACE_SINK >> config

Re: [PATCH v9 2/4] KVM: PPC: epapr: Add idle hcall support for host

2012-03-07 Thread Scott Wood
On 03/07/2012 05:27 PM, Alexander Graf wrote: > On 08.03.2012, at 00:12, Stuart Yoder wrote: >> >> if (vcpu->requests) { >> +/* kvm_vcpu_block() sets KVM_REQ_UNHALT, but it is >> + * not cleared elsewhere as on x86. Clear it here >> + * for now, otherwise w

Re: [PATCH v8 2/4] KVM: PPC: epapr: Add idle hcall support for host

2012-03-07 Thread Scott Wood
On 03/07/2012 04:31 PM, Stuart Yoder wrote: > @@ -888,6 +891,10 @@ out: > > static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo) > { > +#ifdef CONFIG_KVM_BOOKE_HV > + u32 inst_sc1 = 0x4422; > + pvinfo->hcall[0] = inst_sc1; > +#else > u32 inst_lis = 0x3c00; >

Re: [PATCH v2 1/2] powerpc/e500: make load_up_spe a normal fuction

2012-03-07 Thread Scott Wood
On 03/07/2012 07:56 AM, Alexander Graf wrote: > On 03/01/2012 02:20 AM, Olivia Yin wrote: >> From: Liu Yu >> >> So that we can call it when improving SPE switch like book3e did for >> fp switch. > > Timur / Scott, can you please (n)ack this one? ACK, though as it touches non-KVM code it'd be nice

Re: [PATCH] KVM: PPC: Save/Restore CR over vcpu_run

2012-03-05 Thread Scott Wood
On 03/05/2012 10:02 AM, Alexander Graf wrote: > @@ -442,6 +444,7 @@ heavyweight_exit: > > /* Return to kvm_vcpu_run(). */ > mtlrr5 > + mtcrr6 > addir1, r1, HOST_STACK_SIZE > /* r3 still contains the return code from kvmppc_handle_exit(). */ > blr > @@

Re: [PATCH] PPC: Don't sync timebase when inside VM

2012-03-02 Thread Scott Wood
On 03/02/2012 10:30 AM, Alexander Graf wrote: > > On 02.03.2012, at 17:20, Scott Wood wrote: > >> On Fri, Mar 02, 2012 at 03:12:33PM +0100, Alexander Graf wrote: >>> When running inside a virtual machine, we can not modify timebase, so >>> let's j

Re: [PATCH] PPC: Don't sync timebase when inside VM

2012-03-02 Thread Scott Wood
On Fri, Mar 02, 2012 at 03:12:33PM +0100, Alexander Graf wrote: > When running inside a virtual machine, we can not modify timebase, so > let's just not call the functions for it then. > > This resolves hangs when booting e500 SMP guests on overcommitted hosts. > > Reported-by: Stuart Yoder > Si

Re: [PATCH] KVM: PPC: Don't sync timebase when inside KVM

2012-02-29 Thread Scott Wood
On 02/29/2012 12:28 PM, Alexander Graf wrote: > > > On 29.02.2012, at 18:50, Scott Wood wrote: > >> On 02/28/2012 08:16 PM, Alexander Graf wrote: >>> When we know that we're running inside of a KVM guest, we don't have to >>> worry about synchro

Re: [PATCH] KVM: PPC: Don't sync timebase when inside KVM

2012-02-29 Thread Scott Wood
On 02/28/2012 08:16 PM, Alexander Graf wrote: > When we know that we're running inside of a KVM guest, we don't have to > worry about synchronizing timebases between different CPUs, since the > host already took care of that. > > This fixes CPU overcommit scenarios where vCPUs could hang forever t

Re: [PATCH 24/37] KVM: PPC: booke: rework rescheduling checks

2012-02-28 Thread Scott Wood
On 02/28/2012 05:03 AM, Alexander Graf wrote: > > On 27.02.2012, at 20:28, Scott Wood wrote: > >> If there is a signal pending and MSR[WE] is set, we'll loop forever >> without reaching this check. > > Good point. How about something like this on top (will fold i

Re: [PATCH v6 1/4] KVM: PPC: epapr: Factor out the epapr init

2012-02-27 Thread Scott Wood
On 02/23/2012 03:22 AM, Liu Yu wrote: > +static int __init epapr_paravirt_init(void) > +{ > + struct device_node *hyper_node; > + const u32 *insts; > + int len, i; > + > + hyper_node = of_find_node_by_path("/hypervisor"); > + if (!hyper_node) > + return -ENODEV; > +

Re: [PATCH v6 4/4] KVM: PPC: epapr: Update other hypercall invoking

2012-02-27 Thread Scott Wood
On 02/23/2012 03:22 AM, Liu Yu wrote: > diff --git a/drivers/virt/Kconfig b/drivers/virt/Kconfig > index 2dcdbc9..99ebdde 100644 > --- a/drivers/virt/Kconfig > +++ b/drivers/virt/Kconfig > @@ -15,6 +15,7 @@ if VIRT_DRIVERS > config FSL_HV_MANAGER > tristate "Freescale hypervisor management d

Re: [PATCH 36/37] KVM: PPC: booke: expose guest registers on irq reinject

2012-02-27 Thread Scott Wood
On 02/26/2012 05:59 AM, Alexander Graf wrote: > > On 25.02.2012, at 00:40, Scott Wood wrote: > >> On 02/24/2012 08:26 AM, Alexander Graf wrote: >>> +static void kvmppc_fill_pt_regs(struct kvm_vcpu *vcpu, struct pt_regs >>> *regs) >>> {

Re: [PATCH 24/37] KVM: PPC: booke: rework rescheduling checks

2012-02-27 Thread Scott Wood
On 02/24/2012 08:26 AM, Alexander Graf wrote: > -void kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu) > +int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu) > { > unsigned long *pending = &vcpu->arch.pending_exceptions; > unsigned long old_pending = vcpu->arch.pending_exception

Re: [PATCH 1/2] powerpc/e500: make load_up_spe a normal fuction

2012-02-27 Thread Scott Wood
On 02/27/2012 04:59 AM, Olivia Yin wrote: > So that we can call it in kernel. > > Signed-off-by: Liu Yu Explain why we want this, and point out that this makes it similar to load_up_fpu. > --- > arch/powerpc/kernel/head_fsl_booke.S | 23 ++- > 1 files changed, 6 insertion

Re: [PATCH 36/37] KVM: PPC: booke: expose guest registers on irq reinject

2012-02-24 Thread Scott Wood
On 02/24/2012 08:26 AM, Alexander Graf wrote: > +static void kvmppc_fill_pt_regs(struct kvm_vcpu *vcpu, struct pt_regs *regs) > { > - int r = RESUME_HOST; > + int i; > > - /* update before a new last_exit_type is rewritten */ > - kvmppc_update_timing_stats(vcpu); > + for (i =

Re: [PATCH 35/37] KVM: PPC: booke: Support perfmon interrupts

2012-02-24 Thread Scott Wood
On 02/24/2012 08:26 AM, Alexander Graf wrote: > When during guest context we get a performance monitor interrupt, we > currently bail out and oops. Let's route it to its correct handler > instead. > > Signed-off-by: Alexander Graf > --- > arch/powerpc/kvm/booke.c |4 > 1 files changed,

Re: [PATCH 33/37] KVM: PPC: bookehv: remove unused code

2012-02-24 Thread Scott Wood
On 02/24/2012 08:26 AM, Alexander Graf wrote: > There was some unused code in the exit code path that must have been > a leftover from earlier iterations. While it did no hard, it's superfluous > and thus should be removed. s/hard/harm/ -- at that assumes exit timing wasn't enabled. :-) > > Sign

Re: [PATCH v5 1/4] KVM: PPC: epapr: Factor out the epapr init

2012-02-22 Thread Scott Wood
On 02/21/2012 08:33 PM, Liu Yu-B13201 wrote: >>> +bool epapr_para_enabled = false; >> >> No need to explicitly initialize to false. > > Why not make code more readable? It's common kernel style to not explicitly initialize global data to zero or equivalent. Historically this was due to toolchain

Re: [PATCH v5 4/4] KVM: PPC: epapr: Update other hypercall invoking

2012-02-21 Thread Scott Wood
On 02/20/2012 10:46 PM, Liu Yu wrote: > Discard the old way that invoke hypercall, > instead, use epapr paravirt. > > Signed-off-by: Liu Yu > --- > v5: new patch > > arch/powerpc/include/asm/epapr_hcalls.h | 22 +- > arch/powerpc/include/asm/fsl_hcalls.h | 36 +

Re: [PATCH v5 1/4] KVM: PPC: epapr: Factor out the epapr init

2012-02-21 Thread Scott Wood
On 02/20/2012 10:46 PM, Liu Yu wrote: > from the kvm guest paravirt init code. > > Signed-off-by: Liu Yu > --- > v5: > 1. fix the if test > 2. use patch_instruction() > 3. code cleanup > 4. rename the files > 5. make epapr paravirt user-selectable > > arch/powerpc/include/asm/epapr_hcalls.h |

Re: [PATCH 24/30] KVM: PPC: booke: call resched after every exit

2012-02-20 Thread Scott Wood
On 02/20/2012 07:17 AM, Alexander Graf wrote: > > On 18.02.2012, at 00:00, Scott Wood wrote: > >> It would be simpler (both here and in the idle hcall) if we could just >> drop support for CONFIG_PREEMPT=n. :-P > > When running with CONFIG_PREEMPT=n we don'

Re: [PATCH 16/30] KVM: PPC: e500mc: Add doorbell emulation support

2012-02-20 Thread Scott Wood
On Mon, Feb 20, 2012 at 12:49:46PM +0100, Alexander Graf wrote: > > On 17.02.2012, at 22:55, Scott Wood wrote: > > > On 02/17/2012 11:13 AM, Alexander Graf wrote: > >>case BOOKE_IRQPRIO_EXTERNAL: > >> +#ifdef CONFIG_KVM_E500MC > >> + case BOOKE

Re: [PATCH 19/30] KVM: PPC: e500mc: add load inst fixup

2012-02-17 Thread Scott Wood
On 02/17/2012 11:13 AM, Alexander Graf wrote: > There's always a chance we're unable to read a guest instruction. The guest > could have its TLB mapped execute-, but not readable, something odd happens > and our TLB gets flushed. So it's a good idea to be prepared for that case > and have a fallbac

Re: [PATCH 24/30] KVM: PPC: booke: call resched after every exit

2012-02-17 Thread Scott Wood
On 02/17/2012 11:13 AM, Alexander Graf wrote: > Instead of checking whether we should reschedule only when we exited > due to an interrupt, let's always check before entering the guest back > again. This gets the target more in line with the other archs. > > Signed-off-by: Alexander Graf > --- >

Re: [PATCH 21/30] KVM: PPC: make e500v2 and e500mc mutually exclusive

2012-02-17 Thread Scott Wood
On 02/17/2012 11:13 AM, Alexander Graf wrote: > We can't build e500v2 and e500mc (kvm) support inside the same kernel. > So indicate that by making the 2 options mutually exclusive in kconfig. > > Signed-off-by: Alexander Graf > --- > arch/powerpc/kvm/Kconfig |2 +- > 1 files changed, 1 inse

Re: [PATCH 16/30] KVM: PPC: e500mc: Add doorbell emulation support

2012-02-17 Thread Scott Wood
On 02/17/2012 03:55 PM, Scott Wood wrote: > Should this be a kvm_make_request instead (with a separate > pending_doorbell bool in vcpu that msgclr can act on), considering > earlier discussion of phasing out atomics on pending_exceptions, in > favor of requests? Ignore the bit about

Re: [PATCH 16/30] KVM: PPC: e500mc: Add doorbell emulation support

2012-02-17 Thread Scott Wood
On 02/17/2012 11:13 AM, Alexander Graf wrote: > When one vcpu wants to kick another, it can issue a special IPI instruction > called msgsnd. This patch emulates this instruction, its clearing counterpart > and the infrastructure required to actually trigger that interrupt inside > a guest vcpu. >

Re: [PATCH 13/30] KVM: PPC: booke: category E.HV (GS-mode) support

2012-02-17 Thread Scott Wood
On 02/17/2012 11:13 AM, Alexander Graf wrote: > From: Scott Wood > > Chips such as e500mc that implement category E.HV in Power ISA 2.06 > provide hardware virtualization features, including a new MSR mode for > guest state. The guest OS can perform many operations without trap

Re: [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init

2012-02-17 Thread Scott Wood
On 02/17/2012 04:03 AM, Liu Yu-B13201 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Friday, February 17, 2012 1:13 AM >> To: Liu Yu-B13201 >> Cc: ag...@suse.de; kvm-...@vger.kernel.org; kvm@vger.kernel.org; >> linuxppc-...@ozlabs.org; Wood Scott-B07421 >> Subject: R

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-17 Thread Scott Wood
On 02/16/2012 06:23 PM, Alexander Graf wrote: > On 16.02.2012, at 21:41, Scott Wood wrote: >> And yes, we do have fancier hardware coming fairly soon for which this >> breaks (TLB0 entries can be loaded without host involvement, as long as >> there's a translation from

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-16 Thread Scott Wood
On 02/16/2012 01:38 PM, Avi Kivity wrote: > On 02/16/2012 09:34 PM, Alexander Graf wrote: >> On 16.02.2012, at 20:24, Avi Kivity wrote: >> >>> On 02/15/2012 04:08 PM, Alexander Graf wrote: > > Well, the scatter/gather registers I proposed will give you just one > register or all of them

Re: [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest

2012-02-16 Thread Scott Wood
On 02/16/2012 11:30 AM, Alexander Graf wrote: > > On 16.02.2012, at 18:28, Scott Wood wrote: > >> On 02/16/2012 11:18 AM, Alexander Graf wrote: >>> Hrm. But we can clobber ctr, right? So how about we make the generic >>> version do a bctr and then just do a sma

Re: [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest

2012-02-16 Thread Scott Wood
On 02/16/2012 11:18 AM, Alexander Graf wrote: > > On 16.02.2012, at 17:58, Scott Wood wrote: > >> On 02/16/2012 04:24 AM, Alexander Graf wrote: >>> On 16.02.2012, at 10:26, Liu Yu wrote: >>>> +_GLOBAL(epapr_ev_idle) >>>> +epapr_ev_idl

Re: [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest

2012-02-16 Thread Scott Wood
On 02/16/2012 03:26 AM, Liu Yu wrote: > If the guest hypervisor node contains "has-idle" property. > > Signed-off-by: Liu Yu > --- > v4: > 1. discard the CONFIG_E500 to make code for all powerpc platform > 2. code cleanup Is the TLF_NAPPING stuff supported on all powerpc platforms? -Scott -- T

Re: [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init

2012-02-16 Thread Scott Wood
On 02/16/2012 03:26 AM, Liu Yu wrote: > from the kvm guest paravirt init code. > > Signed-off-by: Liu Yu > --- > v4: > 1. code cleanup > 2. move kvm_hypercall_start() to epapr_hypercall_start() > > arch/powerpc/Kconfig|4 ++ > arch/powerpc/include/asm/epapr_hcalls.h |

Re: [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest

2012-02-16 Thread Scott Wood
On 02/16/2012 04:24 AM, Alexander Graf wrote: > On 16.02.2012, at 10:26, Liu Yu wrote: >> +_GLOBAL(epapr_ev_idle) >> +epapr_ev_idle: >> +rlwinmr3,r1,0,0,31-THREAD_SHIFT/* current thread_info */ >> +lwzr4,TI_LOCAL_FLAGS(r3)/* set napping bit */ >> +orir4,r4,_TLF_NAPP

Re: [RFC PATCH 14/16] KVM: PPC: booke: category E.HV (GS-mode) support

2012-02-15 Thread Scott Wood
On 02/15/2012 01:36 PM, Alexander Graf wrote: > > On 10.01.2012, at 01:51, Scott Wood wrote: >> I was thinking we'd check ESR[EPID] or SRR1[IS] as appropriate, and >> treat it as a kernel fault (search exception table) -- but this works >> too and is a bit cleaner (co

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-15 Thread Scott Wood
On 02/15/2012 05:57 AM, Alexander Graf wrote: > > On 15.02.2012, at 12:18, Avi Kivity wrote: > >> Well the real reason is we have an extra bit reported by page faults >> that we can control. Can't you set up a hashed pte that is configured >> in a way that it will fault, no matter what type of a

Re: [PATCH v3 1/3] KVM: PPC: epapr: Factor out the epapr init

2012-02-13 Thread Scott Wood
On 02/12/2012 11:47 PM, Liu Yu-B13201 wrote: > > >> -Original Message- >> From: Wood Scott-B07421 >> Sent: Saturday, February 11, 2012 2:40 AM >> To: Liu Yu-B13201 >> Cc: ag...@suse.de; kvm-...@vger.kernel.org; kvm@vger.kernel.org; >> linuxppc-...@ozlabs.org; Wood Scott-B07421 >> Subject:

Re: [PATCH v3 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest

2012-02-10 Thread Scott Wood
On 02/10/2012 04:02 AM, Liu Yu wrote: > +_GLOBAL(epapr_ev_idle) > +epapr_ev_idle: > +#ifdef CONFIG_E500 > + rlwinm r3,r1,0,0,31-THREAD_SHIFT /* current thread_info */ > + lwz r4,TI_LOCAL_FLAGS(r3) /* set napping bit */ > + ori r4,r4,_TLF_NAPPING /* so when we take

Re: [PATCH v3 1/3] KVM: PPC: epapr: Factor out the epapr init

2012-02-10 Thread Scott Wood
On 02/10/2012 04:02 AM, Liu Yu wrote: > from the kvm guest paravirt init code. > > Signed-off-by: Liu Yu > --- > v3: > apply the epapr init for all ppc platform > > arch/powerpc/Kconfig|4 +++ > arch/powerpc/include/asm/epapr_hcalls.h |8 + > arch/powerpc/kernel/

Re: [Android-virt] [PATCH v3] KVM: Factor out kvm_vcpu_kick to arch-generic code

2012-02-09 Thread Scott Wood
On 02/09/2012 05:23 PM, Alexander Graf wrote: > How about we return 1 for kvm_arch_vcpu_in_guest_mode() on !x86 > always, just like it's done today basically? Then we can worry about > needless IPIs later and don't regress from the respective current > kick implementations. And perhaps call the fu

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-08 Thread Scott Wood
On 02/07/2012 06:28 AM, Anthony Liguori wrote: > On 02/06/2012 01:46 PM, Scott Wood wrote: >> On 02/03/2012 04:52 PM, Anthony Liguori wrote: >>> On 02/03/2012 12:07 PM, Eric Northup wrote: >>>> How would the ability to use sys_kvm_* be regulated? >>> >&

Re: [Qemu-devel] [RFC] Next gen kvm api

2012-02-06 Thread Scott Wood
On 02/03/2012 04:52 PM, Anthony Liguori wrote: > On 02/03/2012 12:07 PM, Eric Northup wrote: >> On Thu, Feb 2, 2012 at 8:09 AM, Avi Kivity wrote: >> [...] >>> >>> Moving to syscalls avoids these problems, but introduces new ones: >>> >>> - adding new syscalls is generally frowned upon, and kvm wil

Re: [PATCH v2] qemu-kvm: Remove icache flush from cpu_physical_memory_rw

2012-01-23 Thread Scott Wood
On 01/19/2012 12:04 PM, Jan Kiszka wrote: > On 2012-01-19 18:54, Marcelo Tosatti wrote: >> On Thu, Jan 19, 2012 at 01:39:24PM +0100, Jan Kiszka wrote: >>> This is at best a PPC topi but according to [1] even there unneeded. In >>> any case, remove this diff to upstream, it should be handled there i

Re: RFC: iommu_ops -- limitation with current attach_dev() API

2012-01-12 Thread Scott Wood
On Thu, Jan 12, 2012 at 03:55:00PM +0100, Joerg Roedel wrote: > On Tue, Jan 10, 2012 at 11:15:54AM -0600, Stuart Yoder wrote: > > We have devices that are capable of and need to access multiple > > domains.At the hardware level the device has multiple 'logical > > I/O device numbers' which is

Re: RFC: extend iommu_ops with domain attributes API

2012-01-12 Thread Scott Wood
On Thu, Jan 12, 2012 at 03:47:47PM +0100, Joerg Roedel wrote: > On Tue, Jan 10, 2012 at 10:22:36AM -0600, Stuart Yoder wrote: > > A couple of the attributes I'm considering PAMU specific with a generic > > enable attribute: > > > >enum iommu_attr_type { > >IOMMU_ATTR_PAMU_GEOMETRY,

Re: [RFC PATCH 14/16] KVM: PPC: booke: category E.HV (GS-mode) support

2012-01-12 Thread Scott Wood
On Thu, Jan 12, 2012 at 05:44:26PM +1100, Benjamin Herrenschmidt wrote: > On Tue, 2012-01-10 at 04:11 +0100, Alexander Graf wrote: > > This is what book3s does: > > > > case EMULATE_FAIL: > > printk(KERN_CRIT "%s: emulation at %lx failed > > (%08x)\n", > >

[PATCH] KVM: PPC: refer to paravirt docs in header file

2012-01-11 Thread Scott Wood
-by: Scott Wood --- Documentation/virtual/kvm/ppc-pv.txt | 24 ++-- arch/powerpc/include/asm/kvm_para.h | 10 ++ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/Documentation/virtual/kvm/ppc-pv.txt b/Documentation/virtual/kvm/ppc-pv.txt index

Re: [RFC PATCH 16/16] KVM: PPC: e500mc support

2012-01-10 Thread Scott Wood
On 01/10/2012 02:37 AM, Avi Kivity wrote: > On 01/09/2012 09:29 PM, Scott Wood wrote: >>> >>> Best to include their signoffs, if possible. >> >> These patches are based in part on a bunch of different patches from >> these people (for which I did receive sign

Re: [RFC PATCH 14/16] KVM: PPC: booke: category E.HV (GS-mode) support

2012-01-10 Thread Scott Wood
On 01/09/2012 09:11 PM, Alexander Graf wrote: > On 10.01.2012, at 01:51, Scott Wood wrote: >> On 01/09/2012 11:46 AM, Alexander Graf wrote: >>> On 21.12.2011, at 02:34, Scott Wood wrote: >>>> + /* For debugging, encode the failing instruction and >>>

<    1   2   3   4   5   6   7   8   >