From d8a2beb66033fa69770659675131ff9afc977780 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 30 Jul 2002 04:19:07 +0000 Subject: Panic if the data cache has too many virtual colors (more than 2). --- sys/sparc64/sparc64/cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sparc64/sparc64/cache.c b/sys/sparc64/sparc64/cache.c index 912662e..821b599 100644 --- a/sys/sparc64/sparc64/cache.c +++ b/sys/sparc64/sparc64/cache.c @@ -207,6 +207,8 @@ cache_init(phandle_t node) cache.dc_l2size = ffs(cache.dc_size) - 1; if ((cache.dc_size & ~(1UL << cache.dc_l2size)) != 0) panic("cache_init: D$ size not a power of 2"); + if (((cache.dc_size / cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) + panic("cache_init: too many D$ colors"); if (cache.dc_assoc != 1) panic("cache_init: D$ is not directly mapped!"); set = cache.ec_size / cache.ec_assoc; -- cgit v1.1