]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: mipsregs.h: Make read_c0_prid use const accessor
authorJames Hogan <jhogan@kernel.org>
Mon, 11 Dec 2017 16:13:15 +0000 (16:13 +0000)
committerJames Hogan <jhogan@kernel.org>
Tue, 9 Jan 2018 22:26:45 +0000 (22:26 +0000)
commit07cc775f176c80c43ba4a16a8f48ce5069441409
tree73ea2c6bd7bc68490a7ca21c821accb7a5d96dbe
parent141dd90ac6eea37c3ea0c217b0d56a310dc88d17
MIPS: mipsregs.h: Make read_c0_prid use const accessor

Make read_c0_prid() use the new constant accessor macros so that it can
potentially be optimised or removed by the compiler. This is
particularly important under virtualisation, where even with hardware
assisted virtualisation (VZ), access to the PRid register may need to be
emulated by the hypervisor.

In particular this helps eliminate the read of the PRid register in the
rather frequently called add_interrupt_randomness() (which calls into
arch/mips/include/asm/timex.h) when the prid is unused but the read
can't be removed due to the inline asm being marked __volatile__.

Reported-by: Yann LeDu <Yann.LeDu@imgtec.com>
Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17923/
arch/mips/include/asm/mipsregs.h