All of lore.kernel.org
 help / color / mirror / Atom feed
* -tip tree resume fail, bisect to 5bd5a45(x86: Add NX protection for kernel data)
@ 2010-11-22  7:23 Lin Ming
  2010-11-22  8:07 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Lin Ming @ 2010-11-22  7:23 UTC (permalink / raw)
  To: Matthieu Castet, Siarhei Liakh, Xuxian Jiang, Ingo Molnar
  Cc: Arjan van de Ven, Andi Kleen, lkml

Hi, all

Current -tip tree(92c883a) fail to resume after suspend to mem.
Bisect to commit 5bd5a45(x86: Add NX protection for kernel data).

commit 5bd5a452662bc37c54fb6828db1a3faf87e6511c
Author: Matthieu Castet <castet.matthieu@free.fr>
Date:   Tue Nov 16 22:31:26 2010 +0100

    x86: Add NX protection for kernel data


I did some debug and found the regression is caused by below line.

-       set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
+       set_memory_nx(rodata_start, (kernel_end - rodata_start) >> PAGE_SHIFT);

In my machine,
rodata_start=0xffffffff81a00000, end=0xffffffff81e00000, kernel_end=0xffffffff82200000

Without this commit, kernel page table dumps

---[ High Kernel Mapping ]---
....
0xffffffff81a00000-0xffffffff81c00000           2M     ro         PSE GLB NX pmd
0xffffffff81c00000-0xffffffff81d91000        1604K     ro             GLB NX pte
0xffffffff81d91000-0xffffffff81e00000         444K     ro             GLB NX pte
0xffffffff81e00000-0xffffffff82000000           2M     RW         PSE GLB x  pmd
0xffffffff82000000-0xffffffff8200c000          48K     RW             GLB x  pte
0xffffffff8200c000-0xffffffff82100000         976K     RW             GLB x  pte
0xffffffff82100000-0xffffffff82200000           1M     RW             GLB x  pte
.....

With this commit, kernel page table dumps

---[ High Kernel Mapping ]---
....
0xffffffff81a00000-0xffffffff81c00000           2M     ro         PSE GLB NX pmd
0xffffffff81c00000-0xffffffff81d91000        1604K     ro             GLB NX pte
0xffffffff81d91000-0xffffffff81e00000         444K     ro             GLB NX pte
0xffffffff81e00000-0xffffffff82000000           2M     RW         PSE GLB NX pmd
0xffffffff82000000-0xffffffff8200c000          48K     RW             GLB NX pte
0xffffffff8200c000-0xffffffff82100000         976K     RW             GLB NX pte
0xffffffff82100000-0xffffffff82200000           1M     RW             GLB NX pte
.....

The only difference is 0xffffffff81e00000(end) to 0xffffffff82200000(kernel_end) is set to NX.

I guess this range code is used by resume wakeup code. So setting it to NX causes problem.

Any idea?

Thanks,
Lin Ming



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2011-03-10  2:39 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-22  7:23 -tip tree resume fail, bisect to 5bd5a45(x86: Add NX protection for kernel data) Lin Ming
2010-11-22  8:07 ` Ingo Molnar
2010-11-22  9:20   ` Andi Kleen
2010-11-22 10:29     ` castet.matthieu
2010-11-22 10:47       ` Andi Kleen
2010-11-22 13:03 ` Peter Zijlstra
2010-11-22 16:29   ` castet.matthieu
2010-11-22 16:35     ` Peter Zijlstra
2010-11-22 16:42       ` Andi Kleen
2010-11-23 22:55         ` mat
2010-11-26 17:31           ` mat
2010-11-26 23:39             ` Lin Ming
2010-11-30  5:00             ` Lin Ming
2010-11-30 11:27               ` Peter Zijlstra
2010-12-01  0:15                 ` Lin Ming
2011-01-23 19:06                   ` matthieu castet
2011-01-24 22:22                     ` matthieu castet
2011-01-25 12:36                       ` Lin Ming
2011-03-09 23:16                       ` matthieu castet
2011-03-10  2:39                         ` Lin Ming
2010-12-24 17:26               ` matthieu castet
2010-12-27  2:10                 ` Lin Ming
2011-01-05 18:58                   ` matthieu castet
2010-11-22 13:42 ` [tip:x86/security] x86: Resume trampoline must be executable tip-bot for Lin Ming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.