aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2012-10-05 14:24:18 -0400
committerChristopher Kenna <cjk@cs.unc.edu>2012-10-05 20:49:52 -0400
commitb3b54764b5baa9bac7642bc559a42f1ee8bb656a (patch)
treea9586bc7df4ab36e172dc7a2f840e303eaf0a678 /litmus
parentb1f5890e0aa8f0eb4ad9772ca50c1320a8af0a9c (diff)
Coloring on the ARM.
Diffstat (limited to 'litmus')
-rw-r--r--litmus/color.c25
-rw-r--r--litmus/color_dev.c2
2 files changed, 14 insertions, 13 deletions
diff --git a/litmus/color.c b/litmus/color.c
index a68c30c0edb0..19767f41ee87 100644
--- a/litmus/color.c
+++ b/litmus/color.c
@@ -117,7 +117,7 @@ static int do_add_pages(void)
117#if defined(CONFIG_X86) 117#if defined(CONFIG_X86)
118 page = alloc_page(GFP_HIGHUSER | __GFP_ZERO | 118 page = alloc_page(GFP_HIGHUSER | __GFP_ZERO |
119 __GFP_MOVABLE); 119 __GFP_MOVABLE);
120#elif defined(CONFIG_SPARC) /* X86 */ 120#elif defined(CONFIG_SPARC) || defined(CONFIG_ARM)
121 page = alloc_page(GFP_HIGHUSER | __GFP_MOVABLE); 121 page = alloc_page(GFP_HIGHUSER | __GFP_MOVABLE);
122#else 122#else
123#error What architecture are you using? 123#error What architecture are you using?
@@ -253,7 +253,7 @@ out:
253 * Initialization 253 * Initialization
254***********************************************************/ 254***********************************************************/
255 255
256#if defined(CONFIG_X86) 256#if defined(CONFIG_X86) || defined(CONFIG_ARM)
257/* slowest possible way to find a log, but we only do this once on boot */ 257/* slowest possible way to find a log, but we only do this once on boot */
258static unsigned int __init slow_log(unsigned int v) 258static unsigned int __init slow_log(unsigned int v)
259{ 259{
@@ -268,10 +268,11 @@ static int __init init_mask(void)
268 unsigned int line_size_log = slow_log(color_cache_info.line_size); 268 unsigned int line_size_log = slow_log(color_cache_info.line_size);
269 int err = 0; 269 int err = 0;
270 270
271 BUG_ON(color_cache_info.size <= 1048576 || 271 WARN(color_cache_info.size < 1048576 ||
272 color_cache_info.ways < 15 || 272 color_cache_info.ways < 15 ||
273 color_cache_info.line_size != 64); 273 (color_cache_info.line_size != 64 &&
274 274 color_cache_info.line_size != 32),
275 "Potentially bad cache size, ways, or line size.\n");
275 printk("Cache size: %lu line-size: %lu ways: %lu sets: %lu\n", 276 printk("Cache size: %lu line-size: %lu ways: %lu sets: %lu\n",
276 color_cache_info.size, color_cache_info.line_size, 277 color_cache_info.size, color_cache_info.line_size,
277 color_cache_info.ways, color_cache_info.sets); 278 color_cache_info.ways, color_cache_info.sets);
@@ -282,16 +283,19 @@ static int __init init_mask(void)
282 } 283 }
283 284
284 285
285 BUG_ON(color_cache_info.size / color_cache_info.line_size / 286 WARN(color_cache_info.size / color_cache_info.line_size /
286 color_cache_info.ways != color_cache_info.sets); 287 color_cache_info.ways != color_cache_info.sets,
287 BUG_ON(PAGE_SIZE >= (color_cache_info.sets << line_size_log)); 288 "Cache size and set information do not agree.\n");
289 WARN(PAGE_SIZE >= (color_cache_info.sets << line_size_log),
290 "Cache set bits contained entirely within page bits.\n");
288 color_mask = ((color_cache_info.sets << line_size_log) - 1) ^ 291 color_mask = ((color_cache_info.sets << line_size_log) - 1) ^
289 (PAGE_SIZE - 1); 292 (PAGE_SIZE - 1);
290 color_cache_info.nr_colors = (color_mask >> PAGE_SHIFT) + 1; 293 color_cache_info.nr_colors = (color_mask >> PAGE_SHIFT) + 1;
294
291out: 295out:
292 return err; 296 return err;
293} 297}
294#elif defined(CONFIG_SPARC) /* X86 */ 298#elif defined(CONFIG_SPARC)
295static int __init init_mask(void) 299static int __init init_mask(void)
296{ 300{
297 /* 301 /*
@@ -307,8 +311,7 @@ static int __init init_mask(void)
307 color_cache_info.nr_colors = (1 << hweight_long(color_mask)); 311 color_cache_info.nr_colors = (1 << hweight_long(color_mask));
308 return 0; 312 return 0;
309} 313}
310#endif /* SPARC/X86 */ 314#endif
311
312 315
313 316
314static int __init init_color_groups(void) 317static int __init init_color_groups(void)
diff --git a/litmus/color_dev.c b/litmus/color_dev.c
index 677905a2a6b1..32ff0cb190f9 100644
--- a/litmus/color_dev.c
+++ b/litmus/color_dev.c
@@ -176,9 +176,7 @@ static int do_map_colored_page_set(struct vm_area_struct *vma,
176 goto out; 176 goto out;
177 } 177 }
178 178
179#ifdef CONFIG_SPARC
180 clear_user_highpage(page, addr); 179 clear_user_highpage(page, addr);
181#endif
182 180
183 TRACE_CUR("insert page (pa:0x%10llx, pfn:%8lu, color:%3lu) " 181 TRACE_CUR("insert page (pa:0x%10llx, pfn:%8lu, color:%3lu) "
184 "at 0x%lx vma:(flags:%16lx prot:%16lx)\n", 182 "at 0x%lx vma:(flags:%16lx prot:%16lx)\n",