Commit 6ba9b7d8 authored by Andi Kleen's avatar Andi Kleen Committed by Ingo Molnar

x86: fix c_p_a() boot crash

fix:

> hm, i just found a failing 64-bit .config while testing your CPA
> patchset:
>
>  [    1.916541] CPA mapping 4k 0 large 2048 gb 0 x 0[0-0] miss 0
>  [    1.919874] Unable to handle kernel paging request at 000000000335aea8 RIP:
>  [    1.919874]  [<ffffffff8021d2d3>] change_page_attr+0x3/0x61
>  [    1.919874] PGD 0
>  [    1.919874] Oops: 0000 [1]
>  [    1.919874] CPU 0

This handles addresses which don't have a mem_map entry.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent aaa0e890
...@@ -177,7 +177,7 @@ static __init int exercise_pageattr(void) ...@@ -177,7 +177,7 @@ static __init int exercise_pageattr(void)
continue; continue;
} }
err = change_page_attr(virt_to_page(addr[i]), len[i], err = change_page_attr_addr(addr[i], len[i],
pte_pgprot(pte_clrhuge(pte_clrglobal(pte0)))); pte_pgprot(pte_clrhuge(pte_clrglobal(pte0))));
if (err < 0) { if (err < 0) {
printk(KERN_ERR "CPA %d failed %d\n", i, err); printk(KERN_ERR "CPA %d failed %d\n", i, err);
...@@ -212,7 +212,7 @@ static __init int exercise_pageattr(void) ...@@ -212,7 +212,7 @@ static __init int exercise_pageattr(void)
failed++; failed++;
continue; continue;
} }
err = change_page_attr(virt_to_page(addr[i]), len[i], err = change_page_attr_addr(addr[i], len[i],
pte_pgprot(pte_mkglobal(*pte))); pte_pgprot(pte_mkglobal(*pte)));
if (err < 0) { if (err < 0) {
printk(KERN_ERR "CPA reverting failed: %d\n", err); printk(KERN_ERR "CPA reverting failed: %d\n", 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