* Re: [PATCH v2] powerpc 32: Provides VIRT_CPU_ACCOUNTING
From: Benjamin Herrenschmidt @ 2014-04-30 4:57 UTC (permalink / raw)
To: Christophe Leroy
Cc: scottwood, linuxppc-dev, Paul Mackerras, linux-kernel, alistair
In-Reply-To: <20140407073147.6F87E1A4BDE@localhost.localdomain>
On Mon, 2014-04-07 at 09:31 +0200, Christophe Leroy wrote:
> This patch provides VIRT_CPU_ACCOUTING to PPC32 architecture.
> Unlike PPC64, PPC32 doesn't use the PACA convention. Therefore the
> implementation is taken from the IA64 architecture.
> It is based on additional information added to the Task Info structure.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Scott, Can you review/ack this (or get somebody to) ?
It looks like a great idea but I really don't have the bandwidth to
review in detail and test right now.
(Adding Alister as well who maintains our 4xx 32-bit stuff nowadays).
Cheers,
Ben.
> Index: b/arch/powerpc/Kconfig
> ===================================================================
> --- a/arch/powerpc/Kconfig (revision 5607)
> +++ b/arch/powerpc/Kconfig (revision 5611)
> @@ -138,6 +138,7 @@
> select OLD_SIGSUSPEND
> select OLD_SIGACTION if PPC32
> select HAVE_DEBUG_STACKOVERFLOW
> + select HAVE_VIRT_CPU_ACCOUNTING
>
> config EARLY_PRINTK
> bool
> Index: a/arch/powerpc/kernel/time.c
> ===================================================================
> --- a/arch/powerpc/kernel/time.c (revision 5607)
> +++ b/arch/powerpc/kernel/time.c (revision 5611)
> @@ -162,7 +162,9 @@
>
> cputime_t cputime_one_jiffy;
>
> +#ifdef CONFIG_PPC_SPLPAR
> void (*dtl_consumer)(struct dtl_entry *, u64);
> +#endif
>
> static void calc_cputime_factors(void)
> {
> @@ -178,6 +180,7 @@
> __cputime_clockt_factor = res.result_low;
> }
>
> +#ifdef CONFIG_PPC64
> /*
> * Read the SPURR on systems that have it, otherwise the PURR,
> * or if that doesn't exist return the timebase value passed in.
> @@ -190,6 +193,7 @@
> return mfspr(SPRN_PURR);
> return tb;
> }
> +#endif
>
> #ifdef CONFIG_PPC_SPLPAR
>
> @@ -291,6 +295,7 @@
> * Account time for a transition between system, hard irq
> * or soft irq state.
> */
> +#ifdef CONFIG_PPC64
> static u64 vtime_delta(struct task_struct *tsk,
> u64 *sys_scaled, u64 *stolen)
> {
> @@ -377,7 +382,70 @@
> get_paca()->utime_sspurr = 0;
> account_user_time(tsk, utime, utimescaled);
> }
> +#else
>
> +void vtime_account_user(struct task_struct *tsk)
> +{
> + cputime_t delta_utime;
> + struct thread_info *ti = task_thread_info(tsk);
> +
> + if (ti->ac_utime) {
> + delta_utime = ti->ac_utime;
> + account_user_time(tsk, delta_utime, delta_utime);
> + ti->ac_utime = 0;
> + }
> +}
> +
> +/*
> + * Called from the context switch with interrupts disabled, to charge all
> + * accumulated times to the current process, and to prepare accounting on
> + * the next process.
> + */
> +void arch_vtime_task_switch(struct task_struct *prev)
> +{
> + struct thread_info *pi = task_thread_info(prev);
> + struct thread_info *ni = task_thread_info(current);
> +
> + ni->ac_stamp = pi->ac_stamp;
> + ni->ac_stime = ni->ac_utime = 0;
> +}
> +
> +/*
> + * Account time for a transition between system, hard irq or soft irq state.
> + * Note that this function is called with interrupts enabled.
> + */
> +static cputime_t vtime_delta(struct task_struct *tsk)
> +{
> + struct thread_info *ti = task_thread_info(tsk);
> + __u32 delta_stime;
> + __u32 now;
> +
> + WARN_ON_ONCE(!irqs_disabled());
> +
> + now = mftbl();
> +
> + delta_stime = ti->ac_stime + (now - ti->ac_stamp);
> + ti->ac_stime = 0;
> + ti->ac_stamp = now;
> +
> + return (cputime_t)delta_stime;
> +}
> +
> +void vtime_account_system(struct task_struct *tsk)
> +{
> + cputime_t delta = vtime_delta(tsk);
> +
> + account_system_time(tsk, 0, delta, delta);
> +}
> +EXPORT_SYMBOL_GPL(vtime_account_system);
> +
> +void vtime_account_idle(struct task_struct *tsk)
> +{
> + account_idle_time(vtime_delta(tsk));
> +}
> +
> +#endif
> +
> #else /* ! CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
> #define calc_cputime_factors()
> #endif
> @@ -871,6 +939,8 @@
> ppc_proc_freq / 1000000, ppc_proc_freq % 1000000);
> }
>
> + mttbl(0);
> + mttbu(0);
> tb_ticks_per_jiffy = ppc_tb_freq / HZ;
> tb_ticks_per_sec = ppc_tb_freq;
> tb_ticks_per_usec = ppc_tb_freq / 1000000;
> Index: b/arch/powerpc/kernel/entry_32.S
> ===================================================================
> --- a/arch/powerpc/kernel/entry_32.S (revision 5607)
> +++ b/arch/powerpc/kernel/entry_32.S (revision 5611)
> @@ -177,6 +177,12 @@
> addi r12,r12,-1
> stw r12,4(r11)
> #endif
> +#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
> + CURRENT_THREAD_INFO(r9, r1)
> + tophys(r9, r9)
> + ACCOUNT_CPU_USER_ENTRY(r9, r11, r12)
> +#endif
> +
> b 3f
>
> 2: /* if from kernel, check interrupted DOZE/NAP mode and
> @@ -406,6 +412,13 @@
> lwarx r7,0,r1
> END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
> stwcx. r0,0,r1 /* to clear the reservation */
> +#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
> + andi. r4,r8,MSR_PR
> + beq 3f
> + CURRENT_THREAD_INFO(r4, r1)
> + ACCOUNT_CPU_USER_EXIT(r4, r5, r7)
> +3:
> +#endif
> lwz r4,_LINK(r1)
> lwz r5,_CCR(r1)
> mtlr r4
> @@ -841,6 +854,10 @@
> andis. r10,r0,DBCR0_IDM@h
> bnel- load_dbcr0
> #endif
> +#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
> + CURRENT_THREAD_INFO(r9, r1)
> + ACCOUNT_CPU_USER_EXIT(r9, r10, r11)
> +#endif
>
> b restore
>
> Index: b/arch/powerpc/kernel/asm-offsets.c
> ===================================================================
> --- a/arch/powerpc/kernel/asm-offsets.c (revision 5607)
> +++ b/arch/powerpc/kernel/asm-offsets.c (revision 5611)
> @@ -167,6 +167,12 @@
> DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
> DEFINE(TI_TASK, offsetof(struct thread_info, task));
> DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
> +#if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) && defined(CONFIG_PPC32)
> + DEFINE(TI_AC_STAMP, offsetof(struct thread_info, ac_stamp));
> + DEFINE(TI_AC_LEAVE, offsetof(struct thread_info, ac_leave));
> + DEFINE(TI_AC_STIME, offsetof(struct thread_info, ac_stime));
> + DEFINE(TI_AC_UTIME, offsetof(struct thread_info, ac_utime));
> +#endif
>
> #ifdef CONFIG_PPC64
> DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
> Index: b/arch/powerpc/include/asm/thread_info.h
> ===================================================================
> --- a/arch/powerpc/include/asm/thread_info.h (revision 5607)
> +++ b/arch/powerpc/include/asm/thread_info.h (revision 5611)
> @@ -43,6 +43,12 @@
> int cpu; /* cpu we're on */
> int preempt_count; /* 0 => preemptable,
> <0 => BUG */
> +#if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) && defined(CONFIG_PPC32)
> + u32 ac_stamp;
> + u32 ac_leave;
> + u32 ac_stime;
> + u32 ac_utime;
> +#endif
> struct restart_block restart_block;
> unsigned long local_flags; /* private flags for thread */
>
> Index: b/arch/powerpc/include/asm/cputime.h
> ===================================================================
> --- a/arch/powerpc/include/asm/cputime.h (revision 5607)
> +++ b/arch/powerpc/include/asm/cputime.h (revision 5611)
> @@ -228,7 +228,11 @@
>
> #define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct))
>
> +#ifdef CONFIG_PPC64
> static inline void arch_vtime_task_switch(struct task_struct *tsk) { }
> +#else
> +extern void arch_vtime_task_switch(struct task_struct *tsk);
> +#endif
>
> #endif /* __KERNEL__ */
> #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
> Index: b/arch/powerpc/include/asm/ppc_asm.h
> ===================================================================
> --- a/arch/powerpc/include/asm/ppc_asm.h (revision 5607)
> +++ b/arch/powerpc/include/asm/ppc_asm.h (revision 5611)
> @@ -25,10 +25,16 @@
> */
>
> #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
> +#ifdef CONFIG_PPC64
> #define ACCOUNT_CPU_USER_ENTRY(ra, rb)
> #define ACCOUNT_CPU_USER_EXIT(ra, rb)
> +#else /* CONFIG_PPC64 */
> +#define ACCOUNT_CPU_USER_ENTRY(ti, ra, rb)
> +#define ACCOUNT_CPU_USER_EXIT(ti, ra, rb)
> +#endif /* CONFIG_PPC64 */
> #define ACCOUNT_STOLEN_TIME
> -#else
> +#else /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
> +#ifdef CONFIG_PPC64
> #define ACCOUNT_CPU_USER_ENTRY(ra, rb) \
> MFTB(ra); /* get timebase */ \
> ld rb,PACA_STARTTIME_USER(r13); \
> @@ -68,7 +74,27 @@
> #define ACCOUNT_STOLEN_TIME
>
> #endif /* CONFIG_PPC_SPLPAR */
> +#else /* CONFIG_PPC64 */
> +#define ACCOUNT_CPU_USER_ENTRY(ti, ra, rb) \
> + MFTB(ra); \
> + lwz rb, TI_AC_LEAVE(ti); \
> + stw ra, TI_AC_STAMP(ti); /* AC_STAMP = NOW */ \
> + subf rb, rb, ra; /* R = NOW - AC_LEAVE */ \
> + lwz ra, TI_AC_UTIME(ti); \
> + add ra, rb, ra; /* AC_UTIME += R */ \
> + stw ra, TI_AC_UTIME(ti); \
>
> +#define ACCOUNT_CPU_USER_EXIT(ti, ra, rb) \
> + MFTB(ra); \
> + lwz rb, TI_AC_STAMP(ti); \
> + stw ra, TI_AC_LEAVE(ti); \
> + subf rb, rb, ra; /* R = NOW - AC_STAMP */ \
> + lwz ra, TI_AC_STIME(ti); \
> + add ra, rb, ra; /* AC_STIME += R */ \
> + stw ra, TI_AC_STIME(ti); \
> +
> +#endif /* CONFIG_PPC64 */
> +
> #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
>
> /*
> Index: b/arch/powerpc/platforms/Kconfig.cputype
> ===================================================================
> --- a/arch/powerpc/platforms/Kconfig.cputype (revision 5607)
> +++ b/arch/powerpc/platforms/Kconfig.cputype (revision 5611)
> @@ -1,7 +1,6 @@
> config PPC64
> bool "64-bit kernel"
> default n
> - select HAVE_VIRT_CPU_ACCOUNTING
> help
> This option selects whether a 32-bit or a 64-bit kernel
> will be built.
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: mm: use macro PGTABLE_EADDR_SIZE instead of digital
From: Aneesh Kumar K.V @ 2014-04-30 5:30 UTC (permalink / raw)
To: Liu Ping Fan, linuxppc-dev; +Cc: Paul Mackerras
In-Reply-To: <1385000275-5988-1-git-send-email-pingfank@linux.vnet.ibm.com>
Liu Ping Fan <kernelfans@gmail.com> writes:
> In case of extending the eaddr in future, use this macro
> PGTABLE_EADDR_SIZE to ease the maintenance of the code.
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> arch/powerpc/mm/slb_low.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
> index 17aa6df..e0b3cf4 100644
> --- a/arch/powerpc/mm/slb_low.S
> +++ b/arch/powerpc/mm/slb_low.S
> @@ -35,7 +35,7 @@ _GLOBAL(slb_allocate_realmode)
> * check for bad kernel/user address
> * (ea & ~REGION_MASK) >= PGTABLE_RANGE
> */
> - rldicr. r9,r3,4,(63 - 46 - 4)
> + rldicr. r9,r3,4,(63 - PGTABLE_EADDR_SIZE - 4)
> bne- 8f
>
> srdi r9,r3,60 /* get region */
> --
> 1.8.1.4
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH RFC v12 0/7] MPC512x DMA slave s/g support, OF DMA lookup
From: Alexander Popov @ 2014-04-30 5:46 UTC (permalink / raw)
To: Gerhard Sittig, Dan Williams, Vinod Koul, Lars-Peter Clausen,
Arnd Bergmann, Anatolij Gustschin, Andy Shevchenko,
Alexander Popov, linuxppc-dev, dmaengine
Cc: devicetree
In-Reply-To: <1398261209-5578-1-git-send-email-a13xp0p0v88@gmail.com>
Hello
2014-04-23 17:53 GMT+04:00 Alexander Popov <a13xp0p0v88@gmail.com>:
> Changes in v12:
> A new patch (part 2/7) is added to this series.
> Part 6/7:
> - change the description of 'compatible' property according part 2/7;
> - improve the document according Gerhard's feedback;
Could I have a feedback? Is the binding document fine now?
Thanks!
> Alexander Popov (7):
> dma: mpc512x: reorder mpc8308 specific instructions
> dma: mpc512x: separate 'compatible' values for MPC512x and MPC8308
> dma: mpc512x: add support for peripheral transfers
> dma: mpc512x: fix freeing resources in mpc_dma_probe() and
> mpc_dma_remove()
> dma: of: add common xlate function for matching by channel id
> dma: mpc512x: add device tree binding document
> dma: mpc512x: register for device tree channel lookup
>
> .../devicetree/bindings/dma/mpc512x-dma.txt | 40 +++
> arch/powerpc/boot/dts/mpc5121.dtsi | 1 +
> arch/powerpc/boot/dts/mpc8308_p1m.dts | 2 +-
> arch/powerpc/boot/dts/mpc8308rdb.dts | 2 +-
> drivers/dma/mpc512x_dma.c | 346 ++++++++++++++++++---
> drivers/dma/of-dma.c | 35 +++
> include/linux/of_dma.h | 4 +
> 7 files changed, 390 insertions(+), 40 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/dma/mpc512x-dma.txt
>
> --
> 1.8.4.2
>
Best regards,
Alexander
^ permalink raw reply
* [PATCH] powerpc: fix skipping call to early_init_fdt_scan_reserved_mem
From: Rob Herring @ 2014-04-30 6:03 UTC (permalink / raw)
To: linux-kernel, devicetree
Cc: Rob Herring, Paul Mackerras, Grant Likely, linuxppc-dev,
Marek Szyprowski
From: Rob Herring <robh@kernel.org>
The call to early_init_fdt_scan_reserved_mem will be skipped if
reserved-ranges is not found. Move the call earlier so that it is called
unconditionally.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Tested-by: Stephen Chivers <schivers@csc.com>
---
I found this issue in testing of my fdt clean-up series (thanks to
Stephen). Since the reserved memory support is new, I don't think it is
critical to fix this for 3.15. I plan to include this with my fdt series
for 3.16 unless I hear otherwise.
Rob
arch/powerpc/kernel/prom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 668aa47..d657549 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -567,6 +567,8 @@ static void __init early_reserve_mem_dt(void)
unsigned long i, len, dt_root;
const __be32 *prop;
+ early_init_fdt_scan_reserved_mem();
+
dt_root = of_get_flat_dt_root();
prop = of_get_flat_dt_prop(dt_root, "reserved-ranges", &len);
@@ -589,8 +591,6 @@ static void __init early_reserve_mem_dt(void)
memblock_reserve(base, size);
}
}
-
- early_init_fdt_scan_reserved_mem();
}
static void __init early_reserve_mem(void)
--
1.9.1
^ permalink raw reply related
* Re: [PATCH v2] powerpc: Add cpu family documentation
From: Michael Ellerman @ 2014-04-30 6:45 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, Stephen Rothwell
In-Reply-To: <1391553822.6733.189.camel@snotra.buserror.net>
On Tue, 2014-02-04 at 16:43 -0600, Scott Wood wrote:
> On Sat, 2014-02-01 at 15:35 +1100, Michael Ellerman wrote:
> > This patch adds some documentation on the different cpu families
> > supported by arch/powerpc.
> >
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> > ---
> > v2: Reworked formatting to avoid wrapping.
> > Fixed up Freescale details.
> >
> >
> > Documentation/powerpc/cpu_families.txt | 227 +++++++++++++++++++++++++++++++++
> > 1 file changed, 227 insertions(+)
> > create mode 100644 Documentation/powerpc/cpu_families.txt
> >
> > diff --git a/Documentation/powerpc/cpu_families.txt b/Documentation/powerpc/cpu_families.txt
> > new file mode 100644
> > index 0000000..fa4f159
> > --- /dev/null
> > +++ b/Documentation/powerpc/cpu_families.txt
> > @@ -0,0 +1,227 @@
> > +CPU Families
> > +============
> > +
> > +This document tries to summarise some of the different cpu families that exist
> > +and are supported by arch/powerpc.
> > +
> > +
> > +Book3S (aka sPAPR)
> > +------------------
> > +
> > + - Hash MMU
> > + - Mix of 32 & 64 bit
> > +
> > + +--------------+ +----------------+
> > + | Old POWER | ---------------------------> | RS64 (threads) |
> > + +--------------+ +----------------+
> > + |
> > + |
> > + v
> > + +--------------+ +----------------+ +-------+
> > + | 601 | ---------------------------> | 603 | -> | 740 |
> > + +--------------+ +----------------+ +-------+
> > + | |
> > + | |
> > + v v
> > + +--------------+ +----------------+ +-------+
> > + | 604 | | 750 (G3) | -> | 750CX |
> > + +--------------+ +----------------+ +-------+
> > + | | |
> > + | | |
> > + v v v
> > + +--------------+ +----------------+ +-------+
> > + | 620 (64 bit) | | 7400 | | 750CL |
> > + +--------------+ +----------------+ +-------+
> > + | | |
> > + | | |
> > + v v v
> > + +--------------+ +----------------+ +-------+
> > + | POWER3/630 | | 7410 | | 750FX |
> > + +--------------+ +----------------+ +-------+
> > + | |
> > + | |
> > + v v
> > + +--------------+ +----------------+
> > + | POWER3+ | | 7450 |
> > + +--------------+ +----------------+
> > + | |
> > + | |
> > + v v
> > + +--------------+ +----------------+
> > + | POWER4 | | 7455 |
> > + +--------------+ +----------------+
> > + | |
> > + | |
> > + v v
> > + +--------------+ +-------+ +----------------+
> > + | POWER4+ | ---------------> | 970 | | 7447 |
> > + +--------------+ +-------+ +----------------+
> > + | | |
> > + | | |
> > + v v v
> > + +--------------+ +-------+ +-------+ +----------------+
> > + | POWER5 | --> | Cell | | 970FX | | 7448 |
> > + +--------------+ +-------+ +-------+ +----------------+
> > + | |
> > + | |
> > + v v
> > + +--------------+ +-------+
> > + | POWER5+ | | 970MP |
> > + +--------------+ +-------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | POWER5++ |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | POWER6 |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | POWER7 |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | POWER7+ |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | POWER8 |
> > + +--------------+
> > +
> > +
> > + +---------------+
> > + | PA6T (64 bit) |
> > + +---------------+
>
> Missing e300 (603 derivative) and e600 (7448 derivative).
Happy to add them, where do they hang off?
> > +IBM BookE
> > +---------
> > +
> > + - Software loaded TLB.
> > + - All 32 bit
> > +
> > + +--------------+
> > + | 401 |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | 403 |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | 405 |
> > + +--------------+
> > + |
> > + |
> > + v
>
> Are 40x considered booke?
You tell me.
> > +Motorola/Freescale 8xx
> > +----------------------
> > +
> > + - Software loaded with hardware assist.
> > + - All 32 bit
> > +
> > + +--------------+
> > + | 8xx |
> > + +--------------+
> > + |
> > + |
> > + v
> > + +--------------+
> > + | 850 |
> > + +--------------+
>
> Is the core of MPC850 different from other MPC8xx?
Dunno, maybe someone who works at Freescale knows ;)
> > +Freescale BookE
> > +---------------
> > +
> > + - Software loaded TLB.
> > + - e6500 adds HW loaded indirect TLB entries.
> > + - Mix of 32 & 64 bit
> > +
> > + +--------------+
> > + | e200 |
> > + +--------------+
> > +
> > +
> > + +--------------------------------+
> > + | e500 |
> > + +--------------------------------+
> > + |
> > + |
> > + v
> > + +--------------------------------+
> > + | e500v2 |
> > + +--------------------------------+
> > + |
> > + |
> > + v
> > + +--------------------------------+
> > + | e500mc |
> > + +--------------------------------+
> > + |
> > + |
> > + v
> > + +--------------------------------+
> > + | e5500 (Book3e) (64 bit) |
> > + +--------------------------------+
> > + |
> > + |
> > + v
> > + +--------------------------------+
> > + | e6500 (HW TLB) (Multithreaded) |
> > + +--------------------------------+
>
> Why (Book3e) on e5500? e500mc is also an ISA 2.06 book3e core.
OK. I'll move Book3e to e500mc. It's implied that it continues to apply to the
derivatives.
cheers
^ permalink raw reply
* Re: [PATCH V3 2/2] powerpc/pseries: init fault_around_order for pseries
From: Rusty Russell @ 2014-04-30 7:04 UTC (permalink / raw)
To: Ingo Molnar, Madhavan Srinivasan
Cc: linux-arch, riel, ak, dave.hansen, peterz, x86, linux-kernel,
linux-mm, paulus, mgorman, Linus Torvalds, akpm, linuxppc-dev,
kirill.shutemov
In-Reply-To: <20140429070632.GB27951@gmail.com>
Ingo Molnar <mingo@kernel.org> writes:
> * Madhavan Srinivasan <maddy@linux.vnet.ibm.com> wrote:
>
>> Performance data for different FAULT_AROUND_ORDER values from 4 socket
>> Power7 system (128 Threads and 128GB memory). perf stat with repeat of 5
>> is used to get the stddev values. Test ran in v3.14 kernel (Baseline) and
>> v3.15-rc1 for different fault around order values.
>>
>> FAULT_AROUND_ORDER Baseline 1 3 4 5 8
>>
>> Linux build (make -j64)
>> minor-faults 47,437,359 35,279,286 25,425,347 23,461,275 22,002,189 21,435,836
>> times in seconds 347.302528420 344.061588460 340.974022391 348.193508116 348.673900158 350.986543618
>> stddev for time ( +- 1.50% ) ( +- 0.73% ) ( +- 1.13% ) ( +- 1.01% ) ( +- 1.89% ) ( +- 1.55% )
>> %chg time to baseline -0.9% -1.8% 0.2% 0.39% 1.06%
>
> Probably too noisy.
A little, but 3 still looks like the winner.
>> Linux rebuild (make -j64)
>> minor-faults 941,552 718,319 486,625 440,124 410,510 397,416
>> times in seconds 30.569834718 31.219637539 31.319370649 31.434285472 31.972367174 31.443043580
>> stddev for time ( +- 1.07% ) ( +- 0.13% ) ( +- 0.43% ) ( +- 0.18% ) ( +- 0.95% ) ( +- 0.58% )
>> %chg time to baseline 2.1% 2.4% 2.8% 4.58% 2.85%
>
> Here it looks like a speedup. Optimal value: 5+.
No, lower time is better. Baseline (no faultaround) wins.
etc.
It's not a huge surprise that a 64k page arch wants a smaller value than
a 4k system. But I agree: I don't see much upside for FAO > 0, but I do
see downside.
Most extreme results:
Order 1: 2% loss on recompile. 10% win 4% loss on seq. 9% loss random.
Order 3: 2% loss on recompile. 6% win 5% loss on seq. 14% loss on random.
Order 4: 2.8% loss on recompile. 10% win 7% loss on seq. 9% loss on random.
> I'm starting to suspect that maybe workloads ought to be given a
> choice in this matter, via madvise() or such.
I really don't think they'll be able to use it; it'll change far too
much with machine and kernel updates. I think we should apply patch #1
(with fixes) to make it a variable, then set it to 0 for PPC.
Cheers,
Rusty.
^ permalink raw reply
* [PATCH] PPC: BOOK3S: Disable/Enable TM looking at the ibm, pa-features device tree entry
From: Aneesh Kumar K.V @ 2014-04-30 8:11 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev, Aneesh Kumar K.V
Runtime disable transactional memory feature looking at pa-features
device tree entry. This provides a mechanism to disable TM on P8
systems.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
arch/powerpc/kernel/prom.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 668aa4791fd7..537bd7e7db0b 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -161,6 +161,11 @@ static struct ibm_pa_feature {
{CPU_FTR_NODSISRALIGN, 0, 0, 1, 1, 1},
{0, MMU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0},
{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
+ /*
+ * We should use CPU_FTR_TM_COMP so that if we disable TM, it won't get
+ * enabled via device tree
+ */
+ {CPU_FTR_TM_COMP, 0, 0, 22, 0, 0},
};
static void __init scan_features(unsigned long node, unsigned char *ftrs,
--
1.9.1
^ permalink raw reply related
* Re: [PATCH V3 2/2] powerpc/pseries: init fault_around_order for pseries
From: Madhavan Srinivasan @ 2014-04-30 8:15 UTC (permalink / raw)
To: Rusty Russell, Ingo Molnar
Cc: linux-arch, riel, ak, dave.hansen, peterz, x86, linux-kernel,
linux-mm, paulus, mgorman, Linus Torvalds, akpm, linuxppc-dev,
kirill.shutemov
In-Reply-To: <87d2fz47tg.fsf@rustcorp.com.au>
On Wednesday 30 April 2014 12:34 PM, Rusty Russell wrote:
> Ingo Molnar <mingo@kernel.org> writes:
>> * Madhavan Srinivasan <maddy@linux.vnet.ibm.com> wrote:
>>
>>> Performance data for different FAULT_AROUND_ORDER values from 4 socket
>>> Power7 system (128 Threads and 128GB memory). perf stat with repeat of 5
>>> is used to get the stddev values. Test ran in v3.14 kernel (Baseline) and
>>> v3.15-rc1 for different fault around order values.
>>>
>>> FAULT_AROUND_ORDER Baseline 1 3 4 5 8
>>>
>>> Linux build (make -j64)
>>> minor-faults 47,437,359 35,279,286 25,425,347 23,461,275 22,002,189 21,435,836
>>> times in seconds 347.302528420 344.061588460 340.974022391 348.193508116 348.673900158 350.986543618
>>> stddev for time ( +- 1.50% ) ( +- 0.73% ) ( +- 1.13% ) ( +- 1.01% ) ( +- 1.89% ) ( +- 1.55% )
>>> %chg time to baseline -0.9% -1.8% 0.2% 0.39% 1.06%
>>
>> Probably too noisy.
>
> A little, but 3 still looks like the winner.
>
>>> Linux rebuild (make -j64)
>>> minor-faults 941,552 718,319 486,625 440,124 410,510 397,416
>>> times in seconds 30.569834718 31.219637539 31.319370649 31.434285472 31.972367174 31.443043580
>>> stddev for time ( +- 1.07% ) ( +- 0.13% ) ( +- 0.43% ) ( +- 0.18% ) ( +- 0.95% ) ( +- 0.58% )
>>> %chg time to baseline 2.1% 2.4% 2.8% 4.58% 2.85%
>>
>> Here it looks like a speedup. Optimal value: 5+.
>
> No, lower time is better. Baseline (no faultaround) wins.
>
>
> etc.
>
> It's not a huge surprise that a 64k page arch wants a smaller value than
> a 4k system. But I agree: I don't see much upside for FAO > 0, but I do
> see downside.
>
> Most extreme results:
> Order 1: 2% loss on recompile. 10% win 4% loss on seq. 9% loss random.
> Order 3: 2% loss on recompile. 6% win 5% loss on seq. 14% loss on random.
> Order 4: 2.8% loss on recompile. 10% win 7% loss on seq. 9% loss on random.
>
>> I'm starting to suspect that maybe workloads ought to be given a
>> choice in this matter, via madvise() or such.
>
> I really don't think they'll be able to use it; it'll change far too
> much with machine and kernel updates. I think we should apply patch #1
> (with fixes) to make it a variable, then set it to 0 for PPC.
>
Ok. Will do.
Thanks for review
With regards
Maddy
> Cheers,
> Rusty.
>
^ permalink raw reply
* Re: [PATCH 0/3] Add new ptrace request macros on PowerPC
From: Anshuman Khandual @ 2014-04-30 8:16 UTC (permalink / raw)
To: Michael Neuling; +Cc: Linux PPC dev, oleg, linux-kernel, roland, avagin
In-Reply-To: <20730.1398817745@ale.ozlabs.ibm.com>
On 04/30/2014 05:59 AM, Michael Neuling wrote:
> Anshuman Khandual <khandual@linux.vnet.ibm.com> wrote:
>
>> On 04/29/2014 01:52 PM, Michael Neuling wrote:
>>> That's not what that patch does. It shouldn't make any user visible changes
>>> to DSCR or PPR.
>>
>> It may not when it runs uninterrupted but after the tracee process has
>> stopped, thread.dscr reflects the default DSCR value as mentioned
>> before. This can be proved by changing the "dscr_default" value in
>> arch/powerpc/sysfs.c file.
>
> The intention with DSCR is that if the user changes the DSCR, the kernel
> should always save/restore it. If you are seeing something else, then
> that is a bug. Anton has a test case for this here:
>
> http://ozlabs.org/~anton/junkcode/dscr_explicit_test.c
>
> If that is failing, then there is a bug that we need to fix.
>
Anton's above DSCR test passed.
> The PPR is the same, except that the kernel can change it over a
> syscall.
>
>>> Over syscall PPR and DSCR may change.
>
> Sorry, this should be only PPR. DSCR shouldn't change over a syscall,
> at least that's the intention.
>
>>> Depending on your test case, that may
>>> be your problem.
>>
>> I would guess when the tracee process stops for ptrace analysis, tm_reclaim or
>> tm_recheckpoint path might be crossed which is causing this dscr_default value
>> to go into thread_struct.
>
> That shouldn't happen. If that's happening, it's a bug.
I would believe this is happening. Also after reverting the commit
e9bdc3d6143d1c4b8d8ce5231, thread.dscr reflects the same value as that
of thread.tm_dscr which is the check pointed DSCR register value just
before the transaction started. So even the NIP has moved passed the point
where the user changes DSCR inside the transaction, thread.dscr is unable
to capture that latest value. But thread.dscr must contain the latest user
changed value of DSCR which is definitely not happening here. So there is
a problem we need to fix.
^ permalink raw reply
* Re: [PATCH 0/6] Implement split core for POWER8
From: Alexander Graf @ 2014-04-30 9:52 UTC (permalink / raw)
To: Michael Neuling; +Cc: linuxppc-dev, kvm-ppc, Paul Mackerras, kvm
In-Reply-To: <9524.1398834577@ale.ozlabs.ibm.com>
On 30.04.14 07:09, Michael Neuling wrote:
>> This patch series implements split core mode on POWER8. This enables up to 4
>> subcores per core which can each independently run guests (per guest SPRs like
>> SDR1, LPIDR etc are replicated per subcore). Lots more documentation on this
>> feature in the code and commit messages.
>>
>> Most of this code is in the powernv platform but there's a couple of KVM
>> specific patches too.
>>
>> Alex: If you're happy with the KVM patches, please ACK them and benh can hold
>> this series.
> Alex,
>
> Any chance we can get an ACK on these two KVM patches so benh can put
> this series in his next branch?
For patches 1/6 and 5/6:
Acked-by: Alexander Graf <agraf@suse.de>
However, please make sure to get Paul's ack as well.
Alex
^ permalink raw reply
* GNU binutils & PowerPC VLE
From: Martin Hinner @ 2014-04-30 9:59 UTC (permalink / raw)
To: linuxppc-dev
Hello,
I know this topic does not exactly fit this mailing list, but I
think it's better to ask here than on binutils.
I need to assemble and disassemble some PowerPC VLE (variable length
encoding) e200 code. Binutils as of 2.23.2 support VLE. But when I
try to use objdump -D with -m powerpc:vle or -M vle I get plain
32-bit powerpc ISA disassembly (instead of 16bit instructions). Tried
to change input file format, endianity, etc. What am I doing wrong?
Thank you,
Martin
^ permalink raw reply
* Re: [PATCH 00/13] Refactor pci_is_brdige() to simplify code
From: Bjorn Helgaas @ 2014-04-30 16:29 UTC (permalink / raw)
To: Yijing Wang
Cc: Tony Luck, linux-ia64@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, sparclinux, Thomas Gleixner,
linuxppc-dev, David S. Miller
In-Reply-To: <1398417515-8740-1-git-send-email-wangyijing@huawei.com>
On Fri, Apr 25, 2014 at 3:18 AM, Yijing Wang <wangyijing@huawei.com> wrote:
> This patchset rename the current pci_is_bridge() to pci_has_subordinate(),
> and introduce a new pci_is_bridge() which determine pci bridge by check
> dev->hdr_type. The new one is more accurate. PCIe Spec define the pci
> device is a bridge by the dev->hdr_type = 0x01 || 0x02.
This needs to be posted to the linux-pci list. The fact that it
wasn't means it's not in patchwork, so it's not on my to-do list.
Currently we have one interface: pci_is_bridge().
After your series, we would have two interfaces: pci_is_bridge() and
pci_has_subordinate(). Presumably, both are used, and you should
explain how you decided which to use at each place.
I assume the difference is that the old pci_is_bridge() is true for a
bridge that has a subordinate bus. The new pci_is_bridge() is true
for any bridge, even if there is no subordinate bus. When do we even
have a bridge with no subordinate bus? This is the sort of stuff you
need to explain so we know why we should apply these patches.
Bjorn
> Yijing Wang (13):
> PCI: rename pci_is_bridge() to pci_has_subordinate()
> PCI: Introduce new pci_is_bridge() helper function
> PCI: Use new pci_is_bridge() to simplify code
> x86/PCI: Use new pci_is_bridge() to simplify code
> IA64/PCI: Use new pci_is_bridge() to simplify code
> powerpc/PCI: Use new pci_is_bridge() to simplify code
> sparc/PCI: Use new pci_is_bridge() to simplify code
> PCI, rpaphp: Use new pci_is_bridge() to simplify code
> PCI, shpchp: Use new pci_is_bridge() to simplify code
> PCI, cpcihp: Use new pci_is_bridge() to simplify code
> PCI, acpiphp: Use new pci_is_bridge() to simplify code
> PCI, pcmcia: Use new pci_is_bridge() to simplify code
> PCI, pciehp: Use new pci_is_bridge() to simplify code
>
> arch/ia64/pci/fixup.c | 4 +---
> arch/powerpc/kernel/pci-hotplug.c | 3 +--
> arch/powerpc/kernel/pci_of_scan.c | 3 +--
> arch/sparc/kernel/pci.c | 3 +--
> arch/x86/pci/fixup.c | 4 +---
> drivers/pci/hotplug/acpiphp_glue.c | 3 +--
> drivers/pci/hotplug/cpci_hotplug_pci.c | 3 +--
> drivers/pci/hotplug/pciehp_pci.c | 3 +--
> drivers/pci/hotplug/rpadlpar_core.c | 3 +--
> drivers/pci/hotplug/shpchp_pci.c | 3 +--
> drivers/pci/pci-acpi.c | 8 +-------
> drivers/pci/pci-driver.c | 8 ++++----
> drivers/pci/pci.h | 2 +-
> drivers/pci/probe.c | 3 +--
> drivers/pci/setup-bus.c | 4 +---
> drivers/pcmcia/cardbus.c | 3 +--
> include/linux/pci.h | 6 ++++++
> 17 files changed, 25 insertions(+), 41 deletions(-)
>
>
^ permalink raw reply
* Re: [PATCH v2] powerpc: Add cpu family documentation
From: Tom Musta @ 2014-04-30 18:14 UTC (permalink / raw)
To: Michael Ellerman, Scott Wood; +Cc: linuxppc-dev, Stephen Rothwell
In-Reply-To: <1398840308.5722.5.camel@concordia>
On 4/30/2014 1:45 AM, Michael Ellerman wrote:
>> > Are 40x considered booke?
> You tell me.
>
The original 401, 403 and 405 cores predate the actual existence of what we now call Book E.
But they most certainly contained features that would eventually become Book E (different timers,
software managed TLB, etc.) For the sake of this diagram, I would say "yes".
^ permalink raw reply
* Re: [PATCH] powerpc 32: Provides VIRT_CPU_ACCOUNTING
From: Scott Wood @ 2014-04-30 18:14 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <1398833787.31586.8.camel@pasglop>
On Wed, 2014-04-30 at 14:56 +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2014-03-19 at 17:05 -0500, Scott Wood wrote:
> > On Wed, 2014-03-19 at 22:52 +0100, Christophe Leroy wrote:
> > > This patch provides VIRT_CPU_ACCOUTING to PPC32 architecture.
> > > Unlike PPC64, PPC32 doesn't provide the PACA register. Therefore the
> > > implementation is similar to the one done in the IA64 architecture.
> > > It is based on additional information added to the Task Info structure.
> >
> > PACA isn't a register -- just a convention for how Linux uses a GPR.
> > Maybe it's time to use it on PPC32 as well?
>
> PACA is actually a data structure and you really really don't want it
> on ppc32 :-) Having a register point to current works, having a register
> point to per-cpu data instead works too (ie, change what we do today),
> but don't introduce a PACA *please* :-)
What is special about 64-bit that warrants doing things differently from
32-bit?
What is the difference between PACA and "per-cpu data", other than the
obscure name?
-Scott
^ permalink raw reply
* Re: [PATCH v2] powerpc: Add cpu family documentation
From: Scott Wood @ 2014-04-30 18:26 UTC (permalink / raw)
To: Tom Musta; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <53613D7B.8090001@gmail.com>
On Wed, 2014-04-30 at 13:14 -0500, Tom Musta wrote:
> On 4/30/2014 1:45 AM, Michael Ellerman wrote:
> >> > Are 40x considered booke?
> > You tell me.
> >
>
> The original 401, 403 and 405 cores predate the actual existence of what we now call Book E.
> But they most certainly contained features that would eventually become Book E (different timers,
> software managed TLB, etc.) For the sake of this diagram, I would say "yes".
CONFIG_BOOKE doesn't get set on 40x builds...
-Scott
^ permalink raw reply
* Re: [PATCH v2] powerpc: Add cpu family documentation
From: Scott Wood @ 2014-04-30 18:29 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Stephen Rothwell
In-Reply-To: <1398840308.5722.5.camel@concordia>
On Wed, 2014-04-30 at 16:45 +1000, Michael Ellerman wrote:
> On Tue, 2014-02-04 at 16:43 -0600, Scott Wood wrote:
> > Missing e300 (603 derivative) and e600 (7448 derivative).
>
> Happy to add them, where do they hang off?
e300 hangs off 603 and e600 hangs off 7448. :-)
> > > +Motorola/Freescale 8xx
> > > +----------------------
> > > +
> > > + - Software loaded with hardware assist.
> > > + - All 32 bit
> > > +
> > > + +--------------+
> > > + | 8xx |
> > > + +--------------+
> > > + |
> > > + |
> > > + v
> > > + +--------------+
> > > + | 850 |
> > > + +--------------+
> >
> > Is the core of MPC850 different from other MPC8xx?
>
> Dunno, maybe someone who works at Freescale knows ;)
I think they're the same -- I was just wondering if you had some
difference in mind that led you to single it out.
-Scott
^ permalink raw reply
* Re: [PATCH v2] powerpc: Add cpu family documentation
From: Arnd Bergmann @ 2014-04-30 18:33 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Scott Wood, Stephen Rothwell, linuxppc-dev
In-Reply-To: <1398840308.5722.5.camel@concordia>
On Wednesday 30 April 2014 16:45:08 Michael Ellerman wrote:
> > > + v v
> > > + +--------------+ +-------+ +----------------+
> > > + | POWER4+ | ---------------> | 970 | | 7447 |
> > > + +--------------+ +-------+ +----------------+
> > > + | | |
> > > + | | |
> > > + v v v
> > > + +--------------+ +-------+ +-------+ +----------------+
> > > + | POWER5 | --> | Cell | | 970FX | | 7448 |
> > > + +--------------+ +-------+ +-------+ +----------------+
> > > + | |
> > > + | |
> > > + v v
> > > + +--------------+ +-------+
> > > + | POWER5+ | | 970MP |
> > > + +--------------+ +-------+
> > > + |
> > > + |
> > > + v
> > > + +--------------+
> > > + | POWER5++ |
> > > + +--------------+
> > > + |
> > > + |
> > > + v
> > > + +--------------+
> > > + | POWER6 |
> > > + +--------------+
> > > + |
> > > + |
> > > + v
I think Cell and POWER6 are somewhat misrepresented here. Cell (together with
Xenon, which is the same core) is basically an independent development unrelated
to POWER5. POWER6 shares a lot of concepts with Cell, and IIRC is much closer
related to Cell than to POWER5, though I don't remember which one was designed
first. Probably code went both ways, and POWER6 got some enhancements that didn't
make it into the Cell PPU. They both contain VMX (Altivec) and have an in-order
pipeline.
POWER6 is also closely related to z10, while POWER7 then includes aspects of
both POWER5 and POWER6 but no longer shares much with z196, which in turn is
derived from z10.
Arnd
^ permalink raw reply
* Re: [PATCH 1/1] powerpc: crtsaveres.o needed only when -Os flag is enabled
From: Ram Pai @ 2014-04-30 18:43 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Brian W Hart
In-Reply-To: <1398834894.31586.14.camel@pasglop>
On Wed, Apr 30, 2014 at 03:14:54PM +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2014-04-29 at 10:38 -0500, Brian W Hart wrote:
>
> > > CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
> > >
> > > +ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> > > KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
> > > +endif
> > > +
> > >
> > > # No AltiVec or VSX instructions when building kernel
> > > KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
> >
> > I didn't try building a kernel or in-tree modules, but I confirmed
> > that it allows building of out-of-tree modules when crtsavres.o is
> > not present (e.g. as for a distro install where the kernel headers
> > are provided by package, rather than being manually prepared from
> > the sources).
> >
> > Tested-by: Brian W Hart <hartb@linux.vnet.ibm.com>
>
> I still don't like it. What guarantee do we have that gcc will never
> call into this with other optimisation settings ? It might decide
> one day that calling out for saving a large pile of registers
> is still more efficient than unrolling the whole lot, including
> for speed.
This patch operates on the assumption that arch/powerpc/lib/crtsavres.o
is needed only if the code is compiled with -Os. Are you saying
this assumption is wrong?
>
> Besides that doesn't fix the root problem. We want to be able to
> build the kernel with CONFIG_CC_OPTIMIZE_FOR_SIZE and still have
> modules.
And this patch will not stop you from doing that. You can compile your
kernel with CONFIG_CC_OPTIMIZE_FOR_SIZE and modules will be built
because arch/powerpc/lib/crtsavres.o will be linked with the module.
Now, if the arch/powerpc/lib/crtsavres.o file does not exist, that
is a different problem and has to be fixed by the distros for
out-of-tree modules.
>
> So a better solution needs to be found. I don't know what that
> solution is (we might want to look at what other archs are doing
> maybe ?), could be to include crtsaveres.S in the build of every
> module (we really don't want to EXPORT_SYMBOL these guys), but
> that would mean having it installed somewhere with the kernel
> headers for out-of-tree modules...
Currently crtsaveres.o is expected to be in the build during
the linking stage of the module. You suggest instead have
crtsaveres.S and get it compiled and linked?
>
> If necessary, involve lkml, Rusty etc... but this patch is crap.
I dont see other archs having this problem. Possibly because there
linker have inbuilt capabilities to satisfy the missing symbols?
Alan Modra did mention that the ppc linker will soon have the
capability to handle -Os compiled code, without the help
of arch/powerpc/lib/crtsavres.o.
However this patch is not about having crtsavres.o or crtsaveres.S
Its about not needing crtsavres.o if the code is not compiled for
space optimization using -Os. If you say that the assumption
is wrong, than yes the code is crap :)
RP
^ permalink raw reply
* Re: [PATCH] powerpc: move epapr paravirt init of power_save to an initcall
From: Alexander Graf @ 2014-04-30 19:56 UTC (permalink / raw)
To: Stuart Yoder, benh, scottwood; +Cc: linuxppc-dev
In-Reply-To: <1398887641-20705-1-git-send-email-stuart.yoder@freescale.com>
On 30.04.14 21:54, Stuart Yoder wrote:
> From: Stuart Yoder <stuart.yoder@freescale.com>
>
> some restructuring of epapr paravirt init resulted in
> ppc_md.power_save being set, and then overwritten to
> NULL during machine_init. This patch splits the
> initialization of ppc_md.power_save out into a postcore
> init call.
>
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
> ---
> arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
> index 6300c13..c49b69c 100644
> --- a/arch/powerpc/kernel/epapr_paravirt.c
> +++ b/arch/powerpc/kernel/epapr_paravirt.c
> @@ -52,11 +52,6 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
> #endif
> }
>
> -#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> - if (of_get_flat_dt_prop(node, "has-idle", NULL))
> - ppc_md.power_save = epapr_ev_idle;
> -#endif
> -
> epapr_paravirt_enabled = true;
>
> return 1;
> @@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void)
> return 0;
> }
>
> +static int __init epapr_idle_init_dt_scan(unsigned long node,
> + const char *uname,
> + int depth, void *data)
> +{
> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> + if (of_get_flat_dt_prop(node, "has-idle", NULL))
> + ppc_md.power_save = epapr_ev_idle;
> +#endif
> + return 0;
> +}
> +
> +static int __init epapr_idle_init(void)
> +{
> + if (epapr_paravirt_enabled)
> + of_scan_flat_dt(epapr_idle_init_dt_scan, NULL);
Doesn't this scan all nodes? We only want to match on
/hypervisor/has-idle, no?
Alex
^ permalink raw reply
* RE: [PATCH] powerpc: move epapr paravirt init of power_save to an initcall
From: Stuart Yoder @ 2014-04-30 20:03 UTC (permalink / raw)
To: Alexander Graf, benh@kernel.crashing.org, Scott Wood
Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <5361556D.7080805@suse.de>
> -----Original Message-----
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Wednesday, April 30, 2014 2:56 PM
> To: Yoder Stuart-B08248; benh@kernel.crashing.org; Wood Scott-B07421
> Cc: linuxppc-dev@lists.ozlabs.org
> Subject: Re: [PATCH] powerpc: move epapr paravirt init of power_save to
> an initcall
>=20
>=20
> On 30.04.14 21:54, Stuart Yoder wrote:
> > From: Stuart Yoder <stuart.yoder@freescale.com>
> >
> > some restructuring of epapr paravirt init resulted in
> > ppc_md.power_save being set, and then overwritten to
> > NULL during machine_init. This patch splits the
> > initialization of ppc_md.power_save out into a postcore
> > init call.
> >
> > Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
> > ---
> > arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
> > 1 file changed, 20 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/epapr_paravirt.c
> b/arch/powerpc/kernel/epapr_paravirt.c
> > index 6300c13..c49b69c 100644
> > --- a/arch/powerpc/kernel/epapr_paravirt.c
> > +++ b/arch/powerpc/kernel/epapr_paravirt.c
> > @@ -52,11 +52,6 @@ static int __init early_init_dt_scan_epapr(unsigned
> long node,
> > #endif
> > }
> >
> > -#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> > - if (of_get_flat_dt_prop(node, "has-idle", NULL))
> > - ppc_md.power_save =3D epapr_ev_idle;
> > -#endif
> > -
> > epapr_paravirt_enabled =3D true;
> >
> > return 1;
> > @@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void)
> > return 0;
> > }
> >
> > +static int __init epapr_idle_init_dt_scan(unsigned long node,
> > + const char *uname,
> > + int depth, void *data)
> > +{
> > +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> > + if (of_get_flat_dt_prop(node, "has-idle", NULL))
> > + ppc_md.power_save =3D epapr_ev_idle;
> > +#endif
> > + return 0;
> > +}
> > +
> > +static int __init epapr_idle_init(void)
> > +{
> > + if (epapr_paravirt_enabled)
> > + of_scan_flat_dt(epapr_idle_init_dt_scan, NULL);
>=20
> Doesn't this scan all nodes? We only want to match on
> /hypervisor/has-idle, no?
I cut/pasted from the approach the existing code in that file
took, but yes you're right we just need the one property.
Let me respin that to look at the hypervisor node only.
Stuart
^ permalink raw reply
* Re: [PATCH] powerpc: move epapr paravirt init of power_save to an initcall
From: Alexander Graf @ 2014-04-30 20:06 UTC (permalink / raw)
To: Stuart Yoder, benh@kernel.crashing.org, Scott Wood
Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <33939d8249c34c8fb694da3e94196211@DM2PR03MB352.namprd03.prod.outlook.com>
On 30.04.14 22:03, Stuart Yoder wrote:
>
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, April 30, 2014 2:56 PM
>> To: Yoder Stuart-B08248; benh@kernel.crashing.org; Wood Scott-B07421
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Subject: Re: [PATCH] powerpc: move epapr paravirt init of power_save to
>> an initcall
>>
>>
>> On 30.04.14 21:54, Stuart Yoder wrote:
>>> From: Stuart Yoder <stuart.yoder@freescale.com>
>>>
>>> some restructuring of epapr paravirt init resulted in
>>> ppc_md.power_save being set, and then overwritten to
>>> NULL during machine_init. This patch splits the
>>> initialization of ppc_md.power_save out into a postcore
>>> init call.
>>>
>>> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
>>> ---
>>> arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
>>> 1 file changed, 20 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kernel/epapr_paravirt.c
>> b/arch/powerpc/kernel/epapr_paravirt.c
>>> index 6300c13..c49b69c 100644
>>> --- a/arch/powerpc/kernel/epapr_paravirt.c
>>> +++ b/arch/powerpc/kernel/epapr_paravirt.c
>>> @@ -52,11 +52,6 @@ static int __init early_init_dt_scan_epapr(unsigned
>> long node,
>>> #endif
>>> }
>>>
>>> -#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
>>> - if (of_get_flat_dt_prop(node, "has-idle", NULL))
>>> - ppc_md.power_save = epapr_ev_idle;
>>> -#endif
>>> -
>>> epapr_paravirt_enabled = true;
>>>
>>> return 1;
>>> @@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void)
>>> return 0;
>>> }
>>>
>>> +static int __init epapr_idle_init_dt_scan(unsigned long node,
>>> + const char *uname,
>>> + int depth, void *data)
>>> +{
>>> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
>>> + if (of_get_flat_dt_prop(node, "has-idle", NULL))
>>> + ppc_md.power_save = epapr_ev_idle;
>>> +#endif
>>> + return 0;
>>> +}
>>> +
>>> +static int __init epapr_idle_init(void)
>>> +{
>>> + if (epapr_paravirt_enabled)
>>> + of_scan_flat_dt(epapr_idle_init_dt_scan, NULL);
>> Doesn't this scan all nodes? We only want to match on
>> /hypervisor/has-idle, no?
> I cut/pasted from the approach the existing code in that file
> took, but yes you're right we just need the one property.
> Let me respin that to look at the hypervisor node only.
The other function aborts early if it doesn't find a
"hcall-instructions" property. I'm still surprised we don't limit the
scope to /hypervisor at all though. Is this on purpose maybe?
Alex
^ permalink raw reply
* Re: [PATCH] powerpc: move epapr paravirt init of power_save to an initcall
From: Alexander Graf @ 2014-04-30 20:09 UTC (permalink / raw)
To: Stuart Yoder, benh@kernel.crashing.org, Scott Wood
Cc: Laurentiu.Tudor, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <33939d8249c34c8fb694da3e94196211@DM2PR03MB352.namprd03.prod.outlook.com>
On 30.04.14 22:03, Stuart Yoder wrote:
>
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, April 30, 2014 2:56 PM
>> To: Yoder Stuart-B08248; benh@kernel.crashing.org; Wood Scott-B07421
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Subject: Re: [PATCH] powerpc: move epapr paravirt init of power_save to
>> an initcall
>>
>>
>> On 30.04.14 21:54, Stuart Yoder wrote:
>>> From: Stuart Yoder <stuart.yoder@freescale.com>
>>>
>>> some restructuring of epapr paravirt init resulted in
>>> ppc_md.power_save being set, and then overwritten to
>>> NULL during machine_init. This patch splits the
>>> initialization of ppc_md.power_save out into a postcore
>>> init call.
>>>
>>> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
>>> ---
>>> arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
>>> 1 file changed, 20 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kernel/epapr_paravirt.c
>> b/arch/powerpc/kernel/epapr_paravirt.c
>>> index 6300c13..c49b69c 100644
>>> --- a/arch/powerpc/kernel/epapr_paravirt.c
>>> +++ b/arch/powerpc/kernel/epapr_paravirt.c
>>> @@ -52,11 +52,6 @@ static int __init early_init_dt_scan_epapr(unsigned
>> long node,
>>> #endif
>>> }
>>>
>>> -#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
>>> - if (of_get_flat_dt_prop(node, "has-idle", NULL))
>>> - ppc_md.power_save = epapr_ev_idle;
>>> -#endif
>>> -
>>> epapr_paravirt_enabled = true;
>>>
>>> return 1;
>>> @@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void)
>>> return 0;
>>> }
>>>
>>> +static int __init epapr_idle_init_dt_scan(unsigned long node,
>>> + const char *uname,
>>> + int depth, void *data)
>>> +{
>>> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
>>> + if (of_get_flat_dt_prop(node, "has-idle", NULL))
>>> + ppc_md.power_save = epapr_ev_idle;
>>> +#endif
>>> + return 0;
>>> +}
>>> +
>>> +static int __init epapr_idle_init(void)
>>> +{
>>> + if (epapr_paravirt_enabled)
>>> + of_scan_flat_dt(epapr_idle_init_dt_scan, NULL);
>> Doesn't this scan all nodes? We only want to match on
>> /hypervisor/has-idle, no?
> I cut/pasted from the approach the existing code in that file
> took, but yes you're right we just need the one property.
> Let me respin that to look at the hypervisor node only.
Yeah, the same commit that introduced the breakage on has-idle also
removed the explicit check for /hypervisor.
Laurentiu, was this change on purpose?
commit 4e21b94c9c644c43223878f4c848e852743e789c
Author: Laurentiu TUDOR <Laurentiu.Tudor@freescale.com>
Date: Wed Jul 3 17:13:15 2013 +0300
powerpc/85xx: Move ePAPR paravirt initialization earlier
At console init, when the kernel tries to flush the log buffer
the ePAPR byte-channel based console write fails silently,
losing the buffered messages.
This happens because The ePAPR para-virtualization init isn't
done early enough so that the hcall instruction to be set,
causing the byte-channel write hcall to be a nop.
To fix, change the ePAPR para-virt init to use early device
tree functions and move it in early init.
Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
[...]
diff --git a/arch/powerpc/kernel/epapr_paravirt.c
b/arch/powerpc/kernel/epapr_paravirt.c
index d44a571..6300c13 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -30,22 +30,20 @@ extern u32 epapr_ev_idle_start[];
bool epapr_paravirt_enabled;
-static int __init epapr_paravirt_init(void)
+static int __init early_init_dt_scan_epapr(unsigned long node,
+ const char *uname,
+ int depth, void *data)
{
- struct device_node *hyper_node;
const u32 *insts;
- int len, i;
+ unsigned long len;
+ int i;
- hyper_node = of_find_node_by_path("/hypervisor");
- if (!hyper_node)
- return -ENODEV;
-
- insts = of_get_property(hyper_node, "hcall-instructions", &len);
+ insts = of_get_flat_dt_prop(node, "hcall-instructions", &len);
if (!insts)
- return -ENODEV;
+ return 0;
if (len % 4 || len > (4 * 4))
- return -ENODEV;
+ return -1;
[...]
Alex
^ permalink raw reply related
* [PATCH] powerpc: move epapr paravirt init of power_save to an initcall
From: Stuart Yoder @ 2014-04-30 19:54 UTC (permalink / raw)
To: benh, scottwood; +Cc: linuxppc-dev, agraf, Stuart Yoder
From: Stuart Yoder <stuart.yoder@freescale.com>
some restructuring of epapr paravirt init resulted in
ppc_md.power_save being set, and then overwritten to
NULL during machine_init. This patch splits the
initialization of ppc_md.power_save out into a postcore
init call.
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
index 6300c13..c49b69c 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -52,11 +52,6 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
#endif
}
-#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
- if (of_get_flat_dt_prop(node, "has-idle", NULL))
- ppc_md.power_save = epapr_ev_idle;
-#endif
-
epapr_paravirt_enabled = true;
return 1;
@@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void)
return 0;
}
+static int __init epapr_idle_init_dt_scan(unsigned long node,
+ const char *uname,
+ int depth, void *data)
+{
+#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
+ if (of_get_flat_dt_prop(node, "has-idle", NULL))
+ ppc_md.power_save = epapr_ev_idle;
+#endif
+ return 0;
+}
+
+static int __init epapr_idle_init(void)
+{
+ if (epapr_paravirt_enabled)
+ of_scan_flat_dt(epapr_idle_init_dt_scan, NULL);
+
+ return 0;
+}
+
+postcore_initcall(epapr_idle_init);
--
1.7.9.7
^ permalink raw reply related
* [PATCH][v2] powerpc: move epapr paravirt init of power_save to an initcall
From: Stuart Yoder @ 2014-04-30 20:20 UTC (permalink / raw)
To: benh, scottwood; +Cc: linuxppc-dev, agraf, Stuart Yoder
From: Stuart Yoder <stuart.yoder@freescale.com>
some restructuring of epapr paravirt init resulted in
ppc_md.power_save being set, and then overwritten to
NULL during machine_init. This patch splits the
initialization of ppc_md.power_save out into a postcore
init call.
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
-v2: don't iterate over the entire DT, just look at
the hypervisor node
arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
index 7898be9..a01df5e 100644
--- a/arch/powerpc/kernel/epapr_paravirt.c
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -53,11 +53,6 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
#endif
}
-#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
- if (of_get_flat_dt_prop(node, "has-idle", NULL))
- ppc_md.power_save = epapr_ev_idle;
-#endif
-
epapr_paravirt_enabled = true;
return 1;
@@ -70,3 +65,23 @@ int __init epapr_paravirt_early_init(void)
return 0;
}
+static int __init epapr_idle_init(void)
+{
+ struct device_node *node;
+
+ if (!epapr_paravirt_enabled)
+ return 0;
+
+ node = of_find_node_by_path("/hypervisor");
+ if (!node)
+ return -ENODEV;
+
+#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
+ if (of_get_property(node, "has-idle", NULL))
+ ppc_md.power_save = epapr_ev_idle;
+#endif
+
+ return 0;
+}
+
+postcore_initcall(epapr_idle_init);
--
1.7.9.7
^ permalink raw reply related
* Re: [PATCH][v2] powerpc: move epapr paravirt init of power_save to an initcall
From: Alexander Graf @ 2014-04-30 20:25 UTC (permalink / raw)
To: Stuart Yoder, benh, scottwood; +Cc: linuxppc-dev
In-Reply-To: <1398889209-10350-1-git-send-email-stuart.yoder@freescale.com>
On 30.04.14 22:20, Stuart Yoder wrote:
> From: Stuart Yoder <stuart.yoder@freescale.com>
>
> some restructuring of epapr paravirt init resulted in
> ppc_md.power_save being set, and then overwritten to
> NULL during machine_init. This patch splits the
> initialization of ppc_md.power_save out into a postcore
> init call.
>
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Looks pretty good to me and IMHO should get a CC on stable when it gets
into the tree. One minor nit below.
We still need to clarify whether the omitted check on
early_init_dt_scan_epapr() is on purpose and if not reintroduce it, but
that's a separate issue.
> ---
>
> -v2: don't iterate over the entire DT, just look at
> the hypervisor node
>
> arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
> index 7898be9..a01df5e 100644
> --- a/arch/powerpc/kernel/epapr_paravirt.c
> +++ b/arch/powerpc/kernel/epapr_paravirt.c
> @@ -53,11 +53,6 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
> #endif
> }
>
> -#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
> - if (of_get_flat_dt_prop(node, "has-idle", NULL))
> - ppc_md.power_save = epapr_ev_idle;
> -#endif
> -
> epapr_paravirt_enabled = true;
>
> return 1;
> @@ -70,3 +65,23 @@ int __init epapr_paravirt_early_init(void)
> return 0;
> }
>
v
> +static int __init epapr_idle_init(void)
> +{
> + struct device_node *node;
> +
> + if (!epapr_paravirt_enabled)
> + return 0;
> +
> + node = of_find_node_by_path("/hypervisor");
> + if (!node)
> + return -ENODEV;
> +
> +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
Please move the #if scope from v to ^. That way we don't waste space /
time / anything on systems that don't bother with the idle hcall.
> + if (of_get_property(node, "has-idle", NULL))
> + ppc_md.power_save = epapr_ev_idle;
> +#endif
> +
> + return 0;
> +}
> +
> +postcore_initcall(epapr_idle_init);
^
Alex
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox