Magellan Linux

Contents of /tags/kernel26-xen-2_6_25_r1-fedora9-patches/kernel26-xen/patches-2.6.25-r1/1133-2.6.25-xen-pgd_walk-changes-to-make-pgd-pinning-work-FIXME.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: 2650 byte(s)
This commit was manufactured by cvs2svn to create tag
'kernel26-xen-2_6_25_r1-fedora9-patches'.
1 From abc1b733749fcf89195d631083c42316593590b4 Mon Sep 17 00:00:00 2001
2 From: Eduardo Habkost <ehabkost@redhat.com>
3 Date: Fri, 25 Jan 2008 12:20:28 -0200
4 Subject: [PATCH] pgd_walk() changes to make pgd pinning work (FIXME)
5
6 To be investigated:
7 - Why walking to TASK_SIZE isn't enough
8 - The child-first walking probably won't work for unpinning
9 - Check if lock_pte() usage is correct for x86_64 also
10
11 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
12 ---
13 arch/x86/xen/mmu.c | 30 ++++++++++++++++++++----------
14 1 files changed, 20 insertions(+), 10 deletions(-)
15
16 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
17 index 998cfb9..1e7d1c9 100644
18 --- a/arch/x86/xen/mmu.c
19 +++ b/arch/x86/xen/mmu.c
20 @@ -356,12 +356,20 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
21 unsigned long addr = start;
22 unsigned long pgd_next;
23
24 + /*FIXME: the child-first walk order probably won't work for unpin_page()
25 + */
26 +
27 +#ifdef CONFIG_X86_64
28 + /*FIXME: investigate why walking to TASK_SIZE isn't enough on x86_64 */
29 + limit += PAGE_SIZE;
30 +#endif
31 +
32 if (xen_feature(XENFEAT_auto_translated_physmap))
33 return 0;
34
35 pgd = pgd_base + pgd_index(addr);
36 for (; addr != limit; pgd++, addr = pgd_next) {
37 - pud_t *pud;
38 + pud_t *pud, *pud0;
39 unsigned long pud_limit, pud_next;
40
41 pgd_next = pud_limit = pgd_addr_end(addr, limit);
42 @@ -369,13 +377,10 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
43 if (!pgd_val(*pgd))
44 continue;
45
46 - pud = pud_offset(pgd, 0);
47 -
48 - if (PTRS_PER_PUD > 1) /* not folded */
49 - flush |= (*func)(virt_to_page(pud), PT_PUD);
50 + pud0 = pud = pud_offset(pgd, 0);
51
52 for (; addr != pud_limit; pud++, addr = pud_next) {
53 - pmd_t *pmd;
54 + pmd_t *pmd, *pmd0;
55 unsigned long pmd_limit;
56
57 pud_next = pmd_limit = pud_addr_end(addr, pud_limit);
58 @@ -383,10 +388,7 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
59 if (pud_none(*pud))
60 continue;
61
62 - pmd = pmd_offset(pud, 0);
63 -
64 - if (PTRS_PER_PMD > 1) /* not folded */
65 - flush |= (*func)(virt_to_page(pmd), PT_PMD);
66 + pmd0 = pmd = pmd_offset(pud, 0);
67
68 for (; addr != pmd_limit; pmd++) {
69 addr += (PAGE_SIZE * PTRS_PER_PTE);
70 @@ -400,7 +402,15 @@ static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, enum pt_level),
71
72 flush |= (*func)(pmd_page(*pmd), PT_PTE);
73 }
74 +
75 + if (PTRS_PER_PMD > 1) /* not folded */
76 + flush |= (*func)(virt_to_page(pmd0), PT_PMD);
77 +
78 }
79 +
80 + if (PTRS_PER_PUD > 1) /* not folded */
81 + flush |= (*func)(virt_to_page(pud0), PT_PUD);
82 +
83 }
84
85 flush |= (*func)(virt_to_page(pgd_base), PT_PGD);
86 --
87 1.5.4.1
88