linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH RT] powerpc: Fixup compile and lazy-preempt
Date: Tue, 3 Dec 2019 18:37:43 +0100	[thread overview]
Message-ID: <20191203173743.5mjvmhqfccdhwaon@linutronix.de> (raw)

Since the softirq rework 32bit POWER does not compile because
get_current() is not provided - just the `current' macro.
Use the `current' instead.

Since the v5.2-RT series, the lazy-preempt code is broken. It loads the
lazy-counter and flags from the R9 but R2 should be used.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/powerpc/kernel/entry_32.S | 4 ++--
 include/linux/preempt.h        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index d37b373104502..004944258387b 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -893,10 +893,10 @@ user_exc_return:		/* r10 contains MSR_KERNEL here */
 	bne	restore_kuap
 	andi.	r8,r8,_TIF_NEED_RESCHED
 	bne+	1f
-	lwz	r0,TI_PREEMPT_LAZY(r9)
+	lwz	r0,TI_PREEMPT_LAZY(r2)
 	cmpwi	0,r0,0          /* if non-zero, just restore regs and return */
 	bne	restore_kuap
-	lwz	r0,TI_FLAGS(r9)
+	lwz	r0,TI_FLAGS(r2)
 	andi.	r0,r0,_TIF_NEED_RESCHED_LAZY
 	beq+	restore_kuap
 1:
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index d559e3a0379c2..7653dd58b4b21 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -100,9 +100,9 @@
 				   (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))
 #ifdef CONFIG_PREEMPT_RT_FULL
 
-#define softirq_count()		((long)get_current()->softirq_count)
+#define softirq_count()		(current->softirq_count)
 #define in_softirq()		(softirq_count())
-#define in_serving_softirq()	(get_current()->softirq_count & SOFTIRQ_OFFSET)
+#define in_serving_softirq()	(current->softirq_count & SOFTIRQ_OFFSET)
 
 #else
 
-- 
2.24.0


                 reply	other threads:[~2019-12-03 17:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20191203173743.5mjvmhqfccdhwaon@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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).