From 2d5320a818e2dc212c2ebece02fd80fcdfa8e563 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Tue, 27 Feb 2018 04:38:27 +0000 Subject: [PATCH] Increase the size of a reservation granule for TLB locks A reservation granule on PowerPC is a cache line. On e500mc and derivatives a cacheline size is 64 bytes, not 32. Allocate the maximum size permitted, but only utilize the size that is needed. On e500v1 and e500v2 the reservation granule will still be 32 bytes. --- sys/powerpc/booke/booke_machdep.c | 2 +- sys/powerpc/booke/trap_subr.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/booke/booke_machdep.c b/sys/powerpc/booke/booke_machdep.c index 103c18c14b2..c49e335f7a6 100644 --- a/sys/powerpc/booke/booke_machdep.c +++ b/sys/powerpc/booke/booke_machdep.c @@ -372,7 +372,7 @@ booke_init(u_long arg1, u_long arg2) return (ret); } -#define RES_GRANULE 32 +#define RES_GRANULE cacheline_size extern uintptr_t tlb0_miss_locks[]; /* Initialise a struct pcpu. */ diff --git a/sys/powerpc/booke/trap_subr.S b/sys/powerpc/booke/trap_subr.S index 55564adbd24..92ce1ebaa3a 100644 --- a/sys/powerpc/booke/trap_subr.S +++ b/sys/powerpc/booke/trap_subr.S @@ -82,7 +82,7 @@ /* Get the per-CPU data structure */ #define GET_CPUINFO(r) mfsprg0 r -#define RES_GRANULE 32 +#define RES_GRANULE 64 #define RES_LOCK 0 /* offset to the 'lock' word */ #ifdef __powerpc64__ #define RES_RECURSE 8 /* offset to the 'recurse' word */