Skip to content

Commit d3eabf2

Browse files
ConchuODpalmer-dabbelt
authored andcommitted
RISC-V: capitalise CMO op macros
The CMO op macros initially used lower case, as the original iteration of the ALT_CMO_OP alternative stringified the first parameter to finalise the assembly for the standard variant. As a knock-on, the T-Head versions of these CMOs had to use mixed case defines. Commit dd23e95 ("RISC-V: replace cbom instructions with an insn-def") removed the asm construction with stringify, replacing it an insn-def macro, rending the lower-case surplus to requirements. As far as I can tell from a brief check, CBO_zero does not see similar use and didn't require the mixed case define in the first place. Replace the lower case characters now for consistency with other insn-def macros in the standard and T-Head forms, and adjust the callsites. Suggested-by: Andrew Jones <[email protected]> Signed-off-by: Conor Dooley <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Link: https://lore.kernel.org/r/20230915-aloe-dollar-994937477776@spud Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent c20d36c commit d3eabf2

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

arch/riscv/include/asm/errata_list.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ asm volatile(ALTERNATIVE( \
117117
* | 31 - 25 | 24 - 20 | 19 - 15 | 14 - 12 | 11 - 7 | 6 - 0 |
118118
* 0000000 11001 00000 000 00000 0001011
119119
*/
120-
#define THEAD_inval_A0 ".long 0x0265000b"
121-
#define THEAD_clean_A0 ".long 0x0255000b"
122-
#define THEAD_flush_A0 ".long 0x0275000b"
120+
#define THEAD_INVAL_A0 ".long 0x0265000b"
121+
#define THEAD_CLEAN_A0 ".long 0x0255000b"
122+
#define THEAD_FLUSH_A0 ".long 0x0275000b"
123123
#define THEAD_SYNC_S ".long 0x0190000b"
124124

125125
#define ALT_CMO_OP(_op, _start, _size, _cachesize) \

arch/riscv/include/asm/insn-def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,19 @@
180180
INSN_R(OPCODE_SYSTEM, FUNC3(0), FUNC7(51), \
181181
__RD(0), RS1(gaddr), RS2(vmid))
182182

183-
#define CBO_inval(base) \
183+
#define CBO_INVAL(base) \
184184
INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \
185185
RS1(base), SIMM12(0))
186186

187-
#define CBO_clean(base) \
187+
#define CBO_CLEAN(base) \
188188
INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \
189189
RS1(base), SIMM12(1))
190190

191-
#define CBO_flush(base) \
191+
#define CBO_FLUSH(base) \
192192
INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \
193193
RS1(base), SIMM12(2))
194194

195-
#define CBO_zero(base) \
195+
#define CBO_ZERO(base) \
196196
INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \
197197
RS1(base), SIMM12(4))
198198

