From 3bf6376a8235779418ca7ff352723e7ad8c68372 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 22 Jun 2010 17:42:38 +0000 Subject: Since our caches are snooping, we only need to broadcast cache invalidates on 88110 designs. Brings a ~8% speedup on GENERIC.MP on 197DP. --- sys/arch/m88k/include/cmmu.h | 26 ++++++++++++-------------- sys/arch/mvme88k/mvme88k/m197_machdep.c | 5 ++--- sys/arch/mvme88k/mvme88k/m88110.c | 25 +++++++++++++++---------- 3 files changed, 29 insertions(+), 27 deletions(-) (limited to 'sys') diff --git a/sys/arch/m88k/include/cmmu.h b/sys/arch/m88k/include/cmmu.h index 30968c4b944..62858f66fd7 100644 --- a/sys/arch/m88k/include/cmmu.h +++ b/sys/arch/m88k/include/cmmu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cmmu.h,v 1.22 2009/02/16 23:03:31 miod Exp $ */ +/* $OpenBSD: cmmu.h,v 1.23 2010/06/22 17:42:35 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -71,26 +71,24 @@ extern __cpu_simple_lock_t cmmu_cpu_lock; #define cmmu_init (cmmu->init) #define setup_board_config (cmmu->setup_board_config) -#define cpu_configuration_print(a) (cmmu->cpu_configuration_print)(a) +#define cpu_configuration_print(cpu) (cmmu->cpu_configuration_print)(cpu) #define cmmu_shutdown (cmmu->shutdown) #define cmmu_cpu_number (cmmu->cpu_number) -#define cmmu_set_sapr(a) (cmmu->set_sapr)(a) -#define cmmu_set_uapr(a) (cmmu->set_uapr)(a) -#define cmmu_flush_tlb(a, b, c, d) (cmmu->flush_tlb)(a, b, c, d) -#define cmmu_flush_cache(a, b, c) (cmmu->flush_cache)(a, b, c) -#define cmmu_flush_inst_cache(a, b, c) (cmmu->flush_inst_cache)(a, b, c) -#define dma_cachectl(a, b, c) (cmmu->dma_cachectl)(a, b, c) -#define dma_cachectl_local(a, b, c) (cmmu->dma_cachectl_local)(a, b, c) -#define cmmu_initialize_cpu(a) (cmmu->initialize_cpu)(a) +#define cmmu_set_sapr(apr) (cmmu->set_sapr)(apr) +#define cmmu_set_uapr(apr) (cmmu->set_uapr)(apr) +#define cmmu_flush_tlb(cpu, k, va, c) (cmmu->flush_tlb)(cpu, k, va, c) +#define cmmu_flush_cache(cpu, pa, s) (cmmu->flush_cache)(cpu, pa, s) +#define cmmu_flush_inst_cache(cpu,pa,s) (cmmu->flush_inst_cache)(cpu, pa, s) +#define dma_cachectl(pa, s, op) (cmmu->dma_cachectl)(pa, s, op) +#define dma_cachectl_local(pa, s, op) (cmmu->dma_cachectl_local)(pa, s, op) +#define cmmu_initialize_cpu(cpu) (cmmu->initialize_cpu)(cpu) /* * dma_cachectl{,_local}() modes */ -#define DMA_CACHE_SYNC 0x00 +#define DMA_CACHE_INV 0x00 #define DMA_CACHE_SYNC_INVAL 0x01 -#define DMA_CACHE_INV 0x02 - -#define DMA_CACHE_MASK 0x03 +#define DMA_CACHE_SYNC 0x02 #endif /* _KERNEL && !_LOCORE */ diff --git a/sys/arch/mvme88k/mvme88k/m197_machdep.c b/sys/arch/mvme88k/mvme88k/m197_machdep.c index 7c3b6e4afa3..518075852d2 100644 --- a/sys/arch/mvme88k/mvme88k/m197_machdep.c +++ b/sys/arch/mvme88k/mvme88k/m197_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m197_machdep.c,v 1.41 2009/08/30 12:11:35 miod Exp $ */ +/* $OpenBSD: m197_machdep.c,v 1.42 2010/06/22 17:42:37 miod Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -615,8 +615,7 @@ m197_ipi_handler(struct trapframe *eframe) cmmu_flush_inst_cache(ci->ci_cpuid, arg1, arg2); } else if (ipi & CI_IPI_DMA_CACHECTL) { - dma_cachectl_local(arg1, arg2 & ~DMA_CACHE_MASK, - arg2 & DMA_CACHE_MASK); + dma_cachectl_local(arg1, arg2, DMA_CACHE_INV); } return 0; diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c index acc86352093..c6a9d3b6c0a 100644 --- a/sys/arch/mvme88k/mvme88k/m88110.c +++ b/sys/arch/mvme88k/mvme88k/m88110.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m88110.c,v 1.64 2010/04/17 22:10:13 miod Exp $ */ +/* $OpenBSD: m88110.c,v 1.65 2010/06/22 17:42:37 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * All rights reserved. @@ -647,6 +647,14 @@ m88110_cmmu_inval_cache(paddr_t pa, psize_t size) * High level cache handling functions (used by bus_dma). */ +#ifdef MULTIPROCESSOR +void +m88110_dma_cachectl_local(paddr_t _pa, psize_t _size, int op) +{ + /* Obviously nothing to do. */ +} +#endif + void m88110_dma_cachectl(paddr_t _pa, psize_t _size, int op) { @@ -790,14 +798,11 @@ m88410_dma_cachectl(paddr_t _pa, psize_t _size, int op) m88410_dma_cachectl_local(pa, size, op); #ifdef MULTIPROCESSOR - m197_broadcast_complex_ipi(CI_IPI_DMA_CACHECTL, pa, size | op); + /* + * Since snooping is enabled, all we need is to propagate invalidate + * requests if necessary. + */ + if (op != DMA_CACHE_SYNC) + m197_broadcast_complex_ipi(CI_IPI_DMA_CACHECTL, pa, size); #endif } - -#ifdef MULTIPROCESSOR -void -m88110_dma_cachectl_local(paddr_t _pa, psize_t _size, int op) -{ - /* Obviously nothing to do. */ -} -#endif -- cgit v1.2.3