* [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E
@ 2013-01-22 23:54 Stuart Yoder
2013-01-24 17:42 ` Alexander Graf
2013-01-24 18:22 ` Scott Wood
0 siblings, 2 replies; 4+ messages in thread
From: Stuart Yoder @ 2013-01-22 23:54 UTC (permalink / raw)
To: agraf, benh; +Cc: linuxppc-dev, kvm-ppc, kvm, Stuart Yoder
From: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
-v2
-macro'ized loop in idle_book3e.S to avoid code
duplication, paravirt loop is now in idle_book3e.S
arch/powerpc/kernel/epapr_hcalls.S | 2 ++
arch/powerpc/kernel/idle_book3e.S | 30 ++++++++++++++++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
index 62c0dc2..9f1ebf7 100644
--- a/arch/powerpc/kernel/epapr_hcalls.S
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -17,6 +17,7 @@
#include <asm/asm-compat.h>
#include <asm/asm-offsets.h>
+#ifndef CONFIG_PPC64
/* epapr_ev_idle() was derived from e500_idle() */
_GLOBAL(epapr_ev_idle)
CURRENT_THREAD_INFO(r3, r1)
@@ -42,6 +43,7 @@ epapr_ev_idle_start:
* _TLF_NAPPING.
*/
b idle_loop
+#endif
/* Hypercall entry point. Will be patched with device tree instructions. */
.global epapr_hypercall_start
diff --git a/arch/powerpc/kernel/idle_book3e.S b/arch/powerpc/kernel/idle_book3e.S
index 4c7cb400..e1c9acd 100644
--- a/arch/powerpc/kernel/idle_book3e.S
+++ b/arch/powerpc/kernel/idle_book3e.S
@@ -16,11 +16,13 @@
#include <asm/ppc-opcode.h>
#include <asm/processor.h>
#include <asm/thread_info.h>
+#include <asm/epapr_hcalls.h>
/* 64-bit version only for now */
#ifdef CONFIG_PPC64
-_GLOBAL(book3e_idle)
+.macro BOOK3E_IDLE name loop
+_GLOBAL(\name)
/* Save LR for later */
mflr r0
std r0,16(r1)
@@ -67,7 +69,31 @@ _GLOBAL(book3e_idle)
/* We can now re-enable hard interrupts and go to sleep */
wrteei 1
-1: PPC_WAIT(0)
+ \loop
+
+.endm
+
+.macro BOOK3E_IDLE_LOOP
+1:
+ PPC_WAIT(0)
b 1b
+.endm
+
+.macro EPAPR_EV_IDLE_LOOP
+idle_loop:
+ LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
+
+.global epapr_ev_idle_start
+epapr_ev_idle_start:
+ li r3, -1
+ nop
+ nop
+ nop
+ b idle_loop
+.endm
+
+BOOK3E_IDLE epapr_ev_idle, EPAPR_EV_IDLE_LOOP
+
+BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
#endif /* CONFIG_PPC64 */
--
1.7.9.7
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E
2013-01-22 23:54 [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E Stuart Yoder
@ 2013-01-24 17:42 ` Alexander Graf
2013-01-24 18:22 ` Scott Wood
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2013-01-24 17:42 UTC (permalink / raw)
To: Stuart Yoder; +Cc: kvm-ppc, kvm, linuxppc-dev
On 23.01.2013, at 00:54, Stuart Yoder wrote:
> From: Stuart Yoder <stuart.yoder@freescale.com>
>=20
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Ben, this one is in generic powerpc code, so I'd say it's for you :).
Alex
> ---
>=20
> -v2
> -macro'ized loop in idle_book3e.S to avoid code=20
> duplication, paravirt loop is now in idle_book3e.S
>=20
> arch/powerpc/kernel/epapr_hcalls.S | 2 ++
> arch/powerpc/kernel/idle_book3e.S | 30 =
++++++++++++++++++++++++++++--
> 2 files changed, 30 insertions(+), 2 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/epapr_hcalls.S =
b/arch/powerpc/kernel/epapr_hcalls.S
> index 62c0dc2..9f1ebf7 100644
> --- a/arch/powerpc/kernel/epapr_hcalls.S
> +++ b/arch/powerpc/kernel/epapr_hcalls.S
> @@ -17,6 +17,7 @@
> #include <asm/asm-compat.h>
> #include <asm/asm-offsets.h>
>=20
> +#ifndef CONFIG_PPC64
> /* epapr_ev_idle() was derived from e500_idle() */
> _GLOBAL(epapr_ev_idle)
> CURRENT_THREAD_INFO(r3, r1)
> @@ -42,6 +43,7 @@ epapr_ev_idle_start:
> * _TLF_NAPPING.
> */
> b idle_loop
> +#endif
>=20
> /* Hypercall entry point. Will be patched with device tree =
instructions. */
> .global epapr_hypercall_start
> diff --git a/arch/powerpc/kernel/idle_book3e.S =
b/arch/powerpc/kernel/idle_book3e.S
> index 4c7cb400..e1c9acd 100644
> --- a/arch/powerpc/kernel/idle_book3e.S
> +++ b/arch/powerpc/kernel/idle_book3e.S
> @@ -16,11 +16,13 @@
> #include <asm/ppc-opcode.h>
> #include <asm/processor.h>
> #include <asm/thread_info.h>
> +#include <asm/epapr_hcalls.h>
>=20
> /* 64-bit version only for now */
> #ifdef CONFIG_PPC64
>=20
> -_GLOBAL(book3e_idle)
> +.macro BOOK3E_IDLE name loop
> +_GLOBAL(\name)
> /* Save LR for later */
> mflr r0
> std r0,16(r1)
> @@ -67,7 +69,31 @@ _GLOBAL(book3e_idle)
>=20
> /* We can now re-enable hard interrupts and go to sleep */
> wrteei 1
> -1: PPC_WAIT(0)
> + \loop
> +
> +.endm
> +
> +.macro BOOK3E_IDLE_LOOP
> +1:
> + PPC_WAIT(0)
> b 1b
> +.endm
> +
> +.macro EPAPR_EV_IDLE_LOOP
> +idle_loop:
> + LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
> +
> +.global epapr_ev_idle_start
> +epapr_ev_idle_start:
> + li r3, -1
> + nop
> + nop
> + nop
> + b idle_loop
> +.endm
> +
> +BOOK3E_IDLE epapr_ev_idle, EPAPR_EV_IDLE_LOOP
> +
> +BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
>=20
> #endif /* CONFIG_PPC64 */
> --=20
> 1.7.9.7
>=20
>=20
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E
2013-01-22 23:54 [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E Stuart Yoder
2013-01-24 17:42 ` Alexander Graf
@ 2013-01-24 18:22 ` Scott Wood
2013-01-24 18:26 ` Yoder Stuart-B08248
1 sibling, 1 reply; 4+ messages in thread
From: Scott Wood @ 2013-01-24 18:22 UTC (permalink / raw)
To: Stuart Yoder; +Cc: kvm, Stuart Yoder, kvm-ppc, agraf, linuxppc-dev
On 01/22/2013 05:54:43 PM, Stuart Yoder wrote:
> +.macro BOOK3E_IDLE_LOOP
> +1:
> + PPC_WAIT(0)
> b 1b
> +.endm
> +
> +.macro EPAPR_EV_IDLE_LOOP
> +idle_loop:
> + LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
> +
> +.global epapr_ev_idle_start
> +epapr_ev_idle_start:
> + li r3, -1
> + nop
> + nop
> + nop
> + b idle_loop
> +.endm
> +
> +BOOK3E_IDLE epapr_ev_idle, EPAPR_EV_IDLE_LOOP
> +
> +BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
Why the comma after epapr_ev_idle but not after book3e_idle?
Also you have spaces where there should be tabs.
Otherwise looks good.
-Scott=
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E
2013-01-24 18:22 ` Scott Wood
@ 2013-01-24 18:26 ` Yoder Stuart-B08248
0 siblings, 0 replies; 4+ messages in thread
From: Yoder Stuart-B08248 @ 2013-01-24 18:26 UTC (permalink / raw)
To: Wood Scott-B07421; +Cc: kvm, agraf, kvm-ppc, linuxppc-dev
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, January 24, 2013 12:22 PM
> To: Yoder Stuart-B08248
> Cc: agraf@suse.de; benh@kernel.crashing.org; linuxppc-dev@ozlabs.org; kvm=
-ppc@vger.kernel.org;
> kvm@vger.kernel.org; Yoder Stuart-B08248
> Subject: Re: [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book=
E
>=20
> On 01/22/2013 05:54:43 PM, Stuart Yoder wrote:
> > +.macro BOOK3E_IDLE_LOOP
> > +1:
> > + PPC_WAIT(0)
> > b 1b
> > +.endm
> > +
> > +.macro EPAPR_EV_IDLE_LOOP
> > +idle_loop:
> > + LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
> > +
> > +.global epapr_ev_idle_start
> > +epapr_ev_idle_start:
> > + li r3, -1
> > + nop
> > + nop
> > + nop
> > + b idle_loop
> > +.endm
> > +
> > +BOOK3E_IDLE epapr_ev_idle, EPAPR_EV_IDLE_LOOP
> > +
> > +BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
>=20
> Why the comma after epapr_ev_idle but not after book3e_idle?
>=20
> Also you have spaces where there should be tabs.
>=20
> Otherwise looks good.
Hmm...there shouldn't be a comma there. I'll respin
and fix the whitespace too.
Stuart
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-24 18:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 23:54 [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E Stuart Yoder
2013-01-24 17:42 ` Alexander Graf
2013-01-24 18:22 ` Scott Wood
2013-01-24 18:26 ` Yoder Stuart-B08248
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).