Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 1 | /* Paravirtualization interfaces |
| 2 | Copyright (C) 2006 Rusty Russell IBM Corporation |
| 3 | |
| 4 | This program is free software; you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation; either version 2 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program; if not, write to the Free Software |
| 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | */ |
| 18 | #include <linux/errno.h> |
| 19 | #include <linux/module.h> |
| 20 | #include <linux/efi.h> |
| 21 | #include <linux/bcd.h> |
Jeremy Fitzhardinge | ce6234b | 2007-05-02 19:27:15 +0200 | [diff] [blame] | 22 | #include <linux/highmem.h> |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 23 | |
| 24 | #include <asm/bug.h> |
| 25 | #include <asm/paravirt.h> |
| 26 | #include <asm/desc.h> |
| 27 | #include <asm/setup.h> |
| 28 | #include <asm/arch_hooks.h> |
| 29 | #include <asm/time.h> |
| 30 | #include <asm/irq.h> |
| 31 | #include <asm/delay.h> |
Rusty Russell | 13623d7 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 32 | #include <asm/fixmap.h> |
| 33 | #include <asm/apic.h> |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 34 | #include <asm/tlbflush.h> |
Zachary Amsden | 6cb9a83 | 2007-03-05 00:30:35 -0800 | [diff] [blame] | 35 | #include <asm/timer.h> |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 36 | |
| 37 | /* nop stub */ |
Jeremy Fitzhardinge | 4587623 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 38 | void _paravirt_nop(void) |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 39 | { |
| 40 | } |
| 41 | |
| 42 | static void __init default_banner(void) |
| 43 | { |
| 44 | printk(KERN_INFO "Booting paravirtualized kernel on %s\n", |
| 45 | paravirt_ops.name); |
| 46 | } |
| 47 | |
| 48 | char *memory_setup(void) |
| 49 | { |
| 50 | return paravirt_ops.memory_setup(); |
| 51 | } |
| 52 | |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 53 | /* Simple instruction patching code. */ |
| 54 | #define DEF_NATIVE(name, code) \ |
| 55 | extern const char start_##name[], end_##name[]; \ |
| 56 | asm("start_" #name ": " code "; end_" #name ":") |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 57 | |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 58 | DEF_NATIVE(irq_disable, "cli"); |
| 59 | DEF_NATIVE(irq_enable, "sti"); |
| 60 | DEF_NATIVE(restore_fl, "push %eax; popf"); |
| 61 | DEF_NATIVE(save_fl, "pushf; pop %eax"); |
| 62 | DEF_NATIVE(iret, "iret"); |
| 63 | DEF_NATIVE(irq_enable_sysexit, "sti; sysexit"); |
| 64 | DEF_NATIVE(read_cr2, "mov %cr2, %eax"); |
| 65 | DEF_NATIVE(write_cr3, "mov %eax, %cr3"); |
| 66 | DEF_NATIVE(read_cr3, "mov %cr3, %eax"); |
| 67 | DEF_NATIVE(clts, "clts"); |
| 68 | DEF_NATIVE(read_tsc, "rdtsc"); |
| 69 | |
| 70 | DEF_NATIVE(ud2a, "ud2a"); |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 71 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 72 | static unsigned native_patch(u8 type, u16 clobbers, void *ibuf, |
| 73 | unsigned long addr, unsigned len) |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 74 | { |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 75 | const unsigned char *start, *end; |
| 76 | unsigned ret; |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 77 | |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 78 | switch(type) { |
| 79 | #define SITE(x) case PARAVIRT_PATCH(x): start = start_##x; end = end_##x; goto patch_site |
| 80 | SITE(irq_disable); |
| 81 | SITE(irq_enable); |
| 82 | SITE(restore_fl); |
| 83 | SITE(save_fl); |
| 84 | SITE(iret); |
| 85 | SITE(irq_enable_sysexit); |
| 86 | SITE(read_cr2); |
| 87 | SITE(read_cr3); |
| 88 | SITE(write_cr3); |
| 89 | SITE(clts); |
| 90 | SITE(read_tsc); |
| 91 | #undef SITE |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 92 | |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 93 | patch_site: |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 94 | ret = paravirt_patch_insns(ibuf, len, start, end); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 95 | break; |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 96 | |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 97 | case PARAVIRT_PATCH(make_pgd): |
| 98 | case PARAVIRT_PATCH(make_pte): |
| 99 | case PARAVIRT_PATCH(pgd_val): |
| 100 | case PARAVIRT_PATCH(pte_val): |
| 101 | #ifdef CONFIG_X86_PAE |
| 102 | case PARAVIRT_PATCH(make_pmd): |
| 103 | case PARAVIRT_PATCH(pmd_val): |
| 104 | #endif |
| 105 | /* These functions end up returning exactly what |
| 106 | they're passed, in the same registers. */ |
| 107 | ret = paravirt_patch_nop(); |
| 108 | break; |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 109 | |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 110 | default: |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 111 | ret = paravirt_patch_default(type, clobbers, ibuf, addr, len); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 112 | break; |
| 113 | } |
| 114 | |
| 115 | return ret; |
| 116 | } |
| 117 | |
| 118 | unsigned paravirt_patch_nop(void) |
| 119 | { |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | unsigned paravirt_patch_ignore(unsigned len) |
| 124 | { |
| 125 | return len; |
| 126 | } |
| 127 | |
Andi Kleen | 19d36cc | 2007-07-22 11:12:31 +0200 | [diff] [blame] | 128 | struct branch { |
| 129 | unsigned char opcode; |
| 130 | u32 delta; |
| 131 | } __attribute__((packed)); |
| 132 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 133 | unsigned paravirt_patch_call(void *insnbuf, |
| 134 | const void *target, u16 tgt_clobbers, |
| 135 | unsigned long addr, u16 site_clobbers, |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 136 | unsigned len) |
| 137 | { |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 138 | struct branch *b = insnbuf; |
| 139 | unsigned long delta = (unsigned long)target - (addr+5); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 140 | |
| 141 | if (tgt_clobbers & ~site_clobbers) |
| 142 | return len; /* target would clobber too much for this site */ |
| 143 | if (len < 5) |
| 144 | return len; /* call too long for patch site */ |
| 145 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 146 | b->opcode = 0xe8; /* call */ |
| 147 | b->delta = delta; |
| 148 | BUILD_BUG_ON(sizeof(*b) != 5); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 149 | |
| 150 | return 5; |
| 151 | } |
| 152 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 153 | unsigned paravirt_patch_jmp(const void *target, void *insnbuf, |
| 154 | unsigned long addr, unsigned len) |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 155 | { |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 156 | struct branch *b = insnbuf; |
| 157 | unsigned long delta = (unsigned long)target - (addr+5); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 158 | |
| 159 | if (len < 5) |
| 160 | return len; /* call too long for patch site */ |
| 161 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 162 | b->opcode = 0xe9; /* jmp */ |
| 163 | b->delta = delta; |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 164 | |
| 165 | return 5; |
| 166 | } |
| 167 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 168 | unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf, |
| 169 | unsigned long addr, unsigned len) |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 170 | { |
| 171 | void *opfunc = *((void **)¶virt_ops + type); |
| 172 | unsigned ret; |
| 173 | |
| 174 | if (opfunc == NULL) |
| 175 | /* If there's no function, patch it with a ud2a (BUG) */ |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 176 | ret = paravirt_patch_insns(insnbuf, len, start_ud2a, end_ud2a); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 177 | else if (opfunc == paravirt_nop) |
| 178 | /* If the operation is a nop, then nop the callsite */ |
| 179 | ret = paravirt_patch_nop(); |
| 180 | else if (type == PARAVIRT_PATCH(iret) || |
| 181 | type == PARAVIRT_PATCH(irq_enable_sysexit)) |
| 182 | /* If operation requires a jmp, then jmp */ |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 183 | ret = paravirt_patch_jmp(opfunc, insnbuf, addr, len); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 184 | else |
| 185 | /* Otherwise call the function; assume target could |
| 186 | clobber any caller-save reg */ |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 187 | ret = paravirt_patch_call(insnbuf, opfunc, CLBR_ANY, |
| 188 | addr, clobbers, len); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 189 | |
| 190 | return ret; |
| 191 | } |
| 192 | |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 193 | unsigned paravirt_patch_insns(void *insnbuf, unsigned len, |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 194 | const char *start, const char *end) |
| 195 | { |
| 196 | unsigned insn_len = end - start; |
| 197 | |
| 198 | if (insn_len > len || start == NULL) |
| 199 | insn_len = len; |
| 200 | else |
Andi Kleen | ab144f5 | 2007-08-10 22:31:03 +0200 | [diff] [blame^] | 201 | memcpy(insnbuf, start, insn_len); |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 202 | |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 203 | return insn_len; |
| 204 | } |
| 205 | |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 206 | void init_IRQ(void) |
| 207 | { |
| 208 | paravirt_ops.init_IRQ(); |
| 209 | } |
| 210 | |
Andi Kleen | 1a1eecd | 2007-02-13 13:26:25 +0100 | [diff] [blame] | 211 | static void native_flush_tlb(void) |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 212 | { |
| 213 | __native_flush_tlb(); |
| 214 | } |
| 215 | |
| 216 | /* |
| 217 | * Global pages have to be flushed a bit differently. Not a real |
| 218 | * performance problem because this does not happen often. |
| 219 | */ |
Andi Kleen | 1a1eecd | 2007-02-13 13:26:25 +0100 | [diff] [blame] | 220 | static void native_flush_tlb_global(void) |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 221 | { |
| 222 | __native_flush_tlb_global(); |
| 223 | } |
| 224 | |
Jeremy Fitzhardinge | 63f7027 | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 225 | static void native_flush_tlb_single(unsigned long addr) |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 226 | { |
| 227 | __native_flush_tlb_single(addr); |
| 228 | } |
| 229 | |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 230 | /* These are in entry.S */ |
Andi Kleen | 1a1eecd | 2007-02-13 13:26:25 +0100 | [diff] [blame] | 231 | extern void native_iret(void); |
| 232 | extern void native_irq_enable_sysexit(void); |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 233 | |
| 234 | static int __init print_banner(void) |
| 235 | { |
| 236 | paravirt_ops.banner(); |
| 237 | return 0; |
| 238 | } |
| 239 | core_initcall(print_banner); |
| 240 | |
Jeremy Fitzhardinge | d572929 | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 241 | static struct resource reserve_ioports = { |
| 242 | .start = 0, |
| 243 | .end = IO_SPACE_LIMIT, |
| 244 | .name = "paravirt-ioport", |
| 245 | .flags = IORESOURCE_IO | IORESOURCE_BUSY, |
| 246 | }; |
| 247 | |
| 248 | static struct resource reserve_iomem = { |
| 249 | .start = 0, |
| 250 | .end = -1, |
| 251 | .name = "paravirt-iomem", |
| 252 | .flags = IORESOURCE_MEM | IORESOURCE_BUSY, |
| 253 | }; |
| 254 | |
| 255 | /* |
| 256 | * Reserve the whole legacy IO space to prevent any legacy drivers |
| 257 | * from wasting time probing for their hardware. This is a fairly |
| 258 | * brute-force approach to disabling all non-virtual drivers. |
| 259 | * |
| 260 | * Note that this must be called very early to have any effect. |
| 261 | */ |
| 262 | int paravirt_disable_iospace(void) |
| 263 | { |
| 264 | int ret; |
| 265 | |
| 266 | ret = request_resource(&ioport_resource, &reserve_ioports); |
| 267 | if (ret == 0) { |
| 268 | ret = request_resource(&iomem_resource, &reserve_iomem); |
| 269 | if (ret) |
| 270 | release_resource(&reserve_ioports); |
| 271 | } |
| 272 | |
| 273 | return ret; |
| 274 | } |
| 275 | |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 276 | struct paravirt_ops paravirt_ops = { |
| 277 | .name = "bare hardware", |
| 278 | .paravirt_enabled = 0, |
| 279 | .kernel_rpl = 0, |
Jeremy Fitzhardinge | 5311ab6 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 280 | .shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */ |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 281 | |
Rusty Russell | 139ec7c | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 282 | .patch = native_patch, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 283 | .banner = default_banner, |
Jeremy Fitzhardinge | 4587623 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 284 | .arch_setup = paravirt_nop, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 285 | .memory_setup = machine_specific_memory_setup, |
| 286 | .get_wallclock = native_get_wallclock, |
| 287 | .set_wallclock = native_set_wallclock, |
Zachary Amsden | e30fab3 | 2007-03-05 00:30:39 -0800 | [diff] [blame] | 288 | .time_init = hpet_time_init, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 289 | .init_IRQ = native_init_IRQ, |
| 290 | |
| 291 | .cpuid = native_cpuid, |
| 292 | .get_debugreg = native_get_debugreg, |
| 293 | .set_debugreg = native_set_debugreg, |
| 294 | .clts = native_clts, |
| 295 | .read_cr0 = native_read_cr0, |
| 296 | .write_cr0 = native_write_cr0, |
| 297 | .read_cr2 = native_read_cr2, |
| 298 | .write_cr2 = native_write_cr2, |
| 299 | .read_cr3 = native_read_cr3, |
| 300 | .write_cr3 = native_write_cr3, |
| 301 | .read_cr4 = native_read_cr4, |
| 302 | .read_cr4_safe = native_read_cr4_safe, |
| 303 | .write_cr4 = native_write_cr4, |
| 304 | .save_fl = native_save_fl, |
| 305 | .restore_fl = native_restore_fl, |
| 306 | .irq_disable = native_irq_disable, |
| 307 | .irq_enable = native_irq_enable, |
| 308 | .safe_halt = native_safe_halt, |
| 309 | .halt = native_halt, |
| 310 | .wbinvd = native_wbinvd, |
Rusty Russell | 90a0a06 | 2007-05-02 19:27:10 +0200 | [diff] [blame] | 311 | .read_msr = native_read_msr_safe, |
| 312 | .write_msr = native_write_msr_safe, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 313 | .read_tsc = native_read_tsc, |
| 314 | .read_pmc = native_read_pmc, |
Jeremy Fitzhardinge | 688340e | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 315 | .sched_clock = native_sched_clock, |
Zachary Amsden | 1182d85 | 2007-03-05 00:30:36 -0800 | [diff] [blame] | 316 | .get_cpu_khz = native_calculate_cpu_khz, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 317 | .load_tr_desc = native_load_tr_desc, |
| 318 | .set_ldt = native_set_ldt, |
| 319 | .load_gdt = native_load_gdt, |
| 320 | .load_idt = native_load_idt, |
| 321 | .store_gdt = native_store_gdt, |
| 322 | .store_idt = native_store_idt, |
| 323 | .store_tr = native_store_tr, |
| 324 | .load_tls = native_load_tls, |
Rusty Russell | 90a0a06 | 2007-05-02 19:27:10 +0200 | [diff] [blame] | 325 | .write_ldt_entry = write_dt_entry, |
| 326 | .write_gdt_entry = write_dt_entry, |
| 327 | .write_idt_entry = write_dt_entry, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 328 | .load_esp0 = native_load_esp0, |
| 329 | |
| 330 | .set_iopl_mask = native_set_iopl_mask, |
| 331 | .io_delay = native_io_delay, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 332 | |
Rusty Russell | 13623d7 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 333 | #ifdef CONFIG_X86_LOCAL_APIC |
| 334 | .apic_write = native_apic_write, |
| 335 | .apic_write_atomic = native_apic_write_atomic, |
| 336 | .apic_read = native_apic_read, |
Zachary Amsden | bbab4f3 | 2007-02-13 13:26:21 +0100 | [diff] [blame] | 337 | .setup_boot_clock = setup_boot_APIC_clock, |
| 338 | .setup_secondary_clock = setup_secondary_APIC_clock, |
Jeremy Fitzhardinge | 0260c19 | 2007-05-02 19:27:18 +0200 | [diff] [blame] | 339 | .startup_ipi_hook = paravirt_nop, |
Rusty Russell | 13623d7 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 340 | #endif |
Jeremy Fitzhardinge | 4587623 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 341 | .set_lazy_mode = paravirt_nop, |
Rusty Russell | 13623d7 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 342 | |
Jeremy Fitzhardinge | b239fb2 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 343 | .pagetable_setup_start = native_pagetable_setup_start, |
| 344 | .pagetable_setup_done = native_pagetable_setup_done, |
| 345 | |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 346 | .flush_tlb_user = native_flush_tlb, |
| 347 | .flush_tlb_kernel = native_flush_tlb_global, |
| 348 | .flush_tlb_single = native_flush_tlb_single, |
Jeremy Fitzhardinge | d4c1047 | 2007-05-02 19:27:15 +0200 | [diff] [blame] | 349 | .flush_tlb_others = native_flush_tlb_others, |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 350 | |
Jeremy Fitzhardinge | 4587623 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 351 | .alloc_pt = paravirt_nop, |
| 352 | .alloc_pd = paravirt_nop, |
| 353 | .alloc_pd_clone = paravirt_nop, |
| 354 | .release_pt = paravirt_nop, |
| 355 | .release_pd = paravirt_nop, |
Zachary Amsden | c119ecc | 2007-02-13 13:26:21 +0100 | [diff] [blame] | 356 | |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 357 | .set_pte = native_set_pte, |
| 358 | .set_pte_at = native_set_pte_at, |
| 359 | .set_pmd = native_set_pmd, |
Jeremy Fitzhardinge | 4587623 | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 360 | .pte_update = paravirt_nop, |
| 361 | .pte_update_defer = paravirt_nop, |
Jeremy Fitzhardinge | 3dc494e | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 362 | |
Jeremy Fitzhardinge | ce6234b | 2007-05-02 19:27:15 +0200 | [diff] [blame] | 363 | #ifdef CONFIG_HIGHPTE |
| 364 | .kmap_atomic_pte = kmap_atomic, |
| 365 | #endif |
| 366 | |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 367 | #ifdef CONFIG_X86_PAE |
| 368 | .set_pte_atomic = native_set_pte_atomic, |
| 369 | .set_pte_present = native_set_pte_present, |
| 370 | .set_pud = native_set_pud, |
| 371 | .pte_clear = native_pte_clear, |
| 372 | .pmd_clear = native_pmd_clear, |
Jeremy Fitzhardinge | 3dc494e | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 373 | |
| 374 | .pmd_val = native_pmd_val, |
| 375 | .make_pmd = native_make_pmd, |
Rusty Russell | da181a8 | 2006-12-07 02:14:08 +0100 | [diff] [blame] | 376 | #endif |
| 377 | |
Jeremy Fitzhardinge | 3dc494e | 2007-05-02 19:27:13 +0200 | [diff] [blame] | 378 | .pte_val = native_pte_val, |
| 379 | .pgd_val = native_pgd_val, |
| 380 | |
| 381 | .make_pte = native_make_pte, |
| 382 | .make_pgd = native_make_pgd, |
| 383 | |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 384 | .irq_enable_sysexit = native_irq_enable_sysexit, |
| 385 | .iret = native_iret, |
Zachary Amsden | ae5da27 | 2007-02-13 13:26:21 +0100 | [diff] [blame] | 386 | |
Jeremy Fitzhardinge | d6dd61c | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 387 | .dup_mmap = paravirt_nop, |
| 388 | .exit_mmap = paravirt_nop, |
| 389 | .activate_mm = paravirt_nop, |
Rusty Russell | d3561b7 | 2006-12-07 02:14:07 +0100 | [diff] [blame] | 390 | }; |
Ingo Molnar | 0dbe5a1 | 2007-01-22 20:40:36 -0800 | [diff] [blame] | 391 | |
Andi Kleen | 21564fd | 2007-05-02 19:27:17 +0200 | [diff] [blame] | 392 | EXPORT_SYMBOL(paravirt_ops); |