* [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc
@ 2013-08-15 5:22 Michael Ellerman
2013-08-15 5:22 ` [PATCH 2/6] powerpc/pseries: Add a warning in the case of cross-cpu VPA registration Michael Ellerman
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Michael Ellerman @ 2013-08-15 5:22 UTC (permalink / raw)
To: linuxppc-dev
People have been dropping things in here without updating the index, do
it for them.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
Documentation/powerpc/00-INDEX | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX
index 05026ce..6db73df 100644
--- a/Documentation/powerpc/00-INDEX
+++ b/Documentation/powerpc/00-INDEX
@@ -5,13 +5,20 @@ please mail me.
00-INDEX
- this file
+bootwrapper.txt
+ - Information on how the powerpc kernel is wrapped for boot on various
+ different platforms.
cpu_features.txt
- info on how we support a variety of CPUs with minimal compile-time
options.
eeh-pci-error-recovery.txt
- info on PCI Bus EEH Error Recovery
+firmware-assisted-dump.txt
+ - Documentation on the firmware assisted dump mechanism "fadump".
hvcs.txt
- IBM "Hypervisor Virtual Console Server" Installation Guide
+kvm_440.txt
+ - Various notes on the implementation of KVM for PowerPC 440.
mpc52xx.txt
- Linux 2.6.x on MPC52xx family
pmu-ebb.txt
@@ -19,3 +26,7 @@ pmu-ebb.txt
qe_firmware.txt
- describes the layout of firmware binaries for the Freescale QUICC
Engine and the code that parses and uploads the microcode therein.
+ptrace.txt
+ - Information on the ptrace interfaces for hardware debug registers.
+transactional_memory.txt
+ - Overview of the Power8 transactional memory support.
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/6] powerpc/pseries: Add a warning in the case of cross-cpu VPA registration
2013-08-15 5:22 [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc Michael Ellerman
@ 2013-08-15 5:22 ` Michael Ellerman
2013-08-15 5:22 ` [PATCH 3/6] powerpc: Add more trap names to xmon Michael Ellerman
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2013-08-15 5:22 UTC (permalink / raw)
To: linuxppc-dev
The spec says it "may be problematic" if CPU x registers the VPA of
CPU y. Add a warning in case we ever do that.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/lpar.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8bad880..73d6c1b 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -68,6 +68,12 @@ void vpa_init(int cpu)
struct paca_struct *pp;
struct dtl_entry *dtl;
+ /*
+ * The spec says it "may be problematic" if CPU x registers the VPA of
+ * CPU y. We should never do that, but wail if we ever do.
+ */
+ WARN_ON(cpu != smp_processor_id());
+
if (cpu_has_feature(CPU_FTR_ALTIVEC))
lppaca_of(cpu).vmxregs_in_use = 1;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/6] powerpc: Add more trap names to xmon
2013-08-15 5:22 [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc Michael Ellerman
2013-08-15 5:22 ` [PATCH 2/6] powerpc/pseries: Add a warning in the case of cross-cpu VPA registration Michael Ellerman
@ 2013-08-15 5:22 ` Michael Ellerman
2013-08-20 10:52 ` Paul Mackerras
2013-08-15 5:22 ` [PATCH 4/6] powerpc: Fix location and rename exception trampolines Michael Ellerman
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2013-08-15 5:22 UTC (permalink / raw)
To: linuxppc-dev
We haven't updated these for a while it seems, it's nice to have in the
oops output.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/xmon/xmon.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 96bf5bd..9f3655b 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1256,11 +1256,18 @@ const char *getvecname(unsigned long vec)
case 0x700: ret = "(Program Check)"; break;
case 0x800: ret = "(FPU Unavailable)"; break;
case 0x900: ret = "(Decrementer)"; break;
+ case 0x980: ret = "(Hypervisor Decrementer)"; break;
+ case 0xa00: ret = "(Doorbell)"; break;
case 0xc00: ret = "(System Call)"; break;
case 0xd00: ret = "(Single Step)"; break;
+ case 0xe40: ret = "(Emulation Assist)"; break;
+ case 0xe60: ret = "(HMI)"; break;
+ case 0xe80: ret = "(Hypervisor Doorbell)"; break;
case 0xf00: ret = "(Performance Monitor)"; break;
case 0xf20: ret = "(Altivec Unavailable)"; break;
case 0x1300: ret = "(Instruction Breakpoint)"; break;
+ case 0x1500: ret = "(Denormalisation)"; break;
+ case 0x1700: ret = "(Altivec Assist)"; break;
default: ret = "";
}
return ret;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/6] powerpc: Fix location and rename exception trampolines
2013-08-15 5:22 [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc Michael Ellerman
2013-08-15 5:22 ` [PATCH 2/6] powerpc/pseries: Add a warning in the case of cross-cpu VPA registration Michael Ellerman
2013-08-15 5:22 ` [PATCH 3/6] powerpc: Add more trap names to xmon Michael Ellerman
@ 2013-08-15 5:22 ` Michael Ellerman
2013-08-15 5:22 ` [PATCH 5/6] powerpc: Add more exception trampolines for hypervisor exceptions Michael Ellerman
2013-08-15 5:22 ` [PATCH 6/6] powerpc: Skip emulating & leave interrupts off for kernel program checks Michael Ellerman
4 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2013-08-15 5:22 UTC (permalink / raw)
To: linuxppc-dev
The symbols that name some of our exception trampolines are ahead of the
location they name. In most cases this is OK because the code is tightly
packed, but in some cases it means the symbol floats ahead of the
correct location, eg:
c000000000000ea0 <performance_monitor_pSeries_1>:
...
c000000000000f00: 7d b2 43 a6 mtsprg 2,r13
Fix them all by moving the symbol after the set of the location.
While we're moving them anyway, rename them to loose the camelcase and
to make it clear that they are trampolines.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/exceptions-64s.S | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 902ca3c..ae902cae 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -323,32 +323,32 @@ hv_exception_trampoline:
* prolog code of the PerformanceMonitor one. A little
* trickery is thus necessary
*/
-performance_monitor_pSeries_1:
. = 0xf00
+performance_monitor_pseries_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b performance_monitor_pSeries
-altivec_unavailable_pSeries_1:
. = 0xf20
+altivec_unavailable_pseries_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b altivec_unavailable_pSeries
-vsx_unavailable_pSeries_1:
. = 0xf40
+vsx_unavailable_pseries_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b vsx_unavailable_pSeries
-facility_unavailable_trampoline:
. = 0xf60
+facility_unavailable_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b facility_unavailable_pSeries
-hv_facility_unavailable_trampoline:
. = 0xf80
+hv_facility_unavailable_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b facility_unavailable_hv
@@ -820,32 +820,32 @@ system_call_relon_pSeries:
EXCEPTION_PROLOG_0(PACA_EXGEN)
b h_doorbell_relon_hv
-performance_monitor_relon_pSeries_1:
. = 0x4f00
+performance_monitor_relon_pseries_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b performance_monitor_relon_pSeries
-altivec_unavailable_relon_pSeries_1:
. = 0x4f20
+altivec_unavailable_relon_pseries_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b altivec_unavailable_relon_pSeries
-vsx_unavailable_relon_pSeries_1:
. = 0x4f40
+vsx_unavailable_relon_pseries_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b vsx_unavailable_relon_pSeries
-facility_unavailable_relon_trampoline:
. = 0x4f60
+facility_unavailable_relon_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b facility_unavailable_relon_pSeries
-hv_facility_unavailable_relon_trampoline:
. = 0x4f80
+hv_facility_unavailable_relon_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b hv_facility_unavailable_relon_hv
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/6] powerpc: Add more exception trampolines for hypervisor exceptions
2013-08-15 5:22 [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc Michael Ellerman
` (2 preceding siblings ...)
2013-08-15 5:22 ` [PATCH 4/6] powerpc: Fix location and rename exception trampolines Michael Ellerman
@ 2013-08-15 5:22 ` Michael Ellerman
2013-08-15 5:22 ` [PATCH 6/6] powerpc: Skip emulating & leave interrupts off for kernel program checks Michael Ellerman
4 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2013-08-15 5:22 UTC (permalink / raw)
To: linuxppc-dev
This makes back traces and profiles easier to read.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/exceptions-64s.S | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index ae902cae..e41f066 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -293,27 +293,31 @@ system_call_pSeries:
* out of line to handle them
*/
. = 0xe00
-hv_exception_trampoline:
+hv_data_storage_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b h_data_storage_hv
. = 0xe20
+hv_instr_storage_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b h_instr_storage_hv
. = 0xe40
+emulation_assist_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b emulation_assist_hv
. = 0xe60
+hv_exception_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b hmi_exception_hv
. = 0xe80
+hv_doorbell_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b h_doorbell_hv
@@ -808,6 +812,7 @@ system_call_relon_pSeries:
b . /* Can't happen, see v2.07 Book III-S section 6.5 */
. = 0x4e40
+emulation_assist_relon_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b emulation_assist_relon_hv
@@ -816,6 +821,7 @@ system_call_relon_pSeries:
b . /* Can't happen, see v2.07 Book III-S section 6.5 */
. = 0x4e80
+h_doorbell_relon_trampoline:
SET_SCRATCH0(r13)
EXCEPTION_PROLOG_0(PACA_EXGEN)
b h_doorbell_relon_hv
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/6] powerpc: Skip emulating & leave interrupts off for kernel program checks
2013-08-15 5:22 [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc Michael Ellerman
` (3 preceding siblings ...)
2013-08-15 5:22 ` [PATCH 5/6] powerpc: Add more exception trampolines for hypervisor exceptions Michael Ellerman
@ 2013-08-15 5:22 ` Michael Ellerman
4 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2013-08-15 5:22 UTC (permalink / raw)
To: linuxppc-dev
In the program check handler we handle some causes with interrupts off
and others with interrupts on.
We need to enable interrupts to handle the emulation cases, because they
access userspace memory and might sleep.
For faults in the kernel we don't want to do any emulation, and
emulate_instruction() enforces that. do_mathemu() doesn't but probably
should.
The other disadvantage of enabling interrupts for kernel faults is that
we may take another interrupt, and recurse. As seen below:
--- Exception: e40 at c000000000004ee0 performance_monitor_relon_pSeries_1
[link register ] c00000000000f858 .arch_local_irq_restore+0x38/0x90
[c000000fb185dc10] 0000000000000000 (unreliable)
[c000000fb185dc80] c0000000007d8558 .program_check_exception+0x298/0x2d0
[c000000fb185dd00] c000000000002f40 emulation_assist_common+0x140/0x180
--- Exception: e40 at c000000000004ee0 performance_monitor_relon_pSeries_1
[link register ] c00000000000f858 .arch_local_irq_restore+0x38/0x90
[c000000fb185dff0] 00000000008b9190 (unreliable)
[c000000fb185e060] c0000000007d8558 .program_check_exception+0x298/0x2d0
So avoid both problems by checking if the fault was in the kernel and
skipping the enable of interrupts and the emulation. Go straight to
delivering the SIGILL, which for kernel faults calls die() and so on,
dropping us in the debugger etc.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/traps.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index e435bc0..9515bde 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1116,6 +1116,16 @@ void __kprobes program_check_exception(struct pt_regs *regs)
}
#endif
+ /*
+ * If we took the program check in the kernel skip down to sending a
+ * SIGILL. The subsequent cases all relate to emulating instructions
+ * which we should only do for userspace. We also do not want to enable
+ * interrupts for kernel faults because that might lead to further
+ * faults, and loose the context of the original exception.
+ */
+ if (!user_mode(regs))
+ goto sigill;
+
/* We restore the interrupt state now */
if (!arch_irq_disabled_regs(regs))
local_irq_enable();
@@ -1168,6 +1178,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
}
}
+sigill:
if (reason & REASON_PRIVILEGED)
_exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
else
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/6] powerpc: Add more trap names to xmon
2013-08-15 5:22 ` [PATCH 3/6] powerpc: Add more trap names to xmon Michael Ellerman
@ 2013-08-20 10:52 ` Paul Mackerras
0 siblings, 0 replies; 7+ messages in thread
From: Paul Mackerras @ 2013-08-20 10:52 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Thu, Aug 15, 2013 at 03:22:16PM +1000, Michael Ellerman wrote:
> We haven't updated these for a while it seems, it's nice to have in the
> oops output.
I think you mean the xmon exception summary output, not the oops output...
Paul.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-20 10:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15 5:22 [PATCH 1/6] powerpc: Update the 00-Index in Documentation/powerpc Michael Ellerman
2013-08-15 5:22 ` [PATCH 2/6] powerpc/pseries: Add a warning in the case of cross-cpu VPA registration Michael Ellerman
2013-08-15 5:22 ` [PATCH 3/6] powerpc: Add more trap names to xmon Michael Ellerman
2013-08-20 10:52 ` Paul Mackerras
2013-08-15 5:22 ` [PATCH 4/6] powerpc: Fix location and rename exception trampolines Michael Ellerman
2013-08-15 5:22 ` [PATCH 5/6] powerpc: Add more exception trampolines for hypervisor exceptions Michael Ellerman
2013-08-15 5:22 ` [PATCH 6/6] powerpc: Skip emulating & leave interrupts off for kernel program checks Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).