[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1606145980-5153-2-git-send-email-guoren@kernel.org>
Date:   Mon, 23 Nov 2020 15:39:40 +0000
From:   guoren@...nel.org
To:     palmerdabbelt@...gle.com, paul.walmsley@...ive.com,
        anup@...infault.org, greentime.hu@...ive.com, zong.li@...ive.com,
        atish.patra@....com
Cc:     linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
        guoren@...nel.org, Guo Ren <guoren@...ux.alibaba.com>,
        Palmer Dabbelt <palmer@...ive.com>,
        Vincent Chen <vincent.chen@...ive.com>
Subject: [PATCH 2/2] riscv: Fixup trace_hardirqs_on in entry.S
From: Guo Ren <guoren@...ux.alibaba.com>
Move trace_hardirqs_on to correct place. If SR_PIE isn't set, the
trace_hardirqs_on will cause wrong record.
Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
Cc: Palmer Dabbelt <palmer@...ive.com>
Cc: Vincent Chen <vincent.chen@...ive.com>
---
 arch/riscv/kernel/entry.S | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index 7a1a6bb..c1b38e2 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -124,17 +124,17 @@ skip_context_tracking:
 	REG_L a1, (a1)
 	jr a1
 1:
-#ifdef CONFIG_TRACE_IRQFLAGS
-	call trace_hardirqs_on
-
-	REG_L s1, PT_STATUS(sp)
-#endif
 	/*
 	 * Exceptions run with interrupts enabled or disabled depending on the
 	 * state of SR_PIE in m/sstatus.
 	 */
 	andi t0, s1, SR_PIE
 	beqz t0, 1f
+#ifdef CONFIG_TRACE_IRQFLAGS
+	call trace_hardirqs_on
+
+	REG_L s1, PT_STATUS(sp)
+#endif
 	csrs CSR_STATUS, SR_IE
 
 1:
-- 
2.7.4
Powered by blists - more mailing lists
 
