Commit 6997ab49 authored by venkatesh.pallipadi@intel.com's avatar venkatesh.pallipadi@intel.com Committed by Ingo Molnar

x86: add PAT related debug prints

Adds debug prints at critical code. Adds enough info in dmesg to allow us to
do effective first round of analysis of any issues that may result due to PAT
patch series.
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b310f381
...@@ -131,7 +131,7 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size, ...@@ -131,7 +131,7 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
return NULL; return NULL;
if (!phys_addr_valid(phys_addr)) { if (!phys_addr_valid(phys_addr)) {
printk(KERN_WARNING "ioremap: invalid physical address %lx\n", printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
phys_addr); phys_addr);
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
return NULL; return NULL;
...@@ -177,6 +177,10 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size, ...@@ -177,6 +177,10 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
new_prot_val == _PAGE_CACHE_WC)) || new_prot_val == _PAGE_CACHE_WC)) ||
(prot_val == _PAGE_CACHE_WC && (prot_val == _PAGE_CACHE_WC &&
new_prot_val == _PAGE_CACHE_WB)) { new_prot_val == _PAGE_CACHE_WB)) {
printk(
"ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n",
phys_addr, phys_addr + size,
prot_val, new_prot_val);
free_memtype(phys_addr, phys_addr + size); free_memtype(phys_addr, phys_addr + size);
return NULL; return NULL;
} }
......
...@@ -246,6 +246,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, ...@@ -246,6 +246,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
struct memtype *saved_ptr; struct memtype *saved_ptr;
if (parse->start >= end) { if (parse->start >= end) {
printk("New Entry\n");
list_add(&new_entry->nd, parse->nd.prev); list_add(&new_entry->nd, parse->nd.prev);
new_entry = NULL; new_entry = NULL;
break; break;
...@@ -295,6 +296,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, ...@@ -295,6 +296,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
break; break;
} }
printk("Overlap at 0x%Lx-0x%Lx\n",
saved_ptr->start, saved_ptr->end);
/* No conflict. Go ahead and add this new entry */ /* No conflict. Go ahead and add this new entry */
list_add(&new_entry->nd, saved_ptr->nd.prev); list_add(&new_entry->nd, saved_ptr->nd.prev);
new_entry = NULL; new_entry = NULL;
...@@ -345,6 +348,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, ...@@ -345,6 +348,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
break; break;
} }
printk("Overlap at 0x%Lx-0x%Lx\n",
saved_ptr->start, saved_ptr->end);
/* No conflict. Go ahead and add this new entry */ /* No conflict. Go ahead and add this new entry */
list_add(&new_entry->nd, &saved_ptr->nd); list_add(&new_entry->nd, &saved_ptr->nd);
new_entry = NULL; new_entry = NULL;
...@@ -353,6 +358,10 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, ...@@ -353,6 +358,10 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
} }
if (err) { if (err) {
printk(
"reserve_memtype failed 0x%Lx-0x%Lx, track %s, req %s\n",
start, end, cattr_name(new_entry->type),
cattr_name(req_type));
kfree(new_entry); kfree(new_entry);
spin_unlock(&memtype_lock); spin_unlock(&memtype_lock);
return err; return err;
...@@ -361,6 +370,19 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, ...@@ -361,6 +370,19 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
if (new_entry) { if (new_entry) {
/* No conflict. Not yet added to the list. Add to the tail */ /* No conflict. Not yet added to the list. Add to the tail */
list_add_tail(&new_entry->nd, &memtype_list); list_add_tail(&new_entry->nd, &memtype_list);
printk("New Entry\n");
}
if (ret_type) {
printk(
"reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n",
start, end, cattr_name(actual_type),
cattr_name(req_type), cattr_name(*ret_type));
} else {
printk(
"reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s\n",
start, end, cattr_name(actual_type),
cattr_name(req_type));
} }
spin_unlock(&memtype_lock); spin_unlock(&memtype_lock);
...@@ -397,6 +419,8 @@ int free_memtype(u64 start, u64 end) ...@@ -397,6 +419,8 @@ int free_memtype(u64 start, u64 end)
printk(KERN_DEBUG "%s:%d freeing invalid memtype %Lx-%Lx\n", printk(KERN_DEBUG "%s:%d freeing invalid memtype %Lx-%Lx\n",
current->comm, current->pid, start, end); current->comm, current->pid, start, end);
} }
printk( "free_memtype request 0x%Lx-0x%Lx\n", start, end);
return err; return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment