MIPS: mipsregs.h: Make read_c0_prid use const accessor

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/6538953f1e1f8001efde1cee8eb61f5ef8ec7b5d
Commit:     6538953f1e1f8001efde1cee8eb61f5ef8ec7b5d
Parent:     cd1e0737efcaa0889810216cb01017d97f83c5e0
Refname:    refs/heads/master
Author:     James Hogan <[email protected]>
AuthorDate: Mon Dec 11 16:13:15 2017 +0000
Committer:  James Hogan <[email protected]>
CommitDate: Tue Jan 9 22:26:45 2018 +0000

    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 <[email protected]>
    Signed-off-by: James Hogan <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: Maciej W. Rozycki <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/17923/
---
 arch/mips/include/asm/mipsregs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 9c409f2d89e6..7a59ad6e7f7d 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -1558,7 +1558,7 @@ do {									\
 #define read_c0_epc()		__read_ulong_c0_register($14, 0)
 #define write_c0_epc(val)	__write_ulong_c0_register($14, 0, val)
 
-#define read_c0_prid()		__read_32bit_c0_register($15, 0)
+#define read_c0_prid()		__read_const_32bit_c0_register($15, 0)
 
 #define read_c0_cmgcrbase()	__read_ulong_c0_register($15, 3)
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.