diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-02-04 10:48:06 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-04 10:48:06 -0500 |
commit | 1c083eb2cbdd917149f6acaa55efca129d05c2a9 (patch) | |
tree | 8d44b2d7daf85393994e71b5962e10c8ca9daa6f /arch/x86/kernel/efi_64.c | |
parent | f56d005d30342a45d8af2b75ecccc82200f09600 (diff) |
x86: fix EFI mapping
The patch updates EFI runtime memory mapping code, by making EFI
areas explicitly executable.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/efi_64.c')
-rw-r--r-- | arch/x86/kernel/efi_64.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c index 674f2379480f..09d5c2330934 100644 --- a/arch/x86/kernel/efi_64.c +++ b/arch/x86/kernel/efi_64.c | |||
@@ -54,10 +54,10 @@ static void __init early_mapping_set_exec(unsigned long start, | |||
54 | else | 54 | else |
55 | set_pte(kpte, __pte((pte_val(*kpte) | _PAGE_NX) & \ | 55 | set_pte(kpte, __pte((pte_val(*kpte) | _PAGE_NX) & \ |
56 | __supported_pte_mask)); | 56 | __supported_pte_mask)); |
57 | if (level == 4) | 57 | if (level == PG_LEVEL_4K) |
58 | start = (start + PMD_SIZE) & PMD_MASK; | ||
59 | else | ||
60 | start = (start + PAGE_SIZE) & PAGE_MASK; | 58 | start = (start + PAGE_SIZE) & PAGE_MASK; |
59 | else | ||
60 | start = (start + PMD_SIZE) & PMD_MASK; | ||
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
@@ -109,23 +109,23 @@ void __init efi_reserve_bootmem(void) | |||
109 | memmap.nr_map * memmap.desc_size); | 109 | memmap.nr_map * memmap.desc_size); |
110 | } | 110 | } |
111 | 111 | ||
112 | void __iomem * __init efi_ioremap(unsigned long offset, | 112 | void __iomem * __init efi_ioremap(unsigned long phys_addr, unsigned long size) |
113 | unsigned long size) | ||
114 | { | 113 | { |
115 | static unsigned pages_mapped; | 114 | static unsigned pages_mapped; |
116 | unsigned long last_addr; | ||
117 | unsigned i, pages; | 115 | unsigned i, pages; |
118 | 116 | ||
119 | last_addr = offset + size - 1; | 117 | /* phys_addr and size must be page aligned */ |
120 | offset &= PAGE_MASK; | 118 | if ((phys_addr & ~PAGE_MASK) || (size & ~PAGE_MASK)) |
121 | pages = (PAGE_ALIGN(last_addr) - offset) >> PAGE_SHIFT; | 119 | return NULL; |
120 | |||
121 | pages = size >> PAGE_SHIFT; | ||
122 | if (pages_mapped + pages > MAX_EFI_IO_PAGES) | 122 | if (pages_mapped + pages > MAX_EFI_IO_PAGES) |
123 | return NULL; | 123 | return NULL; |
124 | 124 | ||
125 | for (i = 0; i < pages; i++) { | 125 | for (i = 0; i < pages; i++) { |
126 | __set_fixmap(FIX_EFI_IO_MAP_FIRST_PAGE - pages_mapped, | 126 | __set_fixmap(FIX_EFI_IO_MAP_FIRST_PAGE - pages_mapped, |
127 | offset, PAGE_KERNEL_EXEC_NOCACHE); | 127 | phys_addr, PAGE_KERNEL); |
128 | offset += PAGE_SIZE; | 128 | phys_addr += PAGE_SIZE; |
129 | pages_mapped++; | 129 | pages_mapped++; |
130 | } | 130 | } |
131 | 131 | ||