arch/riscv/lib/clear_page.S

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,41 @@ SYM_FUNC_START(clear_page)
2929
lw a1, riscv_cboz_block_size
3030
add a2, a0, a2
3131
.Lzero_loop:
32-
CBO_zero(a0)
32+
CBO_ZERO(a0)
3333
add a0, a0, a1
3434
CBOZ_ALT(11, "bltu a0, a2, .Lzero_loop; ret", "nop; nop")
35-
CBO_zero(a0)
35+
CBO_ZERO(a0)
3636
add a0, a0, a1
3737
CBOZ_ALT(10, "bltu a0, a2, .Lzero_loop; ret", "nop; nop")
38-
CBO_zero(a0)
38+
CBO_ZERO(a0)
3939
add a0, a0, a1
40-
CBO_zero(a0)
40+
CBO_ZERO(a0)
4141
add a0, a0, a1
4242
CBOZ_ALT(9, "bltu a0, a2, .Lzero_loop; ret", "nop; nop")
43-
CBO_zero(a0)
43+
CBO_ZERO(a0)
4444
add a0, a0, a1
45-
CBO_zero(a0)
45+
CBO_ZERO(a0)
4646
add a0, a0, a1
47-
CBO_zero(a0)
47+
CBO_ZERO(a0)
4848
add a0, a0, a1
49-
CBO_zero(a0)
49+
CBO_ZERO(a0)
5050
add a0, a0, a1
5151
CBOZ_ALT(8, "bltu a0, a2, .Lzero_loop; ret", "nop; nop")
52-
CBO_zero(a0)
52+
CBO_ZERO(a0)
5353
add a0, a0, a1
54-
CBO_zero(a0)
54+
CBO_ZERO(a0)
5555
add a0, a0, a1
56-
CBO_zero(a0)
56+
CBO_ZERO(a0)
5757
add a0, a0, a1
58-
CBO_zero(a0)
58+
CBO_ZERO(a0)
5959
add a0, a0, a1
60-
CBO_zero(a0)
60+
CBO_ZERO(a0)
6161
add a0, a0, a1
62-
CBO_zero(a0)
62+
CBO_ZERO(a0)
6363
add a0, a0, a1
64-
CBO_zero(a0)
64+
CBO_ZERO(a0)
6565
add a0, a0, a1
66-
CBO_zero(a0)
66+
CBO_ZERO(a0)
6767
add a0, a0, a1
6868
bltu a0, a2, .Lzero_loop
6969
ret

arch/riscv/mm/dma-noncoherent.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static inline void arch_dma_cache_wback(phys_addr_t paddr, size_t size)
3131
return;
3232
}
3333
#endif
34-
ALT_CMO_OP(clean, vaddr, size, riscv_cbom_block_size);
34+
ALT_CMO_OP(CLEAN, vaddr, size, riscv_cbom_block_size);
3535
}
3636

3737
static inline void arch_dma_cache_inv(phys_addr_t paddr, size_t size)
@@ -45,7 +45,7 @@ static inline void arch_dma_cache_inv(phys_addr_t paddr, size_t size)
4545
}
4646
#endif
4747

48-
ALT_CMO_OP(inval, vaddr, size, riscv_cbom_block_size);
48+
ALT_CMO_OP(INVAL, vaddr, size, riscv_cbom_block_size);
4949
}
5050

5151
static inline void arch_dma_cache_wback_inv(phys_addr_t paddr, size_t size)
@@ -59,7 +59,7 @@ static inline void arch_dma_cache_wback_inv(phys_addr_t paddr, size_t size)
5959
}
6060
#endif
6161

62-
ALT_CMO_OP(flush, vaddr, size, riscv_cbom_block_size);
62+
ALT_CMO_OP(FLUSH, vaddr, size, riscv_cbom_block_size);
6363
}
6464

6565
static inline bool arch_sync_dma_clean_before_fromdevice(void)
@@ -131,7 +131,7 @@ void arch_dma_prep_coherent(struct page *page, size_t size)
131131
}
132132
#endif
133133

134-
ALT_CMO_OP(flush, flush_addr, size, riscv_cbom_block_size);
134+
ALT_CMO_OP(FLUSH, flush_addr, size, riscv_cbom_block_size);
135135
}
136136

137137
void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,

arch/riscv/mm/pmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void arch_wb_cache_pmem(void *addr, size_t size)
1717
return;
1818
}
1919
#endif
20-
ALT_CMO_OP(clean, addr, size, riscv_cbom_block_size);
20+
ALT_CMO_OP(CLEAN, addr, size, riscv_cbom_block_size);
2121
}
2222
EXPORT_SYMBOL_GPL(arch_wb_cache_pmem);
2323

@@ -29,6 +29,6 @@ void arch_invalidate_pmem(void *addr, size_t size)
2929
return;
3030
}
3131
#endif
32-
ALT_CMO_OP(inval, addr, size, riscv_cbom_block_size);
32+
ALT_CMO_OP(INVAL, addr, size, riscv_cbom_block_size);
3333
}
3434
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);

0 commit comments

Comments
 (0)