All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] powerpc/xive: Remove incorrect debug code
@ 2018-01-12  2:28 Benjamin Herrenschmidt
  2018-01-12  2:28 ` [PATCH 2/5] powerpc: Remove DEBUG define in 64-bit early setup code Benjamin Herrenschmidt
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2018-01-12  2:28 UTC (permalink / raw)
  To: linuxppc-dev

WORD2 if the TIMA isn't byte accessible and
isn't that useful to know about, take out the
pr_devel statement.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/sysdev/xive/common.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index a3b8d7d1316e..838ebdbfe4c5 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -1269,11 +1269,6 @@ static void xive_setup_cpu(void)
 {
 	struct xive_cpu *xc = __this_cpu_read(xive_cpu);
 
-	/* Debug: Dump the TM state */
-	pr_devel("CPU %d [HW 0x%02x] VT=%02x\n",
-	    smp_processor_id(), hard_smp_processor_id(),
-	    in_8(xive_tima + xive_tima_offset + TM_WORD2));
-
 	/* The backend might have additional things to do */
 	if (xive_ops->setup_cpu)
 		xive_ops->setup_cpu(smp_processor_id(), xc);
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] powerpc: Remove DEBUG define in 64-bit early setup code
  2018-01-12  2:28 [PATCH 1/5] powerpc/xive: Remove incorrect debug code Benjamin Herrenschmidt
@ 2018-01-12  2:28 ` Benjamin Herrenschmidt
  2018-01-12  2:28 ` [PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message Benjamin Herrenschmidt
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2018-01-12  2:28 UTC (permalink / raw)
  To: linuxppc-dev

This statement causes some not very useful messages to always
be printed on the serial port at boot, even on quiet boots.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/setup_64.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 8956a9856604..d3124c302146 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -10,8 +10,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#define DEBUG
-
 #include <linux/export.h>
 #include <linux/string.h>
 #include <linux/sched.h>
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message
  2018-01-12  2:28 [PATCH 1/5] powerpc/xive: Remove incorrect debug code Benjamin Herrenschmidt
  2018-01-12  2:28 ` [PATCH 2/5] powerpc: Remove DEBUG define in 64-bit early setup code Benjamin Herrenschmidt
