LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: RFC: book3e: DCR MMIO for IBM Blue Gene/Q
From: Benjamin Herrenschmidt @ 2012-11-06 11:48 UTC (permalink / raw)
  To: Jimi Xenidis; +Cc: linuxppc-dev
In-Reply-To: <749146C7-B9A8-4001-9580-3B87A041A580@pobox.com>

On Mon, 2012-11-05 at 09:25 -0600, Jimi Xenidis wrote:
> So Axon, being 64-bit, would break with the changes proposed, since it
> is 64-bit bit and assumes 32bit accessors.
> I'll simply add 64bit accessors for now.

Well, either that, or you add a "64-bit" property to the DCR controller
node. IE. you keep the API "unsigned long" but whether it uses 32 or
64-bit accessors depends on that property.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH] powermac/cpufreq_32: set non-infinite transition time for 7447A driver
From: Michel Dänzer @ 2012-11-06 12:28 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linuxppc-dev
In-Reply-To: <m24nld1vx9.fsf@igel.home>

On Mon, 2012-10-29 at 10:15 +0100, Andreas Schwab wrote:=20
> The transition time for the 7447A is around 8ms which makes it possible
> to use the ondemand governor.  This has been tested on the iBook G4
> (PowerBook6,7).
>=20
> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

Tested-by: Michel D=E4nzer <michel@daenzer.net>


--=20
Earthling Michel D=E4nzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer

^ permalink raw reply

* Re: powerpc: Don't silently handle machine checks from userspace
From: Scott Wood @ 2012-11-06 16:34 UTC (permalink / raw)
  To: Micha Nelissen
  Cc: Martijn de Gouw, linuxppc-dev@lists.ozlabs.org, Anton Blanchard
In-Reply-To: <39F93B8F6D09AC4DA45E2F19603FA69C324EEDCD@exc02.bk.prodrive.nl>

On 11/06/2012 03:21:37 AM, Micha Nelissen wrote:
> From: Scott Wood [mailto:scottwood@freescale.com]
> > > Therefore I request to put this check back, and even to put the
> > > removed code at the top of the machine check handler because =20
> there is
> > > no point in trying to recover from a user space bus error anyway.
> >
> > Why is there no point trying to recover?  For example, see =20
> MCSR_ICPERR
> > and MCSR_DCPERR_MC in machine_check_e500mc.  The machine check is =20
> just
> > letting us know that there was an error and the read-only cache got
> > dumped (i.e. it was a correctable error).
>=20
> Oh I overlooked those cases; those correctable errors shouldn't be =20
> bus errors for the user space process?
>=20
> Hmm I guess there is no simple solution then, since the "recover" =20
> function also prints the kernel messages about the machine check =20
> being in kernel mode without having checked whether it really was in =20
> kernel mode. In the past the user mode check was in between.

It shouldn't be that difficult to make it say "in user mode" or "in =20
kernel mode" depending on which it was... or just remove that phrase =20
altogether and let the following output indicate whether it was in =20
kernel mode.

-Scott=

^ permalink raw reply

* RE: powerpc: Don't silently handle machine checks from userspace
From: Micha Nelissen @ 2012-11-06 16:43 UTC (permalink / raw)
  To: 'Scott Wood'
  Cc: Martijn de Gouw, linuxppc-dev@lists.ozlabs.org, Anton Blanchard
In-Reply-To: <1352219655.21833.0@snotra>

From: Scott Wood [mailto:scottwood@freescale.com]
>> Hmm I guess there is no simple solution then, since the "recover"
>> function also prints the kernel messages about the machine check
>> being in kernel mode without having checked whether it really was in
>> kernel mode. In the past the user mode check was in between.
>=20
> It shouldn't be that difficult to make it say "in user mode" or "in
> kernel mode" depending on which it was... or just remove that phrase
> altogether and let the following output indicate whether it was in
> kernel mode.

Well printing the correct message is only part of it: do "we" want to pass =
guarded load errors (RapidIO bus errors) to user space or not? And if we pa=
ss them, should we print a kernel message at all?

Micha

^ permalink raw reply

* Re: powerpc: Don't silently handle machine checks from userspace
From: Scott Wood @ 2012-11-06 20:13 UTC (permalink / raw)
  To: Micha Nelissen
  Cc: Martijn de Gouw, linuxppc-dev@lists.ozlabs.org, Anton Blanchard
In-Reply-To: <39F93B8F6D09AC4DA45E2F19603FA69C324F2605@exc02.bk.prodrive.nl>

On 11/06/2012 10:43:19 AM, Micha Nelissen wrote:
> From: Scott Wood [mailto:scottwood@freescale.com]
> >> Hmm I guess there is no simple solution then, since the "recover"
> >> function also prints the kernel messages about the machine check
> >> being in kernel mode without having checked whether it really was =20
> in
> >> kernel mode. In the past the user mode check was in between.
> >
> > It shouldn't be that difficult to make it say "in user mode" or "in
> > kernel mode" depending on which it was... or just remove that phrase
> > altogether and let the following output indicate whether it was in
> > kernel mode.
>=20
> Well printing the correct message is only part of it: do "we" want to =20
> pass guarded load errors (RapidIO bus errors) to user space or not?

Yes.

> And if we pass them, should we print a kernel message at all?

Yes (but maybe ratelimited).

-Scott=

^ permalink raw reply

* Re: [PATCH] Enable hardware breakpoint upon re-registering
From: Michael Neuling @ 2012-11-06 20:53 UTC (permalink / raw)
  To: Aravinda Prasad; +Cc: linuxppc-dev, linux-kernel, fweisbec
In-Reply-To: <20121105081527.29141.11384.stgit@aravinda>

Aravinda Prasad <aravinda@linux.vnet.ibm.com> wrote:

> On powerpc, ptrace will disable hardware breakpoint request once the
> breakpoint is hit. It is the responsibility of the caller to set it
> again. However, when the caller sets the hardware breakpoint again
> using ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, addr), the hardware
> breakpoint is not enabled.
> 
> While gdb's approach is to unregister and re-register the hardware
> breakpoint every time the breakpoint is hit - which is working fine,
> this could affect other programs trying to re-register hardware
> breakpoint without unregistering.
> 
> This patch enables hardware breakpoint if the caller is re-registering.
> 
> Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>

Passes my tests here and I don't think it'll break existing gdb.  So FWIW

Acked-by: Michael Neuling <mikey@neuling.org>

Thanks!

