Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 7502/1: contextidr: avoid using bfi instruction during notifier

The bfi instruction is not available on ARMv6, so instead use an and/orr
sequence in the contextidr_notifier. This gets rid of the assembler
error:

Assembler messages:
Error: selected processor does not support ARM mode `bfi r3,r2,#0,#8'

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Will Deacon and committed by
Russell King
ae3790b8 dbece458

+4 -3
+4 -3
arch/arm/mm/context.c
··· 63 63 pid = task_pid_nr(thread->task) << ASID_BITS; 64 64 asm volatile( 65 65 " mrc p15, 0, %0, c13, c0, 1\n" 66 - " bfi %1, %0, #0, %2\n" 67 - " mcr p15, 0, %1, c13, c0, 1\n" 66 + " and %0, %0, %2\n" 67 + " orr %0, %0, %1\n" 68 + " mcr p15, 0, %0, c13, c0, 1\n" 68 69 : "=r" (contextidr), "+r" (pid) 69 - : "I" (ASID_BITS)); 70 + : "I" (~ASID_MASK)); 70 71 isb(); 71 72 72 73 return NOTIFY_OK;