linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
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>,
	Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Subject: [PATCH v2 16/16] powerpc/64s/exception: machine check improve labels and comments
Date: Thu, 11 Jul 2019 01:19:50 +1000	[thread overview]
Message-ID: <20190710151950.31906-17-npiggin@gmail.com> (raw)
In-Reply-To: <20190710151950.31906-1-npiggin@gmail.com>

Short forward and backward branches can be given number labels,
but larger significant divergences in code path a more readable
if they're given descriptive names.

Also adjusts a comment to account for guest delivery.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/exceptions-64s.S | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index d196558d4243..a69f4599e304 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1052,7 +1052,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
 	 */
 	lbz	r11,HSTATE_IN_GUEST(r13)
 	cmpwi	r11,0			/* Check if coming from guest */
-	bne	9f			/* continue if we are. */
+	bne	mce_deliver		/* continue if we are. */
 #endif
 
 	/*
@@ -1060,7 +1060,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
 	 * exception handler which will deliver the MC event to this kernel.
 	 */
 	andi.	r11,r12,MSR_PR		/* See if coming from user. */
-	bne	9f			/* continue in V mode if we are. */
+	bne	mce_deliver		/* continue in V mode if we are. */
 
 	/*
 	 * At this point we are coming from kernel context.
@@ -1088,8 +1088,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
 	MACHINE_CHECK_HANDLER_WINDUP
 	RFI_TO_KERNEL
 
-9:
-	/* Deliver the machine check to host kernel in V mode. */
+mce_deliver:
+	/*
+	 * This is a host user or guest MCE. Restore all registers, then
+	 * run the "late" handler. For host user, this will run the
+	 * machine_check_exception handler in virtual mode like a normal
+	 * interrupt handler. For guest, this will trigger the KVM test
+	 * and branch to the KVM interrupt similarly to other interrupts.
+	 */
 BEGIN_FTR_SECTION
 	ld	r10,ORIG_GPR3(r1)
 	mtspr	SPRN_CFAR,r10
-- 
2.20.1


      parent reply	other threads:[~2019-07-10 16:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 15:19 [PATCH v2 00/16] powerpc/64s: machine check cleanup series Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 01/16] powerpc/64s/exception: machine check fwnmi remove HV case Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 02/16] powerpc/64s/exception: machine check remove bitrotted comment Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 03/16] powerpc/64s/exception: machine check fix KVM guest test Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 04/16] powerpc/64s/exception: machine check adjust RFI target Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 05/16] powerpc/64s/exception: machine check pseries should always run the early handler Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 06/16] powerpc/64s/exception: machine check remove machine_check_pSeries_0 branch Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 07/16] powerpc/64s/exception: machine check use correct cfar for late handler Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 08/16] powerpc/64s/powernv: machine check dump SLB contents Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 09/16] powerpc/64s/pseries: machine check convert to use common event code Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 10/16] powerpc/64s/exception: machine check pseries should skip the late handler for host kernel MCEs Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 11/16] powerpc/64s/exception: machine check restructure to reuse common macros Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 12/16] powerpc/64s/exception: machine check move tramp code Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 13/16] powerpc/64s/exception: simplify machine check early path Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 14/16] powerpc/64s/exception: machine check move unrecoverable handling out of line Nicholas Piggin
2019-07-10 15:19 ` [PATCH v2 15/16] powerpc/64s/exception: untangle early machine check handler branch Nicholas Piggin
2019-07-10 15:19 ` Nicholas Piggin [this message]

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=20190710151950.31906-17-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=aravinda@linux.vnet.ibm.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).