> ---
>  arch/powerpc/kernel/ptrace.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
> index 79d8e56..09371d0 100644
> --- a/arch/powerpc/kernel/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace.c
> @@ -952,6 +952,10 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
>  		arch_bp_generic_fields(data &
>  					(DABR_DATA_WRITE | DABR_DATA_READ),
>  							&attr.bp_type);
> +
> +		/* Enable breakpoint */
> +		attr.disabled = false;
> +
>  		ret =  modify_user_hw_breakpoint(bp, &attr);
>  		if (ret) {
>  			ptrace_put_breakpoints(task);
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 

^ permalink raw reply

* 3.7-rc4: BUG: MAX_STACK_TRACE_ENTRIES too low!
From: Christian Kujau @ 2012-11-06 23:51 UTC (permalink / raw)
  To: LKML; +Cc: linuxppc-dev

Hi,

after upgrading from 3.6.0-08492-gd43 to 3.7.0-rc4 and running it for a 
day or so, this happened:

[27148.965634] BUG: MAX_STACK_TRACE_ENTRIES too low!
[27148.967356] turning off the locking correctness validator.
[27148.968967] Call Trace:
[27148.970577] [ec633d00] [c0009064] show_stack+0x70/0x1bc (unreliable)
[27148.972229] [ec633d40] [c0077460] save_trace+0xfc/0x114
[27148.973855] [ec633d50] [c0078578] mark_lock+0x1b4/0x678
[27148.975472] [ec633d80] [c007ad70] __lock_acquire+0x4b8/0x19b8
[27148.977098] [ec633e20] [c007c2c0] lock_acquire+0x50/0x70
[27148.978717] [ec633e40] [c004ee88] process_one_work+0x1c4/0x49c
[27148.980302] [ec633e80] [c004f644] worker_thread+0x14c/0x400
[27148.981866] [ec633eb0] [c0057634] kthread+0xbc/0xc0
[27148.983385] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64

The last message is repeated several times, see below. The machine 
(PowerPC G4) is still up & running and no ill behaviour can be seen for
now. I still wonder if this would be a sign for trouble...

Christian.

[27148.984860] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.986259] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.987583] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.988854] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.990086] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.991305] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.992495] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.993668] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.994809] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.995947] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.997070] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.998182] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27148.999282] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.000365] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.001436] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.002450] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.003417] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.004378] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.005324] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.006260] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.007181] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.008087] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.008972] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.009833] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.010656] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.011443] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.012203] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.012935] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.013642] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.014314] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.014951] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.015568] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.016168] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.016744] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.017293] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.017814] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.018313] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.018796] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.019257] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.019701] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.020120] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.020519] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.020900] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.021283] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.021880] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.022275] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.022659] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.023043] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.023427] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.023810] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.024191] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.024573] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.024955] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.025339] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.025723] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64
[27149.026106] [ec633f40] [c0011ad4] ret_from_kernel_thread+0x5c/0x64

$ zgrep DEBUG /proc/config.gz | grep =y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_SLUB_DEBUG=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_SHIRQ=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_DEBUGGER=y

-- 
BOFH excuse #248:

Too much radiation coming from the soil.

^ permalink raw reply

* [PATCH 1/2] powerpc/pseries: Allow firmware features to match partial strings
From: Michael Neuling @ 2012-11-07  0:49 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux PPC dev, Michael Neuling

This allows firmware_features_table names to add a '*' at the end so that only
partial strings are matched.

When a '*' is added, only upto the '*' is matched when setting firmware feature
bits.

This is useful for the matching best energy feature.

Signed-off-by: Michael Neuling <mikey@neuling.org>
cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
cc: Linux PPC dev <linuxppc-dev@ozlabs.org>
---
 arch/powerpc/platforms/pseries/firmware.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index 0b0eff0..448c053 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -33,6 +33,11 @@ typedef struct {
     char * name;
 } firmware_feature_t;
 
+/*
+ * The names in this table match names in rtas/ibm,hypertas-functions.  If the
+ * entry ends in a '*', only upto the '*' is matched.  Otherwise the entire
+ * string must match.
+ */
 static __initdata firmware_feature_t
 firmware_features_table[FIRMWARE_MAX_FEATURES] = {
 	{FW_FEATURE_PFT,		"hcall-pft"},
@@ -71,9 +76,20 @@ void __init fw_feature_init(const char *hypertas, unsigned long len)
 
 	for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
 		for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
+			const char *name = firmware_features_table[i].name;
+			size_t size;
 			/* check value against table of strings */
-			if (!firmware_features_table[i].name ||
-			    strcmp(firmware_features_table[i].name, s))
+			if (!name)
+				continue;
+			/*
+			 * If there is a '*' at the end of name, only check
+			 * upto there
+			 */
+			size = strlen(name);
+			if (size && name[size - 1] == '*') {
+				if (strncmp(name, s, size - 1))
+					continue;
+			} else if (strcmp(name, s))
 				continue;
 
 			/* we have a match */
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 2/2] powerpc/pseries: Cleanup best_energy_hcall detection
From: Michael Neuling @ 2012-11-07  0:49 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux PPC dev, Michael Neuling
In-Reply-To: <1352249356-29671-1-git-send-email-mikey@neuling.org>

Currently we search for the best_energy hcall using a custom function.  Move
this to using the firmware_feature_table.

Signed-off-by: Michael Neuling <mikey@neuling.org>
cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
cc: Linux PPC dev <linuxppc-dev@ozlabs.org>
---
 arch/powerpc/include/asm/firmware.h             |    4 ++-
 arch/powerpc/platforms/pseries/firmware.c       |    1 +
 arch/powerpc/platforms/pseries/pseries_energy.c |   37 ++---------------------
 3 files changed, 6 insertions(+), 36 deletions(-)

diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h
index ad0b751..ecec46a 100644
--- a/arch/powerpc/include/asm/firmware.h
+++ b/arch/powerpc/include/asm/firmware.h
@@ -49,6 +49,7 @@
 #define FW_FEATURE_XCMO		ASM_CONST(0x0000000008000000)
 #define FW_FEATURE_OPAL		ASM_CONST(0x0000000010000000)
 #define FW_FEATURE_OPALv2	ASM_CONST(0x0000000020000000)
+#define FW_FEATURE_BEST_ENERGY	ASM_CONST(0x0000000040000000)
 
 #ifndef __ASSEMBLY__
 
@@ -62,7 +63,8 @@ enum {
 		FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
 		FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR |
 		FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
-		FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO,
+		FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO | 
+	        FW_FEATURE_BEST_ENERGY,
 	FW_FEATURE_PSERIES_ALWAYS = 0,
 	FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2,
 	FW_FEATURE_POWERNV_ALWAYS = 0,
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index 448c053..5bc10cb 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -61,6 +61,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
 	{FW_FEATURE_MULTITCE,		"hcall-multi-tce"},
 	{FW_FEATURE_SPLPAR,		"hcall-splpar"},
 	{FW_FEATURE_VPHN,		"hcall-vphn"},
+	{FW_FEATURE_BEST_ENERGY,	"hcall-best-energy-1*"},
 };
 
 /* Build up the firmware features bitmask using the contents of
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
index af281dc..a91e6da 100644
--- a/arch/powerpc/platforms/pseries/pseries_energy.c
+++ b/arch/powerpc/platforms/pseries/pseries_energy.c
@@ -21,6 +21,7 @@
 #include <asm/cputhreads.h>
 #include <asm/page.h>
 #include <asm/hvcall.h>
+#include <asm/firmware.h>
 
 
 #define MODULE_VERS "1.0"
@@ -32,40 +33,6 @@ static int sysfs_entries;
 
 /* Helper routines */
 
