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

Configure Feed

Select the types of activity you want to include in your feed.

riscv: Add xmipsexectl instructions

Add xmipsexectl instruction opcodes. This includes the MIPS.PAUSE,
MIPS.EHB, and MIPS.IHB instructions.

Signed-off-by: Aleksa Paunovic <aleksa.paunovic@htecgroup.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20250724-p8700-pause-v5-3-a6cbbe1c3412@htecgroup.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>

authored by

Aleksa Paunovic and committed by
Paul Walmsley
1d4ce63e a8fed1bc

+19
+19
arch/riscv/include/asm/vendor_extensions/mips.h
··· 15 15 extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_mips; 16 16 #endif 17 17 18 + /* Extension specific instructions */ 19 + 20 + /* 21 + * All of the xmipsexectl extension instructions are 22 + * ‘hint’ encodings of the SLLI instruction, 23 + * with rd = 0, rs1 = 0 and imm = 1 for IHB, imm = 3 for EHB, 24 + * and imm = 5 for PAUSE. 25 + * MIPS.PAUSE is an alternative opcode which is implemented to have the 26 + * same behavior as PAUSE on some MIPS RISCV cores. 27 + * MIPS.EHB clears all execution hazards before allowing 28 + * any subsequent instructions to execute. 29 + * MIPS.IHB clears all instruction hazards before 30 + * allowing any subsequent instructions to fetch. 31 + */ 32 + 33 + #define MIPS_PAUSE ".4byte 0x00501013\n\t" 34 + #define MIPS_EHB ".4byte 0x00301013\n\t" 35 + #define MIPS_IHB ".4byte 0x00101013\n\t" 36 + 18 37 #endif // _ASM_RISCV_VENDOR_EXTENSIONS_MIPS_H