@ 2018-01-12  2:28 ` Benjamin Herrenschmidt
  2018-01-16  0:59   ` Stewart Smith
  2018-01-12  2:28 ` [PATCH 4/5] powerpc: Remove useless EXC_COMMON_HV Benjamin Herrenschmidt
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2018-01-12  2:28 UTC (permalink / raw)
  To: linuxppc-dev

This message isn't terribly useful.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/platforms/powernv/opal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 041ddbd1fc57..2479e3396ed8 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -127,7 +127,7 @@ int __init early_init_dt_scan_opal(unsigned long node,
 
 	if (of_flat_dt_is_compatible(node, "ibm,opal-v3")) {
 		powerpc_firmware_features |= FW_FEATURE_OPAL;
-		pr_info("OPAL detected !\n");
+		pr_debug("OPAL detected !\n");
 	} else {
 		panic("OPAL != V3 detected, no longer supported.\n");
 	}
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] powerpc: Remove useless EXC_COMMON_HV
  2018-01-12  2:28 [PATCH 1/5] powerpc/xive: Remove incorrect debug code Benjamin Herrenschmidt
  2018-01-12  2:28 ` [PATCH 2/5] powerpc: Remove DEBUG define in 64-bit early setup code Benjamin Herrenschmidt
  2018-01-12  2:28 ` [PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message Benjamin Herrenschmidt
@ 2018-01-12  2:28 ` Benjamin Herrenschmidt
  2018-01-17 13:30   ` [4/5] " Michael Ellerman
  2018-01-12  2:28 ` [PATCH 5/5] powerpc: Use the TRAP macro whenever comparing a trap number Benjamin Herrenschmidt
  2018-01-17 13:30 ` [1/5] powerpc/xive: Remove incorrect debug code Michael Ellerman
  4 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2018-01-12  2:28 UTC (permalink / raw)
  To: linuxppc-dev

The only difference between EXC_COMMON_HV and EXC_COMMON is that the
former adds "2" to the trap number which is supposed to represent the
fact that this is an "HV" interrupt which uses HSRR0/1.

However KVM is the only one who cares and it has its own separate macros.

In fact, we only have one user of EXC_COMMON_HV and it's for an
unknown interrupt case. All the other ones already using EXC_COMMON.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/include/asm/head-64.h   | 7 +------
 arch/powerpc/kernel/exceptions-64s.S | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/head-64.h b/arch/powerpc/include/asm/head-64.h
index fdcff76e9a25..0a663dfc28b5 100644
--- a/arch/powerpc/include/asm/head-64.h
+++ b/arch/powerpc/include/asm/head-64.h
@@ -178,7 +178,7 @@ end_##sname:
  * TRAMP_REAL_*   - real, unrelocated helpers (virt can call these)
  * TRAMP_VIRT_*   - virt, unreloc helpers (in practice, real can use)
  * TRAMP_KVM      - KVM handlers that get put into real, unrelocated
- * EXC_COMMON_*   - virt, relocated common handlers
+ * EXC_COMMON     - virt, relocated common handlers
  *
  * The EXC handlers are given a name, and branch to name_common, or the
  * appropriate KVM or masking function. Vector handler verieties are as
@@ -211,7 +211,6 @@ end_##sname:
  * EXC_COMMON_BEGIN/END - used to open-code the handler
  * EXC_COMMON
  * EXC_COMMON_ASYNC
- * EXC_COMMON_HV
  *
  * TRAMP_REAL and TRAMP_VIRT can be used with BEGIN/END. KVM
  * and OOL handlers are implemented as types of TRAMP and TRAMP_VIRT handlers.
@@ -413,10 +412,6 @@ end_##sname:
 	EXC_COMMON_BEGIN(name);						\
 	STD_EXCEPTION_COMMON_ASYNC(realvec, name, hdlr);		\
 
-#define EXC_COMMON_HV(name, realvec, hdlr)				\
-	EXC_COMMON_BEGIN(name);						\
-	STD_EXCEPTION_COMMON(realvec + 0x2, name, hdlr);		\
-
 #endif /* __ASSEMBLY__ */
 
 #endif	/* _ASM_POWERPC_HEAD_64_H */
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index e441b469dc8f..175891c6909c 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1318,7 +1318,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
 	b	.
 #endif
 
-EXC_COMMON_HV(denorm_common, 0x1500, unknown_exception)
+EXC_COMMON(denorm_common, 0x1500, unknown_exception)
 
 
 #ifdef CONFIG_CBE_RAS
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] powerpc: Use the TRAP macro whenever comparing a trap number
  2018-01-12  2:28 [PATCH 1/5] powerpc/xive: Remove incorrect debug code Benjamin Herrenschmidt
                   ` (2 preceding siblings ...)
  2018-01-12  2:28 ` [PATCH 4/5] powerpc: Remove useless EXC_COMMON_HV Benjamin Herrenschmidt
@ 2018-01-12  2:28 ` Benjamin Herrenschmidt
  2018-01-17 13:30   ` [5/5] " Michael Ellerman
  2018-01-17 13:30 ` [1/5] powerpc/xive: Remove incorrect debug code Michael Ellerman
  4 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2018-01-12  2:28 UTC (permalink / raw)
  To: linuxppc-dev

Trap numbers can have extra bits at the bottom that need to
be filtered out. There are a few cases where we don't do that.

