Magellan Linux

Contents of /tags/kernel26-xen-2_6_25_r1-fedora9-patches/kernel26-xen/patches-2.6.25-r1/1152-2.6.25-xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 608 - (show annotations) (download)
Fri May 23 12:17:32 2008 UTC (16 years ago) by (unknown author)
File size: 1468 byte(s)
This commit was manufactured by cvs2svn to create tag
'kernel26-xen-2_6_25_r1-fedora9-patches'.
1 From 93ee2997ca1b50cd133d3a9e767851205c222fca Mon Sep 17 00:00:00 2001
2 From: Eduardo Habkost <ehabkost@redhat.com>
3 Date: Tue, 15 Apr 2008 17:59:31 -0300
4 Subject: [PATCH] Xen: Clear __START_KERNEL_map PTEs on free_init_pages() (REVIEWME)
5
6 We need to kill the __START_KERNEL_map aliases of the freed init pages
7 otherwise we won't be able to pin those pages as pagetables later, because
8 there will be a read-write alias even after make_lowpage_readonly().
9
10 Probably using set_memory_ro() instead of make_lowpage_readonly()
11 when pinning pages will be better.
12
13 This should fix the pagetable pinning problems reported at
14 https://bugzilla.redhat.com/show_bug.cgi?id=441543
15
16 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
17 ---
18 arch/x86/mm/init_64.c | 10 ++++++++++
19 1 files changed, 10 insertions(+), 0 deletions(-)
20
21 diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
22 index 763914c..d4083c8 100644
23 --- a/arch/x86/mm/init_64.c
24 +++ b/arch/x86/mm/init_64.c
25 @@ -1089,6 +1089,16 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
26 POISON_FREE_INITMEM, PAGE_SIZE);
27 free_page(addr);
28 totalram_pages++;
29 + if (begin >= __START_KERNEL_map) {
30 + pte_t *kpte;
31 + unsigned int l;
32 + /* __START_KERNEL_map addresses must be unmapped
33 + * because we map physical memory at __PAGE_OFFSET
34 + * and we don't want to keep aliases.
35 + */
36 + kpte = lookup_address(addr, &l);
37 + set_pte(kpte, __pte(0));
38 + }
39 }
40 #endif
41 }
42 --
43 1.5.4.1
44