-/*
- * Routine to detect firmware support for hcall
- * return 1 if H_BEST_ENERGY is supported
- * else return 0
- */
-
-static int check_for_h_best_energy(void)
-{
-	struct device_node *rtas = NULL;
-	const char *hypertas, *s;
-	int length;
-	int rc = 0;
-
-	rtas = of_find_node_by_path("/rtas");
-	if (!rtas)
-		return 0;
-
-	hypertas = of_get_property(rtas, "ibm,hypertas-functions", &length);
-	if (!hypertas) {
-		of_node_put(rtas);
-		return 0;
-	}
-
-	/* hypertas will have list of strings with hcall names */
-	for (s = hypertas; s < hypertas + length; s += strlen(s) + 1) {
-		if (!strncmp("hcall-best-energy-1", s, 19)) {
-			rc = 1; /* Found the string */
-			break;
-		}
-	}
-	of_node_put(rtas);
-	return rc;
-}
-
 /* Helper Routines to convert between drc_index to cpu numbers */
 
 static u32 cpu_to_drc_index(int cpu)
@@ -262,7 +229,7 @@ static int __init pseries_energy_init(void)
 	int cpu, err;
 	struct device *cpu_dev;
 
-	if (!check_for_h_best_energy()) {
+	if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY)) {
 		printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
 		return 0;
 	}
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 1/2] powerpc/pseries: Allow firmware features to match partial strings
From: Stephen Rothwell @ 2012-11-07  5:30 UTC (permalink / raw)
  To: Michael Neuling; +Cc: Linux PPC dev
In-Reply-To: <1352249356-29671-1-git-send-email-mikey@neuling.org>

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

Hi Mikey,

On Wed,  7 Nov 2012 11:49:15 +1100 Michael Neuling <mikey@neuling.org> wrote:
>
> This allows firmware_features_table names to add a '*' at the end so that only
> partial strings are matched.
> 
> When a '*' is added, only upto the '*' is matched when setting firmware feature
> bits.
> 
> This is useful for the matching best energy feature.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
> cc: Linux PPC dev <linuxppc-dev@ozlabs.org>

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH] Update start_pfn in zone and pg_data when spanned_pages == 0.
From: Tang Chen @ 2012-11-07  7:40 UTC (permalink / raw)
  To: wency
  Cc: linux-s390, linux-ia64, len.brown, linux-acpi, linux-sh, x86,
	linux-kernel, cmetcalf, linux-mm, isimatu.yasuaki, paulus,
	minchan.kim, kosaki.motohiro, rientjes, sparclinux, cl,
	linuxppc-dev, akpm, liuj97
In-Reply-To: <1350988250-31294-11-git-send-email-wency@cn.fujitsu.com>

On 10/23/2012 06:30 PM, wency@cn.fujitsu.com wrote:
> From: Yasuaki Ishimatsu<isimatu.yasuaki@jp.fujitsu.com>
......
> +	/* The zone has no valid section */
> +	zone->zone_start_pfn = 0;
> +	zone->spanned_pages = 0;
> +	zone_span_writeunlock(zone);
> +}
> +
> +static void shrink_pgdat_span(struct pglist_data *pgdat,
> +			      unsigned long start_pfn, unsigned long end_pfn)
> +{
......
> +	/* The pgdat has no valid section */
> +	pgdat->node_start_pfn = 0;
> +	pgdat->node_spanned_pages = 0;
> +}

Hi,

If we hot-remove memory only and leave the cpus alive, the corresponding
node will not be removed. But the node_start_pfn and node_spanned_pages
in pg_data will be reset to 0. In this case, when we hot-add the memory
back next time, the node_start_pfn will always be 0 because no pfn is less
than 0. After that, if we hot-remove the memory again, it will cause kernel
panic in function find_biggest_section_pfn() when it tries to scan all 
the pfns.

The zone will also have the same problem.

This patch sets start_pfn to the start_pfn of the section being added when
spanned_pages of the zone or pg_data is 0.

---How to reproduce---

1. hot-add a container with some memory and cpus;
2. hot-remove the container's memory, and leave cpus there;
3. hot-add these memory again;
4. hot-remove them again;

then, the kernel will panic.

---Call trace---

