From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH 08/14] powerpc/64s/exception: machine check pseries should skip the late handler for host kernel MCEs
Date: Wed, 3 Jul 2019 17:54:38 +1000 [thread overview]
Message-ID: <20190703075444.19005-9-npiggin@gmail.com> (raw)
In-Reply-To: <20190703075444.19005-1-npiggin@gmail.com>
The powernv machine check handler copes with taking a MCE from one of
three contexts, guest, host kernel, and host user. In each case the
early handler runs first on a special stack. Then:
- The guest case branches to the KVM interrupt handler (via standard
interrupt macros).
- The host user case will run the "late" handler which is like a
normal interrupt that runs in virtual mode and uses the regular
kernel stack.
- The host kernel case queues the event and schedules it for
processing with irq work.
The last case is important, it must not enable virtual memory because
the MMU state may not be set up to deal with that (e.g., SLB might be
clear), it must not use the regular kernel stack for similar reasons
(e.g., might be in OPAL with OPAL stack in r1), and the kernel does
not expect anything to touch its stack if interrupts are disabled.
The pseries handler does not do this queueing, but instead it always
runs the late handler for host MCEs, which has some of the same
problems.
Rather than special casing pseries, just have it follow what powernv
is doing and queue up these events.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/exceptions-64s.S | 22 ++--------------------
1 file changed, 2 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index f2c24a4ae723..ac7b5bb614d9 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1163,7 +1163,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
cmpdi r3,0 /* see if we handled MCE successfully */
beq 1b /* if !handled then panic */
-BEGIN_FTR_SECTION
+
/*
* Return from MC interrupt.
* Queue up the MCE event so that we can log it later, while
@@ -1172,18 +1172,7 @@ BEGIN_FTR_SECTION
bl machine_check_queue_event
MACHINE_CHECK_HANDLER_WINDUP
RFI_TO_KERNEL
-FTR_SECTION_ELSE
- /*
- * pSeries: Return from MC interrupt. Before that stay on emergency
- * stack and call machine_check_exception to log the MCE event.
- */
- LOAD_HANDLER(r10,mce_return)
- mtspr SPRN_SRR0,r10
- ld r10,PACAKMSR(r13)
- mtspr SPRN_SRR1,r10
- RFI_TO_KERNEL
- b .
-ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
+
9:
/* Deliver the machine check to host kernel in V mode. */
BEGIN_FTR_SECTION
@@ -1212,13 +1201,6 @@ EXC_COMMON_BEGIN(unrecover_mce)
bl unrecoverable_exception
b 1b
-EXC_COMMON_BEGIN(mce_return)
- /* Invoke machine_check_exception to print MCE event and return. */
- addi r3,r1,STACK_FRAME_OVERHEAD
- bl machine_check_exception
- MACHINE_CHECK_HANDLER_WINDUP
- RFI_TO_KERNEL
- b .
EXC_REAL_BEGIN(data_access, 0x300, 0x80)
EXCEPTION_PROLOG_0 PACA_EXGEN
--
2.20.1
next prev parent reply other threads:[~2019-07-03 8:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 7:54 [PATCH 00/14] powerpc/64s/exception: machine check cleanup series Nicholas Piggin
2019-07-03 7:54 ` [PATCH 01/14] powerpc/64s/exception: machine check fwnmi remove HV case Nicholas Piggin
2019-07-03 7:54 ` [PATCH 02/14] powerpc/64s/exception: machine check remove bitrotted comment Nicholas Piggin
2019-07-03 7:54 ` [PATCH 03/14] powerpc/64s/exception: machine check fix KVM guest test Nicholas Piggin
2019-07-03 7:54 ` [PATCH 04/14] powerpc/64s/exception: machine check adjust RFI target Nicholas Piggin
2019-07-03 7:54 ` [PATCH 05/14] powerpc/64s/exception: machine check pseries should always run the early handler Nicholas Piggin
2019-07-03 7:54 ` [PATCH 06/14] powerpc/64s/exception: machine check remove machine_check_pSeries_0 branch Nicholas Piggin
2019-07-03 7:54 ` [PATCH 07/14] powerpc/64s/exception: machine check use correct cfar for late handler Nicholas Piggin
2019-07-03 7:54 ` Nicholas Piggin [this message]
2019-07-03 7:54 ` [PATCH 09/14] powerpc/64s/exception: machine check restructure to reuse common macros Nicholas Piggin
2019-07-03 7:54 ` [PATCH 10/14] powerpc/64s/exception: machine check move tramp code Nicholas Piggin
2019-07-03 7:54 ` [PATCH 11/14] powerpc/64s/exception: simplify machine check early path Nicholas Piggin
2019-07-03 7:54 ` [PATCH 12/14] powerpc/64s/exception: machine check move unrecoverable handling out of line Nicholas Piggin
2019-07-03 7:54 ` [PATCH 13/14] powerpc/64s/exception: untangle early machine check handler branch Nicholas Piggin
2019-07-03 7:54 ` [PATCH 14/14] powerpc/64s/exception: machine check improve labels and comments Nicholas Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190703075444.19005-9-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).