SPARC currently returns L1 data cache line size (as low as 32 bytes on
some systems) though L2 and L3 cache line sizes may be higher. As
cache_line_size() is used by code to align memory requests to prevent
unnecessary cache line sharing, this patch returns the max of L2 and L3
sizes, currently 64 bytes.
OraBug:
26045057
Signed-off-by: Chris Hyser <chris.hyser@oracle.com>
Reviewed-by: Rob Gardner <rob.gardner@oracle.com>
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
config NEED_PER_CPU_PAGE_FIRST_CHUNK
def_bool y if SPARC64
+config ARCH_HAS_CACHE_LINE_SIZE
+ def_bool y if SPARC64
+
config MMU
bool
default y
#define L1_CACHE_SHIFT 5
#define L1_CACHE_BYTES 32
+#ifdef CONFIG_ARCH_HAS_CACHE_LINE_SIZE
+#define cache_line_size() max(local_cpu_data().l3_cache_line_size, \
+ local_cpu_data().ecache_line_size)
+#endif
+
#ifdef CONFIG_SPARC32
#define SMP_CACHE_BYTES_SHIFT 5
#else