[10530.646285] BUG: unable to handle kernel paging request at 
00000fff82a8cc38
[10530.729670] IP: [<ffffffff811c0d55>] find_biggest_section_pfn+0xe5/0x180
......
[10533.064975] Call Trace:
[10533.094162]  [<ffffffff811c0fcf>] ? __remove_zone+0x2f/0x1b0
[10533.161757]  [<ffffffff811c1124>] __remove_zone+0x184/0x1b0
[10533.228318]  [<ffffffff811c11dc>] __remove_section+0x8c/0xb0
[10533.295916]  [<ffffffff811c12e7>] __remove_pages+0xe7/0x120
[10533.362476]  [<ffffffff81654f7c>] arch_remove_memory+0x2c/0x80
[10533.432151]  [<ffffffff81655bb6>] remove_memory+0x56/0x90
[10533.496633]  [<ffffffff813da0c8>] 
acpi_memory_device_remove_memory+0x48/0x73
[10533.580846]  [<ffffffff813da55a>] acpi_memory_device_notify+0x153/0x274
[10533.659865]  [<ffffffff813a63cf>] ? acpi_bus_get_device+0x2f/0x77
[10533.732653]  [<ffffffff813a6589>] ? acpi_bus_notify+0xb5/0xec
[10533.801291]  [<ffffffff813b6786>] acpi_ev_notify_dispatch+0x41/0x5f
[10533.876156]  [<ffffffff813a3867>] acpi_os_execute_deferred+0x27/0x34
[10533.952062]  [<ffffffff81090589>] process_one_work+0x219/0x680
[10534.021736]  [<ffffffff81090528>] ? process_one_work+0x1b8/0x680
[10534.093488]  [<ffffffff813a3840>] ? 
acpi_os_wait_events_complete+0x23/0x23
[10534.175622]  [<ffffffff810923be>] worker_thread+0x12e/0x320
[10534.242181]  [<ffffffff81092290>] ? manage_workers+0x110/0x110
[10534.311855]  [<ffffffff81098396>] kthread+0xc6/0xd0
[10534.370111]  [<ffffffff8167c7c4>] kernel_thread_helper+0x4/0x10
[10534.440824]  [<ffffffff81672230>] ? retint_restore_args+0x13/0x13
[10534.513612]  [<ffffffff810982d0>] ? __init_kthread_worker+0x70/0x70
[10534.588480]  [<ffffffff8167c7c0>] ? gs_change+0x13/0x13
......
[10535.045543] ---[ end trace 96d845dbf33fee11 ]---


Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
---
  mm/memory_hotplug.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 56b758a..4aa313c 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -212,7 +212,7 @@ static void grow_zone_span(struct zone *zone, 
unsigned long start_pfn,
         zone_span_writelock(zone);

         old_zone_end_pfn = zone->zone_start_pfn + zone->spanned_pages;
-       if (start_pfn < zone->zone_start_pfn)
+       if (!zone->spanned_pages || start_pfn < zone->zone_start_pfn)
                 zone->zone_start_pfn = start_pfn;

         zone->spanned_pages = max(old_zone_end_pfn, end_pfn) -
@@ -227,7 +227,7 @@ static void grow_pgdat_span(struct pglist_data 
*pgdat, unsigned long start_pfn,
         unsigned long old_pgdat_end_pfn =
                 pgdat->node_start_pfn + pgdat->node_spanned_pages;

-       if (start_pfn < pgdat->node_start_pfn)
+       if (!pgdat->node_spanned_pages || start_pfn < pgdat->node_start_pfn)
                 pgdat->node_start_pfn = start_pfn;

         pgdat->node_spanned_pages = max(old_pgdat_end_pfn, end_pfn) -
-- 
1.7.10.1

^ permalink raw reply related

* [PATCH][V2] powerpc/fsl-pci: Add PCI controller ATMU PM support
From: Jia Hongtao @ 2012-11-07  8:10 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: B07421, B04825, b38951

Power supply for PCI controller ATMU registers is off when system go to
deep-sleep state. So ATMU registers should be re-setup during PCI
controllers resume from sleep.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index ffb93ae..e6ab952 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -89,7 +89,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
 	return 0;
 }
 
-static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
+static int setup_one_atmu(struct ccsr_pci __iomem *pci,
 	unsigned int index, const struct resource *res,
 	resource_size_t offset)
 {
@@ -126,7 +126,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
 }
 
 /* atmu setup for fsl pci/pcie controller */
-static void __init setup_pci_atmu(struct pci_controller *hose,
+static void setup_pci_atmu(struct pci_controller *hose,
 				  struct resource *rsrc)
 {
 	struct ccsr_pci __iomem *pci;
@@ -902,9 +902,42 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int fsl_pci_resume(struct device *dev)
+{
+	struct pci_controller *hose;
+	struct resource pci_rsrc;
+
+	hose = pci_find_hose_for_OF_device(dev->of_node);
+	if (!hose)
+		return -ENODEV;
+
+	if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) {
+		pr_warning("Get pci register base failed");
+		return -ENOMEM;
+	}
+
+	setup_pci_atmu(hose, &pci_rsrc);
+
+	return 0;
+}
+
+static const struct dev_pm_ops pci_pm_ops = {
+	.resume = fsl_pci_resume,
+};
+
+#define PCI_PM_OPS (&pci_pm_ops)
+
+#else
+
+#define PCI_PM_OPS NULL
+
+#endif
+
 static struct platform_driver fsl_pci_driver = {
 	.driver = {
 		.name = "fsl-pci",
+		.pm = PCI_PM_OPS,
 		.of_match_table = pci_ids,
 	},
 	.probe = fsl_pci_probe,
-- 
1.7.5.1

^ permalink raw reply related

* Re: [PATCH][V2] powerpc/fsl-pci: Add PCI controller ATMU PM support
From: Timur Tabi @ 2012-11-07 15:57 UTC (permalink / raw)
  To: Jia Hongtao; +Cc: B07421, linuxppc-dev
In-Reply-To: <1352275806-5754-1-git-send-email-B38951@freescale.com>

Jia Hongtao wrote:
> Power supply for PCI controller ATMU registers is off when system go to
> deep-sleep state. So ATMU registers should be re-setup during PCI
> controllers resume from sleep.
> 
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
>  arch/powerpc/sysdev/fsl_pci.c |   37 +++++++++++++++++++++++++++++++++++--
>  1 files changed, 35 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
> index ffb93ae..e6ab952 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -89,7 +89,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
>  	return 0;
>  }
>  
> -static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
> +static int setup_one_atmu(struct ccsr_pci __iomem *pci,
>  	unsigned int index, const struct resource *res,
>  	resource_size_t offset)
>  {
> @@ -126,7 +126,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
>  }
>  
>  /* atmu setup for fsl pci/pcie controller */
> -static void __init setup_pci_atmu(struct pci_controller *hose,
> +static void setup_pci_atmu(struct pci_controller *hose,
>  				  struct resource *rsrc)
>  {
>  	struct ccsr_pci __iomem *pci;
> @@ -902,9 +902,42 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_PM
> +static int fsl_pci_resume(struct device *dev)
> +{
> +	struct pci_controller *hose;
> +	struct resource pci_rsrc;
> +
> +	hose = pci_find_hose_for_OF_device(dev->of_node);
> +	if (!hose)
> +		return -ENODEV;
> +
> +	if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) {
> +		pr_warning("Get pci register base failed");
> +		return -ENOMEM;

dev_err

and it's not -ENOMEM.  ENOMEM means that you've run out of memory.  This
should also be ENODEV.

> +	}
> +
> +	setup_pci_atmu(hose, &pci_rsrc);
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops pci_pm_ops = {
> +	.resume = fsl_pci_resume,
> +};
> +
> +#define PCI_PM_OPS (&pci_pm_ops)
> +
> +#else
> +
> +#define PCI_PM_OPS NULL
> +
> +#endif
> +
>  static struct platform_driver fsl_pci_driver = {
>  	.driver = {
>  		.name = "fsl-pci",
> +		.pm = PCI_PM_OPS,
>  		.of_match_table = pci_ids,
>  	},
>  	.probe = fsl_pci_probe,
> 


-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* [PATCH 2/4] perf/Power7: Use macros to identify perf events
From: Sukadev Bhattiprolu @ 2012-11-07 19:18 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Anton Blanchard, robert.richter
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20121107191818.GA16211@us.ibm.com>


>From 8a0dbd8f3fce2834292efa50c15ca64d4f6a6536 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Wed, 7 Nov 2012 09:36:14 -0800
Subject: [PATCH 2/4] perf/Power7: Use macros to identify perf events

Define and use macros to identify perf events codes This would make it
easier and more readable when these event codes need to be used in more
than one place.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/perf/power7-pmu.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 441af08..256db4f 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -295,15 +295,24 @@ static void power7_disable_pmc(unsigned int pmc, unsigned long mmcr[])
 		mmcr[1] &= ~(0xffUL << MMCR1_PMCSEL_SH(pmc));
 }
 
+#define	PM_CYC				0x1e
+#define	PM_GCT_NOSLOT_CYC		0x100f8
+#define	PM_CMPLU_STALL			0x4000a
+#define	PM_INST_CMPL			0x2
+#define	PM_LD_REF_L1			0xc880
+#define	PM_LD_MISS_L1			0x400f0
+#define	PM_BRU_FIN			0x10068
+#define	PM_BRU_MPRED			0x400f6
+
 static int power7_generic_events[] = {
-	[PERF_COUNT_HW_CPU_CYCLES] = 0x1e,
-	[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x100f8, /* GCT_NOSLOT_CYC */
-	[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x4000a,  /* CMPLU_STALL */
-	[PERF_COUNT_HW_INSTRUCTIONS] = 2,
-	[PERF_COUNT_HW_CACHE_REFERENCES] = 0xc880,	/* LD_REF_L1_LSU*/
-	[PERF_COUNT_HW_CACHE_MISSES] = 0x400f0,		/* LD_MISS_L1	*/
-	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x10068,	/* BRU_FIN	*/
-	[PERF_COUNT_HW_BRANCH_MISSES] = 0x400f6,	/* BR_MPRED	*/
+	[PERF_COUNT_HW_CPU_CYCLES] = 			PM_CYC,
+	[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 	PM_GCT_NOSLOT_CYC,
+	[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 	PM_CMPLU_STALL,
+	[PERF_COUNT_HW_INSTRUCTIONS] = 			PM_INST_CMPL,
+	[PERF_COUNT_HW_CACHE_REFERENCES] = 		PM_LD_REF_L1,
+	[PERF_COUNT_HW_CACHE_MISSES] = 			PM_LD_MISS_L1,
+	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 		PM_BRU_FIN,
+	[PERF_COUNT_HW_BRANCH_MISSES] = 		PM_BRU_MPRED,
 };
 
 #define C(x)	PERF_COUNT_HW_CACHE_##x
-- 
1.7.1

^ permalink raw reply related

* [PATCH 3/4] perf/POWER7: Make event translations available in sysfs
From: Sukadev Bhattiprolu @ 2012-11-07 19:19 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Anton Blanchard, robert.richter
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20121107191818.GA16211@us.ibm.com>


>From d05d1ce6d55bf339eee6230ded9f5dd1351f60e5 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Tue, 6 Nov 2012 14:07:36 -0800
Subject: [PATCH 3/4] perf/POWER7: Make event translations available in sysfs

Make the perf events supported by POWER7 available via sysfs.

	$ ls /sys/bus/event_source/devices/cpu/events
	branch-instructions
	branch-misses
	cache-misses
	cache-references
	cpu-cycles
	instructions
	stalled-cycles-backend
	stalled-cycles-frontend

	$ cat /sys/bus/event_source/devices/cpu/events/cache-misses
	event=0x03

This patch is based on commits that implement this functionality on x86.
Eg:
	commit a47473939db20e3961b200eb00acf5fcf084d755
	Author: Jiri Olsa <jolsa@redhat.com>
	Date:   Wed Oct 10 14:53:11 2012 +0200

	    perf/x86: Make hardware event translations available in sysfs

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/perf_event_server.h |   21 +++++++++++++++++
 arch/powerpc/perf/core-book3s.c              |   12 +++++++++
 arch/powerpc/perf/power7-pmu.c               |   32 ++++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index 9710be3..ad84f73 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -11,6 +11,8 @@
 
 #include <linux/types.h>
 #include <asm/hw_irq.h>
+#include <linux/sysfs.h>
+#include <linux/device.h>
 
 #define MAX_HWEVENTS		8
 #define MAX_EVENT_ALTERNATIVES	8
@@ -35,6 +37,7 @@ struct power_pmu {
 	void		(*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
 	int		(*limited_pmc_event)(u64 event_id);
 	u32		flags;
+	const struct attribute_group	**attr_groups;
 	int		n_generic;
 	int		*generic_events;
 	int		(*cache_events)[PERF_COUNT_HW_CACHE_MAX]
@@ -109,3 +112,21 @@ extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
  * If an event_id is not subject to the constraint expressed by a particular
  * field, then it will have 0 in both the mask and value for that field.
  */
+
+
+struct perf_pmu_events_attr {
+	struct device_attribute attr;
+	u64 id;
+};
+
+extern ssize_t power_events_sysfs_show(struct device *dev,
+				struct device_attribute *attr, char *page);
+
+#define EVENT_VAR(_id)	event_attr_##_id
+#define EVENT_PTR(_id) &event_attr_##_id.attr.attr
+
+#define EVENT_ATTR(_name, _id)                                             \
+	static struct perf_pmu_events_attr EVENT_VAR(_id) = {              \
+		.attr = __ATTR(_name, 0444, power_events_sysfs_show, NULL),\
+		.id   = PM_##_id,                                               \
+	};
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index aa2465e..19b23bd 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -1305,6 +1305,16 @@ static int power_pmu_event_idx(struct perf_event *event)
 	return event->hw.idx;
 }
 
+ssize_t power_events_sysfs_show(struct device *dev,
+				struct device_attribute *attr, char *page)
+{
+       struct perf_pmu_events_attr *pmu_attr;
+       
+       pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
+        
+       return sprintf(page, "event=0x%02llx\n", pmu_attr->id);
+}
+
 struct pmu power_pmu = {
 	.pmu_enable	= power_pmu_enable,
 	.pmu_disable	= power_pmu_disable,
@@ -1537,6 +1547,8 @@ int __cpuinit register_power_pmu(struct power_pmu *pmu)
 	pr_info("%s performance monitor hardware support registered\n",
 		pmu->name);
 
+	power_pmu.attr_groups = ppmu->attr_groups;
+
 #ifdef MSR_HV
 	/*
 	 * Use FCHV to ignore kernel events if MSR.HV is set.
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 256db4f..31c61ab 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -360,6 +360,37 @@ static int power7_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
 	},
 };
 
+EVENT_ATTR(cpu-cycles,                 CYC);
+EVENT_ATTR(stalled-cycles-frontend,    GCT_NOSLOT_CYC);
+EVENT_ATTR(stalled-cycles-backend,     CMPLU_STALL);
+EVENT_ATTR(instructions,               INST_CMPL);
+EVENT_ATTR(cache-references,           LD_REF_L1);
+EVENT_ATTR(cache-misses,               LD_MISS_L1);
+EVENT_ATTR(branch-instructions,        BRU_FIN);
+EVENT_ATTR(branch-misses,              BRU_MPRED);
+
+static struct attribute *power7_events_attr[] = {
+	EVENT_PTR(CYC),
+	EVENT_PTR(GCT_NOSLOT_CYC),
+	EVENT_PTR(CMPLU_STALL),
+	EVENT_PTR(INST_CMPL),
+	EVENT_PTR(LD_REF_L1),
+	EVENT_PTR(LD_MISS_L1),
+	EVENT_PTR(BRU_FIN),
+	EVENT_PTR(BRU_MPRED),
+	NULL,
+};
+
+static struct attribute_group power7_pmu_events_group = {
+	.name = "events",
+	.attrs = power7_events_attr,           
+};
+
+static const struct attribute_group *power7_pmu_attr_groups[] = {
+	&power7_pmu_events_group,
+	NULL,
+};
+
 static struct power_pmu power7_pmu = {
 	.name			= "POWER7",
 	.n_counter		= 6,
@@ -371,6 +402,7 @@ static struct power_pmu power7_pmu = {
 	.get_alternatives	= power7_get_alternatives,
 	.disable_pmc		= power7_disable_pmc,
 	.flags			= PPMU_ALT_SIPR,
+	.attr_groups		= power7_pmu_attr_groups,
 	.n_generic		= ARRAY_SIZE(power7_generic_events),
 	.generic_events		= power7_generic_events,
 	.cache_events		= &power7_cache_events,
-- 
1.7.1

^ permalink raw reply related

* [PATCH 4/4] perf: Create a sysfs entry for Power event format
From: Sukadev Bhattiprolu @ 2012-11-07 19:19 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Anton Blanchard, robert.richter
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20121107191818.GA16211@us.ibm.com>


>From bafc551c31ce23c1cba0b75d23de6c46aba90f26 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Tue, 6 Nov 2012 16:30:28 -0800
Subject: [PATCH 4/4] perf: Create a sysfs entry for Power event format

Create a sysfs entry, '/sys/bus/event_source/devices/cpu/format/event'
which describes the format of a POWER cpu.

	$ cat /sys/bus/event_source/devices/cpu/format/event
	config:0-20

The format of the event is the same for all POWER cpus, so bulk of this
change is in the code common to POWER cpus.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/perf_event_server.h |    8 ++++++++
 arch/powerpc/perf/core-book3s.c              |   19 +++++++++++++++++++
 arch/powerpc/perf/power7-pmu.c               |    1 +
 3 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index ad84f73..20a49bf 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -130,3 +130,11 @@ extern ssize_t power_events_sysfs_show(struct device *dev,
 		.attr = __ATTR(_name, 0444, power_events_sysfs_show, NULL),\
 		.id   = PM_##_id,                                               \
 	};
+
+/*
+ * Format of a perf event is the same on all POWER cpus. Declare a
+ * common sysfs attribute group that individual POWER cpus can share.
+ */
+extern struct attribute_group power_pmu_format_group;
+
+
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 19b23bd..388e2a1 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -1315,6 +1315,25 @@ ssize_t power_events_sysfs_show(struct device *dev,
        return sprintf(page, "event=0x%02llx\n", pmu_attr->id);
 }
 
+static ssize_t power_config_sysfs_show(struct device *dev,
+				struct device_attribute *attr, char *page)
+{
+	return sprintf(page, "config:0-20\n");
+}
+
+static struct device_attribute config_dev_attr = \
+			__ATTR(event, 0444, power_config_sysfs_show, NULL);
+
+static struct attribute *power_pmu_format_attr[] = {
+	&config_dev_attr.attr,
+	NULL,
+};
+
+struct attribute_group power_pmu_format_group = {
+	.name = "format",
+	.attrs = power_pmu_format_attr,
+};
+
 struct pmu power_pmu = {
 	.pmu_enable	= power_pmu_enable,
 	.pmu_disable	= power_pmu_disable,
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 31c61ab..aa9f588 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -387,6 +387,7 @@ static struct attribute_group power7_pmu_events_group = {
 };
 
 static const struct attribute_group *power7_pmu_attr_groups[] = {
+	&power_pmu_format_group,
 	&power7_pmu_events_group,
 	NULL,
 };
-- 
1.7.1

^ permalink raw reply related

* [PATCH 1/4] perf/powerpc: Use uapi/unistd.h to fix build error
From: Sukadev Bhattiprolu @ 2012-11-07 19:18 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Anton Blanchard, robert.richter
  Cc: linuxppc-dev, sukadev, linux-kernel


>From b8beef080260c1625c8f801105504a82005295e5 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Wed, 31 Oct 2012 11:21:28 -0700
Subject: [PATCH 1/4] perf/powerpc: Use uapi/unistd.h to fix build error

Use the 'unistd.h' from arch/powerpc/include/uapi to build the perf tool.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 tools/perf/perf.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 054182e..f4952da 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -26,7 +26,7 @@ void get_term_dimensions(struct winsize *ws);
 #endif
 
 #ifdef __powerpc__
-#include "../../arch/powerpc/include/asm/unistd.h"
+#include "../../arch/powerpc/include/uapi/asm/unistd.h"
 #define rmb()		asm volatile ("sync" ::: "memory")
 #define cpu_relax()	asm volatile ("" ::: "memory");
 #define CPUINFO_PROC	"cpu"
-- 
1.7.1

^ permalink raw reply related

* perf: POWER-event translation questions
From: Sukadev Bhattiprolu @ 2012-11-08  1:10 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Anton Blanchard, robert.richter,
	eranian
  Cc: linuxppc-dev, linux-kernel



Looking for feedback on this prototype for making POWER-specific event
translations available in sysfs. It is based on the patchset:

	https://lkml.org/lkml/2012/11/7/402

which makes the translations for _generic_ events in POWER available in sysfs:

Since this is in POWER7 specific code I am assigning the names given in the
POWER7 CPU spec for now.

I had earlier tried mapping these events to generic names outside sysfs:

	Power7 name		Generic name

	cmpl-stall-fxu		stalled-cycles-fixed-point
	cmpl-stall-lsu		stalled-cycles-load-store
	cmpl-stall-ifu		stalled-cycles-instruction-fetch
	cmpl-stall-bru 		stalled-cycles-branch-unit

But like Stephane Eranian pointed out mapping such events across architectures
can be confusing.

Another challenge I suspect we will have is the extremely long generic names
we could end up with as the events get more specific.

1. Can we have more than one name for an event ? i.e two sysfs entries,
   eg: 'cmpl-stall-fxu' and 'stalled-cycles-fixed-point' for an event ?

2. Can we allow hyphens in the {name} token  (please see my change to
   util/parse-events.l below). With this change, I can run:

	  perf stat -e cpu/cmplu-stall-bru /tmp/nop

   without any changes to the user level tool (parse-events.l) I have
   tested some common cases, not sure if it will break something :-)

   If we are going to create generic or arch specific sysfs entries in
   /sys/bus/event_source/devices/cpu/events, do we need to add corresponding
   entry in tools/perf/util/parse-events.l ?

Sukadev

---
 arch/powerpc/perf/power7-pmu.c |   13 +++++++++++++
 tools/perf/util/parse-events.l |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index aa9f588..9f46abc 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -303,6 +303,10 @@ static void power7_disable_pmc(unsigned int pmc, unsigned long mmcr[])
 #define	PM_LD_MISS_L1			0x400f0
 #define	PM_BRU_FIN			0x10068
 #define	PM_BRU_MPRED			0x400f6
+#define	PM_CMPLU_STALL_FXU		0x20014
+#define	PM_CMPLU_STALL_LSU		0x20012
+#define	PM_CMPLU_STALL_IFU		0x4004c
+#define	PM_CMPLU_STALL_BRU		0x4004e
 
 static int power7_generic_events[] = {
 	[PERF_COUNT_HW_CPU_CYCLES] = 			PM_CYC,
@@ -369,6 +373,11 @@ EVENT_ATTR(cache-misses,               LD_MISS_L1);
 EVENT_ATTR(branch-instructions,        BRU_FIN);
 EVENT_ATTR(branch-misses,              BRU_MPRED);
 
+EVENT_ATTR(cmplu-stall-fxu,            CMPLU_STALL_FXU);
+EVENT_ATTR(cmplu-stall-lsu,            CMPLU_STALL_LSU);
+EVENT_ATTR(cmplu-stall-ifu,            CMPLU_STALL_IFU);
+EVENT_ATTR(cmplu-stall-bru,            CMPLU_STALL_BRU);
+
 static struct attribute *power7_events_attr[] = {
 	EVENT_PTR(CYC),
 	EVENT_PTR(GCT_NOSLOT_CYC),
@@ -378,6 +387,10 @@ static struct attribute *power7_events_attr[] = {
 	EVENT_PTR(LD_MISS_L1),
 	EVENT_PTR(BRU_FIN),
 	EVENT_PTR(BRU_MPRED),
+	EVENT_PTR(CMPLU_STALL_FXU),
+	EVENT_PTR(CMPLU_STALL_LSU),
+	EVENT_PTR(CMPLU_STALL_IFU),
+	EVENT_PTR(CMPLU_STALL_BRU),
 	NULL,
 };
 
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index c87efc1..1967bb2 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -80,7 +80,7 @@ event		[^,{}/]+
 num_dec		[0-9]+
 num_hex		0x[a-fA-F0-9]+
 num_raw_hex	[a-fA-F0-9]+
-name		[a-zA-Z_*?][a-zA-Z0-9_*?]*
+name		[-a-zA-Z_*?][-a-zA-Z0-9_*?]*
 modifier_event	[ukhpGH]{1,8}
 modifier_bp	[rwx]{1,3}
 
-- 
1.7.1

^ permalink raw reply related

* [PATCH][V3] powerpc/fsl-pci: Add PCI controller ATMU PM support
From: Jia Hongtao @ 2012-11-08  2:11 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: B07421, B04825, b38951

Power supply for PCI controller ATMU registers is off when system go to
deep-sleep state. So ATMU registers should be re-setup during PCI
controllers resume from sleep.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index ffb93ae..b96885b 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -89,7 +89,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
 	return 0;
 }
 
-static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
+static int setup_one_atmu(struct ccsr_pci __iomem *pci,
 	unsigned int index, const struct resource *res,
 	resource_size_t offset)
 {
@@ -126,7 +126,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
 }
 
 /* atmu setup for fsl pci/pcie controller */
-static void __init setup_pci_atmu(struct pci_controller *hose,
+static void setup_pci_atmu(struct pci_controller *hose,
 				  struct resource *rsrc)
 {
 	struct ccsr_pci __iomem *pci;
@@ -902,9 +902,42 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int fsl_pci_resume(struct device *dev)
+{
+	struct pci_controller *hose;
+	struct resource pci_rsrc;
+
+	hose = pci_find_hose_for_OF_device(dev->of_node);
+	if (!hose)
+		return -ENODEV;
+
+	if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) {
+		dev_err(dev, "Get pci register base failed.");
+		return -ENODEV;
+	}
+
+	setup_pci_atmu(hose, &pci_rsrc);
+
+	return 0;
+}
+
+static const struct dev_pm_ops pci_pm_ops = {
+	.resume = fsl_pci_resume,
+};
+
+#define PCI_PM_OPS (&pci_pm_ops)
+
+#else
+
+#define PCI_PM_OPS NULL
+
+#endif
+
 static struct platform_driver fsl_pci_driver = {
 	.driver = {
 		.name = "fsl-pci",
+		.pm = PCI_PM_OPS,
 		.of_match_table = pci_ids,
 	},
 	.probe = fsl_pci_probe,
-- 
1.7.5.1

^ permalink raw reply related

* [PATCH] driver/mtd/IFC:Wait tWB time, poll R/B before command execution
From: Prabhakar Kushwaha @ 2012-11-08  8:12 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev
  Cc: scottwood, Hemant Nautiyal, Prabhakar Kushwaha, dedekind1

IFC_FIR_OP_CMD0 issues command for execution without checking flash
readiness. It may cause problem if flash is not ready. Instead use
IFC_FIR_OP_CW0 which Wait for tWB time and poll R/B to return high or
time-out, before issuing command.

NAND_CMD_READID command implemention does not fulfill above requirement. So
update its programming.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Hemant Nautiyal <hemant.nautiyal@freescale.com>
---
 Based upon git://git.infradead.org/linux-mtd.git branch master

 drivers/mtd/nand/fsl_ifc_nand.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 8f0dd13..7e5b17c 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -382,7 +382,7 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
 			timing = IFC_FIR_OP_RBCD;
 
 		out_be32(&ifc->ifc_nand.nand_fir0,
-				(IFC_FIR_OP_CMD0 << IFC_NAND_FIR0_OP0_SHIFT) |
+				(IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) |
 				(IFC_FIR_OP_UA  << IFC_NAND_FIR0_OP1_SHIFT) |
 				(timing << IFC_NAND_FIR0_OP2_SHIFT));
 		out_be32(&ifc->ifc_nand.nand_fcr0,
@@ -785,7 +785,7 @@ static void fsl_ifc_sram_init(struct fsl_ifc_mtd *priv)
 
 	/* READID */
 	out_be32(&ifc->ifc_nand.nand_fir0,
-			(IFC_FIR_OP_CMD0 << IFC_NAND_FIR0_OP0_SHIFT) |
+			(IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) |
 			(IFC_FIR_OP_UA  << IFC_NAND_FIR0_OP1_SHIFT) |
 			(IFC_FIR_OP_RB << IFC_NAND_FIR0_OP2_SHIFT));
 	out_be32(&ifc->ifc_nand.nand_fcr0,
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 0/1] powerpc/vdso: remove redundant locking in update_vsyscall_tz()
From: Shan Hai @ 2012-11-09  1:57 UTC (permalink / raw)
  To: benh; +Cc: john.stultz, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

The locking in update_vsyscall_tz() is not only unnecessary because the vdso
code copies the data unproteced in __kernel_gettimeofday() but also
introduces a hard to reproduce race condition between update_vsyscall()
and update_vsyscall_tz(), which causes user space process to loop
forever in vdso code.

The following patch removes the locking from update_vsyscall_tz().

---
 arch/powerpc/kernel/time.c |    5 -----
 1 file changed, 5 deletions(-)

Thanks
Shan Hai

[-- Attachment #2: 0001-powerpc-vdso-remove-redundant-locking-in-update_vsys.patch --]
[-- Type: text/x-diff, Size: 1810 bytes --]

>From 167eac293b07e0ee201ffe5043ec442d52495a48 Mon Sep 17 00:00:00 2001
From: Shan Hai <shan.hai@windriver.com>
Date: Mon, 5 Nov 2012 18:24:22 +0800
Subject: [PATCH 1/1] powerpc/vdso: remove redundant locking in
 update_vsyscall_tz()

Locking is not only unnecessary because the vdso code copies the data
unprotected in __kernel_gettimeofday() but also erroneous because updating
the tb_update_count is not atomic and introduces a hard to reproduce race
condition between update_vsyscall() and update_vsyscall_tz(), which further
causes user space process to loop forever in vdso code.

The below scenario describes the race condition,
x==0	Boot CPU			other CPU
	proc_P: x==0
	    timer interrupt
		update_vsyscall
x==1		    x++;sync		settimeofday
					    update_vsyscall_tz
x==2						x++;sync
x==3		    sync;x++
						sync;x++
	proc_P: x==3 (loops until x becomes even)

Because the ++ operator would be implemented as three instructions and not
atomic on powerpc.

A similar change was made for x86 in commit 6c260d58634
("x86: vdso: Remove bogus locking in update_vsyscall_tz")

Signed-off-by: Shan Hai <shan.hai@windriver.com>
---
 arch/powerpc/kernel/time.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 03b29a6..426141f 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -859,13 +859,8 @@ void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
 
 void update_vsyscall_tz(void)
 {
-	/* Make userspace gettimeofday spin until we're done. */
-	++vdso_data->tb_update_count;
-	smp_mb();
 	vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
 	vdso_data->tz_dsttime = sys_tz.tz_dsttime;
-	smp_mb();
-	++vdso_data->tb_update_count;
 }
 
 static void __init clocksource_init(void)
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH 00/14] powerpc: Add support for POWER8 relocation on exceptions
From: Michael Neuling @ 2012-11-09  6:18 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Michael Neuling, linuxppc-dev, Ian Munsie, Matt Evans

This set of patches adds support for taking exceptions with the MMU on which is
supported by POWER8.

A new set of exception vectors is added at 0xc000_0000_0000_4xxx.  When the HW
takes us here, MSR IR/DR will be set already and we no longer need a costly
RFID to turn the MMU back on again.

The original 0x0 based exception vectors remain for when the HW can't leave the
MMU on.  Examples of this are when we can't trust the current the MMU mappings,
like when we are changing from guest to hypervisor (HV 0 -> 1) or when the MMU
was off already.  In these cases the HW will take us to the original 0x0 based
exception vectors with the MMU off as before.

The core of these patches were originally written by Matt Evans.  

Ian Munsie (5):
  powerpc: Add set_mode hcall
  powerpc: Add wrappers to enable/disable relocation on exceptions
  powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate
    function
  powerpc: Enable relocation on during exceptions at boot
  powerpc: Disable relocation on exceptions when kexecing

Michael Neuling (9):
  powerpc: Add POWER8 architected mode to cputable
  powerpc: Whitespace changes in exception64s.S
  powerpc: Remove unessessary 0x3000 location enforcement
  powerpc: Make load_hander handle upto 64k offset
  powerpc: Turn syscall handler into macros
  powerpc: Add new macros needed for relocation on exceptions
  powerpc: Add relocation on exception vector handlers
  powerpc: Move initial mfspr LPCR out of __init_LPCR
  powerpc: Setup relocation on exceptions for bare metal systems

 arch/powerpc/include/asm/exception-64s.h        |   97 ++++++-
 arch/powerpc/include/asm/firmware.h             |    4 +-
 arch/powerpc/include/asm/hvcall.h               |   23 +-
 arch/powerpc/include/asm/reg.h                  |    2 +
 arch/powerpc/kernel/cpu_setup_power.S           |    8 +-
 arch/powerpc/kernel/cputable.c                  |   15 ++
 arch/powerpc/kernel/exceptions-64s.S            |  306 +++++++++++++++++++----
 arch/powerpc/kernel/head_64.S                   |    3 +-
 arch/powerpc/kernel/setup_64.c                  |    5 +
 arch/powerpc/platforms/pseries/firmware.c       |    1 +
 arch/powerpc/platforms/pseries/plpar_wrappers.h |   36 +++
 arch/powerpc/platforms/pseries/setup.c          |   71 ++++++
 drivers/infiniband/hw/ehca/hcp_if.c             |   20 --
 drivers/net/ethernet/ibm/ehea/ehea_phyp.h       |   20 --
 14 files changed, 516 insertions(+), 95 deletions(-)

-- 
1.7.9.5

^ permalink raw reply

* [PATCH 01/14] powerpc: Fix name denorm hypervisor symbol
From: Michael Neuling @ 2012-11-09  6:18 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Michael Neuling, linuxppc-dev, Ian Munsie, Matt Evans
In-Reply-To: <1352441953-29096-1-git-send-email-mikey@neuling.org>

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/exceptions-64s.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 10b658a..5663018 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -276,7 +276,7 @@ vsx_unavailable_pSeries_1:
 	KVM_HANDLER_PR_SKIP(PACA_EXGEN, EXC_STD, 0x1300)
 
 	. = 0x1500
-	.global denorm_Hypervisor
+	.global denorm_exception_hv
 denorm_exception_hv:
 	HMT_MEDIUM
 	mtspr	SPRN_SPRG_HSCRATCH0,r13
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 02/14] powerpc: Whitespace changes in exception64s.S
From: Michael Neuling @ 2012-11-09  6:19 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Michael Neuling, linuxppc-dev, Ian Munsie, Matt Evans
In-Reply-To: <1352441953-29096-1-git-send-email-mikey@neuling.org>

Remove redundancy spaces and make tab usage consistent.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/exceptions-64s.S |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 5663018..29cf7b1 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -613,8 +613,8 @@ machine_check_common:
 	STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
 	STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
 	STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
-        STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception)
-        STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception)
+	STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception)
+	STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception)
 	STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, .performance_monitor_exception)
 	STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)
 	STD_EXCEPTION_COMMON(0x1502, denorm, .unknown_exception)
@@ -714,21 +714,21 @@ data_access_common:
 	ld	r3,PACA_EXGEN+EX_DAR(r13)
 	lwz	r4,PACA_EXGEN+EX_DSISR(r13)
 	li	r5,0x300
-	b	.do_hash_page	 	/* Try to handle as hpte fault */
+	b	.do_hash_page		/* Try to handle as hpte fault */
 
 	.align  7
-        .globl  h_data_storage_common
+	.globl  h_data_storage_common
 h_data_storage_common:
-        mfspr   r10,SPRN_HDAR
-        std     r10,PACA_EXGEN+EX_DAR(r13)
-        mfspr   r10,SPRN_HDSISR
-        stw     r10,PACA_EXGEN+EX_DSISR(r13)
-        EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN)
-        bl      .save_nvgprs
+	mfspr   r10,SPRN_HDAR
+	std     r10,PACA_EXGEN+EX_DAR(r13)
+	mfspr   r10,SPRN_HDSISR
+	stw     r10,PACA_EXGEN+EX_DSISR(r13)
+	EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN)
+	bl      .save_nvgprs
 	DISABLE_INTS
-        addi    r3,r1,STACK_FRAME_OVERHEAD
-        bl      .unknown_exception
-        b       .ret_from_except
+	addi    r3,r1,STACK_FRAME_OVERHEAD
+	bl      .unknown_exception
+	b       .ret_from_except
 
 	.align	7
 	.globl instruction_access_common
@@ -741,7 +741,7 @@ instruction_access_common:
 	li	r5,0x400
 	b	.do_hash_page		/* Try to handle as hpte fault */
 
-        STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception)
+	STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception)
 
 /*
  * Here is the common SLB miss user that is used when going to virtual
@@ -1164,7 +1164,7 @@ fwnmi_data_area:
 	/* pseries and powernv need to keep the whole page from
 	 * 0x7000 to 0x8000 free for use by the firmware
 	 */
-        . = 0x8000
+	. = 0x8000
 #endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
 
 /* Space for CPU0's segment table */
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 03/14] powerpc: Remove unessessary 0x3000 location enforcement
From: Michael Neuling @ 2012-11-09  6:19 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Michael Neuling, linuxppc-dev, Ian Munsie, Matt Evans
In-Reply-To: <1352441953-29096-1-git-send-email-mikey@neuling.org>

This removes the large gap between 0x1800 and 0x3000.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/exceptions-64s.S |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 29cf7b1..de02964 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -311,12 +311,14 @@ denorm_exception_hv:
 #ifdef CONFIG_CBE_RAS
 	STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal)
 	KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1802)
+#else
+	. = 0x1800
 #endif /* CONFIG_CBE_RAS */
 
-	. = 0x3000
 
 /*** Out of line interrupts support ***/
 
+	.align	7
 	/* moved from 0x200 */
 machine_check_pSeries:
 	.globl machine_check_fwnmi
-- 
1.7.9.5

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox