linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: "Shreyas B. Prabhu" <shreyas@linux.vnet.ibm.com>, mpe@ellerman.id.au
Cc: benh@au1.ibm.com, paulus@ozlabs.org, ego@linux.vnet.ibm.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	maddy@linux.vnet.ibm.com
Subject: Re: [PATCH v7 07/11] powerpc/powernv: Add platform support for stop instruction
Date: Fri, 08 Jul 2016 12:20:42 +1000	[thread overview]
Message-ID: <1467944442.27479.155.camel@neuling.org> (raw)
In-Reply-To: <1467924432-29003-8-git-send-email-shreyas@linux.vnet.ibm.com>


> diff --git a/arch/powerpc/include/asm/cpuidle.h b/arch/powerpc/include/as=
m/cpuidle.h
> index d2f99ca..3d7fc06 100644
> --- a/arch/powerpc/include/asm/cpuidle.h
> +++ b/arch/powerpc/include/asm/cpuidle.h
> @@ -13,6 +13,8 @@
> =C2=A0#ifndef __ASSEMBLY__
> =C2=A0extern u32 pnv_fastsleep_workaround_at_entry[];
> =C2=A0extern u32 pnv_fastsleep_workaround_at_exit[];
> +
> +extern u64 pnv_first_deep_stop_state;

mpe asked a question about this which you neither answered or addressed.
"Should this have some safe initial value?"

I'm thinking we could do this which is what you have in the init call.
=C2=A0 =C2=A0u64 pnv_first_deep_stop_state =3D=C2=A0MAX_STOP_STATE;


> @@ -439,7 +540,18 @@ timebase_resync:
> =C2=A0	=C2=A0*/
> =C2=A0	bne	cr4,clear_lock
> =C2=A0
> -	/* Restore per core state */
> +	/*
> +	=C2=A0* First thread in the core to wake up and its waking up with
> +	=C2=A0* complete hypervisor state loss. Restore per core hypervisor
> +	=C2=A0* state.
> +	=C2=A0*/
> +BEGIN_FTR_SECTION
> +	ld	r4,_PTCR(r1)
> +	mtspr	SPRN_PTCR,r4
> +	ld	r4,_RPR(r1)
> +	mtspr	SPRN_RPR,r4

RPR looks wrong here. =C2=A0This should be on POWER8 too.

This has changed since v6 and not noted in the v7 comments. =C2=A0Why are y=
ou
changing this now?

> +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
> +
> =C2=A0	ld	r4,_TSCR(r1)
> =C2=A0	mtspr	SPRN_TSCR,r4
> =C2=A0	ld	r4,_WORC(r1)
> @@ -461,9 +573,7 @@ common_exit:
> =C2=A0
> =C2=A0	/* Waking up from winkle */
> =C2=A0
> -	/* Restore per thread state */
> -	bl	__restore_cpu_power8
> -
> +BEGIN_MMU_FTR_SECTION
> =C2=A0	/* Restore SLB=C2=A0=C2=A0from PACA */
> =C2=A0	ld	r8,PACA_SLBSHADOWPTR(r13)
> =C2=A0
> @@ -477,6 +587,9 @@ common_exit:
> =C2=A0	slbmte	r6,r5
> =C2=A01:	addi	r8,r8,16
> =C2=A0	.endr
> +END_MMU_FTR_SECTION_IFCLR(MMU_FTR_RADIX)
> +
> +	/* Restore per thread state */

This FTR section is too big =C2=A0It ends up at 25 instructions with the lo=
op.
Probably better like this:

BEGIN_MMU_FTR_SECTION
	b	no_segments
END_MMU_FTR_SECTION_IFSET(MMU_FTR_RADIX)
	/* Restore SLB=C2=A0=C2=A0from PACA */
	ld	r8,PACA_SLBSHADOWPTR(r13)

	.rept	SLB_NUM_BOLTED
	li	r3, SLBSHADOW_SAVEAREA
	LDX_BE	r5, r8, r3
	addi	r3, r3, 8
	LDX_BE	r6, r8, r3
	andis.	r7,r5,SLB_ESID_V@h
	beq	1f
	slbmte	r6,r5
1:	addi	r8,r8,16
	.endr

no_segments:

  reply	other threads:[~2016-07-08  2:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 20:47 [PATCH v7 00/11] powerpc/powernv/cpuidle: Add support for POWER ISA v3 idle states Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 01/11] powerpc/powernv: Use PNV_THREAD_WINKLE macro while requesting for winkle Shreyas B. Prabhu
2016-07-15 13:10   ` Balbir Singh
2016-07-07 20:47 ` [PATCH v7 02/11] powerpc/kvm: make hypervisor state restore a function Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 03/11] powerpc/powernv: Rename idle_power7.S to idle_book3s.S Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 04/11] powerpc/powernv: Rename reusable idle functions to hardware agnostic names Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 05/11] powerpc/powernv: Make pnv_powersave_common more generic Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 06/11] powerpc/powernv: abstraction for saving SPRs before entering deep idle states Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 07/11] powerpc/powernv: Add platform support for stop instruction Shreyas B. Prabhu
2016-07-08  2:20   ` Michael Neuling [this message]
2016-07-08  4:19     ` Shreyas B Prabhu
2016-07-08  4:27       ` Michael Neuling
2016-07-07 20:47 ` [PATCH v7 08/11] cpuidle/powernv: Use CPUIDLE_STATE_MAX instead of MAX_POWERNV_IDLE_STATES Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 09/11] cpuidle/powernv: cleanup powernv_add_idle_states Shreyas B. Prabhu
2016-07-08  2:42   ` Michael Neuling
2016-07-07 20:47 ` [PATCH v7 10/11] cpuidle/powernv: Add support for POWER ISA v3 idle states Shreyas B. Prabhu
2016-07-07 20:47 ` [PATCH v7 11/11] powerpc/powernv: Use deepest stop state when cpu is offlined Shreyas B. Prabhu
2016-07-08  2:49 ` [PATCH v7 00/11] powerpc/powernv/cpuidle: Add support for POWER ISA v3 idle states Michael Neuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467944442.27479.155.camel@neuling.org \
    --to=mikey@neuling.org \
    --cc=benh@au1.ibm.com \
    --cc=ego@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@ozlabs.org \
    --cc=shreyas@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).