It's possible that we got lucky but better safe than sorry.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/process.c | 2 +-
 arch/powerpc/kernel/traps.c   | 2 +-
 arch/powerpc/mm/fault.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 72be0c32e902..397d6e64e3df 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1409,7 +1409,7 @@ void show_regs(struct pt_regs * regs)
 	print_msr_bits(regs->msr);
 	pr_cont("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
 	trap = TRAP(regs);
-	if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
+	if ((TRAP(regs) != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
 		pr_cont("CFAR: "REG" ", regs->orig_gpr3);
 	if (trap == 0x200 || trap == 0x300 || trap == 0x600)
 #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index f3eb61be0d30..d61989be28e1 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1564,7 +1564,7 @@ void facility_unavailable_exception(struct pt_regs *regs)
 	u8 status;
 	bool hv;
 
-	hv = (regs->trap == 0xf80);
+	hv = (TRAP(regs) == 0xf80);
 	if (hv)
 		value = mfspr(SPRN_HFSCR);
 	else
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 6e1e39035380..7b15fe2ac986 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -576,7 +576,7 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
 
 	/* kernel has accessed a bad area */
 
-	switch (regs->trap) {
+	switch (TRAP(regs)) {
 	case 0x300:
 	case 0x380:
 		printk(KERN_ALERT "Unable to handle kernel paging request for "
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message
  2018-01-12  2:28 ` [PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message Benjamin Herrenschmidt
@ 2018-01-16  0:59   ` Stewart Smith
  0 siblings, 0 replies; 9+ messages in thread
From: Stewart Smith @ 2018-01-16  0:59 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev

Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> This message isn't terribly useful.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>

> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -127,7 +127,7 @@ int __init early_init_dt_scan_opal(unsigned long node,
>
>  	if (of_flat_dt_is_compatible(node, "ibm,opal-v3")) {
>  		powerpc_firmware_features |= FW_FEATURE_OPAL;
> -		pr_info("OPAL detected !\n");
> +		pr_debug("OPAL detected !\n");

I've been meaning to add in a thing to grab the version from the device
tree and print that too.

-- 
Stewart Smith
OPAL Architect, IBM.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [1/5] powerpc/xive: Remove incorrect debug code
  2018-01-12  2:28 [PATCH 1/5] powerpc/xive: Remove incorrect debug code Benjamin Herrenschmidt
                   ` (3 preceding siblings ...)
  2018-01-12  2:28 ` [PATCH 5/5] powerpc: Use the TRAP macro whenever comparing a trap number Benjamin Herrenschmidt
@ 2018-01-17 13:30 ` Michael Ellerman
  4 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev

On Fri, 2018-01-12 at 02:28:45 UTC, Benjamin Herrenschmidt wrote:
> WORD2 if the TIMA isn't byte accessible and
> isn't that useful to know about, take out the
> pr_devel statement.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f5abe14f88e8259494d69614768789

cheers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [4/5] powerpc: Remove useless EXC_COMMON_HV
  2018-01-12  2:28 ` [PATCH 4/5] powerpc: Remove useless EXC_COMMON_HV Benjamin Herrenschmidt
@ 2018-01-17 13:30   ` Michael Ellerman
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev

On Fri, 2018-01-12 at 02:28:48 UTC, Benjamin Herrenschmidt wrote:
> The only difference between EXC_COMMON_HV and EXC_COMMON is that the
> former adds "2" to the trap number which is supposed to represent the
> fact that this is an "HV" interrupt which uses HSRR0/1.
> 
> However KVM is the only one who cares and it has its own separate macros.
> 
> In fact, we only have one user of EXC_COMMON_HV and it's for an
> unknown interrupt case. All the other ones already using EXC_COMMON.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/872e2ae4bdd4c244f7617ffc08c394

cheers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [5/5] powerpc: Use the TRAP macro whenever comparing a trap number
  2018-01-12  2:28 ` [PATCH 5/5] powerpc: Use the TRAP macro whenever comparing a trap number Benjamin Herrenschmidt
@ 2018-01-17 13:30   ` Michael Ellerman
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2018-01-17 13:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev

On Fri, 2018-01-12 at 02:28:49 UTC, Benjamin Herrenschmidt wrote:
> Trap numbers can have extra bits at the bottom that need to
> be filtered out. There are a few cases where we don't do that.
> 
> It's possible that we got lucky but better safe than sorry.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2271db20e4b362405bacc0e4095df4

cheers

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-17 13:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12  2:28 [PATCH 1/5] powerpc/xive: Remove incorrect debug code Benjamin Herrenschmidt
2018-01-12  2:28 ` [PATCH 2/5] powerpc: Remove DEBUG define in 64-bit early setup code Benjamin Herrenschmidt
2018-01-12  2:28 ` [PATCH 3/5] powerpc: Reduce log level of "OPAL detected !" message Benjamin Herrenschmidt
2018-01-16  0:59   ` Stewart Smith
2018-01-12  2:28 ` [PATCH 4/5] powerpc: Remove useless EXC_COMMON_HV Benjamin Herrenschmidt
2018-01-17 13:30   ` [4/5] " Michael Ellerman
2018-01-12  2:28 ` [PATCH 5/5] powerpc: Use the TRAP macro whenever comparing a trap number Benjamin Herrenschmidt
2018-01-17 13:30   ` [5/5] " Michael Ellerman
2018-01-17 13:30 ` [1/5] powerpc/xive: Remove incorrect debug code Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.