aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pat.c
diff options
context:
space:
mode:
authorVenki Pallipadi <venkatesh.pallipadi@intel.com>2008-05-05 22:09:10 -0400
committerIngo Molnar <mingo@elte.hu>2008-05-12 15:28:07 -0400
commit77b52b4c5c66175553ee59eb43f74366f1e54bde (patch)
tree5b768491beef075d392a044ce8f0fcbc687ac2c5 /arch/x86/mm/pat.c
parent988f7b5789ccf5cfed14c72e28573a49f0cb4809 (diff)
x86: add "debugpat" boot option
enable debug messages by a boot option "debugpat". Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r--arch/x86/mm/pat.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 60adbe22efa..1a82f4db8a4 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -42,6 +42,19 @@ static int nopat(char *str)
42early_param("nopat", nopat); 42early_param("nopat", nopat);
43#endif 43#endif
44 44
45
46static int debug_enable;
47static int __init pat_debug_setup(char *str)
48{
49 debug_enable = 1;
50 return 0;
51}
52__setup("debugpat", pat_debug_setup);
53
54#define dprintk(fmt, arg...) \
55 do { if (debug_enable) printk(KERN_INFO fmt, ##arg); } while (0)
56
57
45static u64 __read_mostly boot_pat_state; 58static u64 __read_mostly boot_pat_state;
46 59
47enum { 60enum {
@@ -279,7 +292,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
279 struct memtype *saved_ptr; 292 struct memtype *saved_ptr;
280 293
281 if (parse->start >= end) { 294 if (parse->start >= end) {
282 pr_debug("New Entry\n"); 295 dprintk("New Entry\n");
283 list_add(&new_entry->nd, parse->nd.prev); 296 list_add(&new_entry->nd, parse->nd.prev);
284 new_entry = NULL; 297 new_entry = NULL;
285 break; 298 break;
@@ -329,7 +342,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
329 break; 342 break;
330 } 343 }
331 344
332 pr_debug("Overlap at 0x%Lx-0x%Lx\n", 345 dprintk("Overlap at 0x%Lx-0x%Lx\n",
333 saved_ptr->start, saved_ptr->end); 346 saved_ptr->start, saved_ptr->end);
334 /* No conflict. Go ahead and add this new entry */ 347 /* No conflict. Go ahead and add this new entry */
335 list_add(&new_entry->nd, saved_ptr->nd.prev); 348 list_add(&new_entry->nd, saved_ptr->nd.prev);
@@ -381,7 +394,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
381 break; 394 break;
382 } 395 }
383 396
384 pr_debug(KERN_INFO "Overlap at 0x%Lx-0x%Lx\n", 397 dprintk("Overlap at 0x%Lx-0x%Lx\n",
385 saved_ptr->start, saved_ptr->end); 398 saved_ptr->start, saved_ptr->end);
386 /* No conflict. Go ahead and add this new entry */ 399 /* No conflict. Go ahead and add this new entry */
387 list_add(&new_entry->nd, &saved_ptr->nd); 400 list_add(&new_entry->nd, &saved_ptr->nd);
@@ -403,16 +416,16 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
403 if (new_entry) { 416 if (new_entry) {
404 /* No conflict. Not yet added to the list. Add to the tail */ 417 /* No conflict. Not yet added to the list. Add to the tail */
405 list_add_tail(&new_entry->nd, &memtype_list); 418 list_add_tail(&new_entry->nd, &memtype_list);
406 pr_debug("New Entry\n"); 419 dprintk("New Entry\n");
407 } 420 }
408 421
409 if (ret_type) { 422 if (ret_type) {
410 pr_debug( 423 dprintk(
411 "reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n", 424 "reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n",
412 start, end, cattr_name(actual_type), 425 start, end, cattr_name(actual_type),
413 cattr_name(req_type), cattr_name(*ret_type)); 426 cattr_name(req_type), cattr_name(*ret_type));
414 } else { 427 } else {
415 pr_debug( 428 dprintk(
416 "reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s\n", 429 "reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s\n",
417 start, end, cattr_name(actual_type), 430 start, end, cattr_name(actual_type),
418 cattr_name(req_type)); 431 cattr_name(req_type));
@@ -453,7 +466,7 @@ int free_memtype(u64 start, u64 end)
453 current->comm, current->pid, start, end); 466 current->comm, current->pid, start, end);
454 } 467 }
455 468
456 pr_debug("free_memtype request 0x%Lx-0x%Lx\n", start, end); 469 dprintk("free_memtype request 0x%Lx-0x%Lx\n", start, end);
457 return err; 470 return err;
458} 471}
459 472