[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <79fa9cfeefc699b21f500c53279098b66275e2bb.1581522136.git.michal.simek@xilinx.com>
Date: Wed, 12 Feb 2020 16:42:27 +0100
From: Michal Simek <michal.simek@...inx.com>
To: linux-kernel@...r.kernel.org, monstr@...str.eu,
michal.simek@...inx.com, git@...inx.com, arnd@...db.de
Cc: Stefan Asserhall <stefan.asserhall@...inx.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH 5/7] microblaze: Remove disabling IRQ while pte_update() run
From: Stefan Asserhall <stefan.asserhall@...inx.com>
There is no need to disable local IRQ for pte update. Use exclusive
load/store instruction for it.
Signed-off-by: Stefan Asserhall <stefan.asserhall@...inx.com>
Signed-off-by: Michal Simek <michal.simek@...inx.com>
---
arch/microblaze/include/asm/pgtable.h | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index 45b30878fc17..cf1e3095514b 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -372,20 +372,19 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
static inline unsigned long pte_update(pte_t *p, unsigned long clr,
unsigned long set)
{
- unsigned long flags, old, tmp;
-
- raw_local_irq_save(flags);
-
- __asm__ __volatile__( "lw %0, %2, r0 \n"
- "andn %1, %0, %3 \n"
- "or %1, %1, %4 \n"
- "sw %1, %2, r0 \n"
+ unsigned long old, tmp;
+
+ __asm__ __volatile__(
+ "1: lwx %0, %2, r0;\n"
+ " andn %1, %0, %3;\n"
+ " or %1, %1, %4;\n"
+ " swx %1, %2, r0;\n"
+ " addic %1, r0, 0;\n"
+ " bnei %1, 1b;\n"
: "=&r" (old), "=&r" (tmp)
: "r" ((unsigned long)(p + 1) - 4), "r" (clr), "r" (set)
: "cc");
- raw_local_irq_restore(flags);
-
return old;
}
--
2.25.0
Powered by blists - more mailing lists