Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1020-2.6.25-xen-x86_64-Expose-set_pte_vaddr.patch
Parent Directory | Revision Log
Revision 606 -
(show annotations)
(download)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 2235 byte(s)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 2235 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | From e6057b64c93bff5db61e17d35d836abb8c80e244 Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> |
3 | Date: Mon, 3 Mar 2008 15:03:42 -0300 |
4 | Subject: [PATCH] x86_64: Expose set_pte_vaddr() |
5 | |
6 | Re-name set_pte_pfn() to set_pte_vaddr(), taking a pte_t |
7 | rather than pfn/flags, and expose it. |
8 | |
9 | This brings 32-bit closer to 64-bit. |
10 | |
11 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> |
12 | Signed-off-by: Mark McLoughlin <markmc@redhat.com> |
13 | --- |
14 | arch/x86/mm/init_64.c | 13 ++++++------- |
15 | include/asm-x86/pgtable_64.h | 4 ++++ |
16 | 2 files changed, 10 insertions(+), 7 deletions(-) |
17 | |
18 | diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c |
19 | index 954a6d6..00628b5 100644 |
20 | --- a/arch/x86/mm/init_64.c |
21 | +++ b/arch/x86/mm/init_64.c |
22 | @@ -121,15 +121,15 @@ static __init void *spp_getpage(void) |
23 | return ptr; |
24 | } |
25 | |
26 | -static __init void |
27 | -set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) |
28 | +void |
29 | +set_pte_vaddr(unsigned long vaddr, pte_t pteval) |
30 | { |
31 | pgd_t *pgd; |
32 | pud_t *pud; |
33 | pmd_t *pmd; |
34 | - pte_t *pte, new_pte; |
35 | + pte_t *pte; |
36 | |
37 | - pr_debug("set_pte_phys %lx to %lx\n", vaddr, phys); |
38 | + pr_debug("set_pte_phys %lx to %lx\n", vaddr, native_pte_val(pteval)); |
39 | |
40 | pgd = pgd_offset_k(vaddr); |
41 | if (pgd_none(*pgd)) { |
42 | @@ -156,13 +156,12 @@ set_pte_phys(unsigned long vaddr, unsigned long phys, pgprot_t prot) |
43 | return; |
44 | } |
45 | } |
46 | - new_pte = pfn_pte(phys >> PAGE_SHIFT, prot); |
47 | |
48 | pte = pte_offset_kernel(pmd, vaddr); |
49 | if (!pte_none(*pte) && |
50 | - pte_val(*pte) != (pte_val(new_pte) & __supported_pte_mask)) |
51 | + pte_val(*pte) != (pte_val(pteval) & __supported_pte_mask)) |
52 | pte_ERROR(*pte); |
53 | - set_pte(pte, new_pte); |
54 | + set_pte(pte, pteval); |
55 | |
56 | /* |
57 | * It's enough to flush this one mapping. |
58 | diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h |
59 | index 0a0b77b..c9352fe 100644 |
60 | --- a/include/asm-x86/pgtable_64.h |
61 | +++ b/include/asm-x86/pgtable_64.h |
62 | @@ -267,6 +267,10 @@ extern void cleanup_highmap(void); |
63 | (((o) & (1UL << (__VIRTUAL_MASK_SHIFT-1))) ? ((o) | (~__VIRTUAL_MASK)) : (o)) |
64 | |
65 | #define __HAVE_ARCH_PTE_SAME |
66 | + |
67 | +/* Install a pte for a particular vaddr in kernel space. */ |
68 | +void set_pte_vaddr(unsigned long vaddr, pte_t pte); |
69 | + |
70 | #endif /* !__ASSEMBLY__ */ |
71 | |
72 | #endif /* _X86_64_PGTABLE_H */ |
73 | -- |
74 | 1.5.4.1 |
75 |