Commit 67484e0d authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/lib/sstep: Use l1_dcache_bytes() instead of opencoding

Don't opencode dcache size retrieval based on whether that's ppc32 or ppc64.

Use l1_dcache_bytes()
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/6c608fd4795e2d8ea1a0a449405a0087f76d8bb3.1642752375.git.christophe.leroy@csgroup.eu
parent 9d44d1bd
...@@ -1065,14 +1065,11 @@ static int __emulate_dcbz(unsigned long ea) ...@@ -1065,14 +1065,11 @@ static int __emulate_dcbz(unsigned long ea)
int emulate_dcbz(unsigned long ea, struct pt_regs *regs) int emulate_dcbz(unsigned long ea, struct pt_regs *regs)
{ {
int err; int err;
unsigned long size; unsigned long size = l1_dcache_bytes();
#ifdef __powerpc64__ #ifdef __powerpc64__
size = ppc64_caches.l1d.block_size;
if (!(regs->msr & MSR_64BIT)) if (!(regs->msr & MSR_64BIT))
ea &= 0xffffffffUL; ea &= 0xffffffffUL;
#else
size = L1_CACHE_BYTES;
#endif #endif
ea &= ~(size - 1); ea &= ~(size - 1);
if (!address_ok(regs, ea, size)) if (!address_ok(regs, ea, size))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment