aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/paravirt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/paravirt.c')
-rw-r--r--arch/x86/kernel/paravirt.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 74f0c5ea2a03..e0f571d58c19 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -30,6 +30,7 @@
30#include <asm/setup.h> 30#include <asm/setup.h>
31#include <asm/arch_hooks.h> 31#include <asm/arch_hooks.h>
32#include <asm/time.h> 32#include <asm/time.h>
33#include <asm/pgalloc.h>
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/delay.h> 35#include <asm/delay.h>
35#include <asm/fixmap.h> 36#include <asm/fixmap.h>
@@ -139,7 +140,9 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
139 /* If the operation is a nop, then nop the callsite */ 140 /* If the operation is a nop, then nop the callsite */
140 ret = paravirt_patch_nop(); 141 ret = paravirt_patch_nop();
141 else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) || 142 else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
142 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_syscall_ret)) 143 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
144 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret32) ||
145 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret64))
143 /* If operation requires a jmp, then jmp */ 146 /* If operation requires a jmp, then jmp */
144 ret = paravirt_patch_jmp(insnbuf, opfunc, addr, len); 147 ret = paravirt_patch_jmp(insnbuf, opfunc, addr, len);
145 else 148 else
@@ -190,7 +193,9 @@ static void native_flush_tlb_single(unsigned long addr)
190 193
191/* These are in entry.S */ 194/* These are in entry.S */
192extern void native_iret(void); 195extern void native_iret(void);
193extern void native_irq_enable_syscall_ret(void); 196extern void native_irq_enable_sysexit(void);
197extern void native_usergs_sysret32(void);
198extern void native_usergs_sysret64(void);
194 199
195static int __init print_banner(void) 200static int __init print_banner(void)
196{ 201{
@@ -280,7 +285,7 @@ struct pv_time_ops pv_time_ops = {
280 .get_wallclock = native_get_wallclock, 285 .get_wallclock = native_get_wallclock,
281 .set_wallclock = native_set_wallclock, 286 .set_wallclock = native_set_wallclock,
282 .sched_clock = native_sched_clock, 287 .sched_clock = native_sched_clock,
283 .get_cpu_khz = native_calculate_cpu_khz, 288 .get_tsc_khz = native_calibrate_tsc,
284}; 289};
285 290
286struct pv_irq_ops pv_irq_ops = { 291struct pv_irq_ops pv_irq_ops = {
@@ -291,6 +296,9 @@ struct pv_irq_ops pv_irq_ops = {
291 .irq_enable = native_irq_enable, 296 .irq_enable = native_irq_enable,
292 .safe_halt = native_safe_halt, 297 .safe_halt = native_safe_halt,
293 .halt = native_halt, 298 .halt = native_halt,
299#ifdef CONFIG_X86_64
300 .adjust_exception_frame = paravirt_nop,
301#endif
294}; 302};
295 303
296struct pv_cpu_ops pv_cpu_ops = { 304struct pv_cpu_ops pv_cpu_ops = {
@@ -321,12 +329,23 @@ struct pv_cpu_ops pv_cpu_ops = {
321 .store_idt = native_store_idt, 329 .store_idt = native_store_idt,
322 .store_tr = native_store_tr, 330 .store_tr = native_store_tr,
323 .load_tls = native_load_tls, 331 .load_tls = native_load_tls,
332#ifdef CONFIG_X86_64
333 .load_gs_index = native_load_gs_index,
334#endif
324 .write_ldt_entry = native_write_ldt_entry, 335 .write_ldt_entry = native_write_ldt_entry,
325 .write_gdt_entry = native_write_gdt_entry, 336 .write_gdt_entry = native_write_gdt_entry,
326 .write_idt_entry = native_write_idt_entry, 337 .write_idt_entry = native_write_idt_entry,
327 .load_sp0 = native_load_sp0, 338 .load_sp0 = native_load_sp0,
328 339
329 .irq_enable_syscall_ret = native_irq_enable_syscall_ret, 340#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
341 .irq_enable_sysexit = native_irq_enable_sysexit,
342#endif
343#ifdef CONFIG_X86_64
344#ifdef CONFIG_IA32_EMULATION
345 .usergs_sysret32 = native_usergs_sysret32,
346#endif
347 .usergs_sysret64 = native_usergs_sysret64,
348#endif
330 .iret = native_iret, 349 .iret = native_iret,
331 .swapgs = native_swapgs, 350 .swapgs = native_swapgs,
332 351
@@ -366,6 +385,9 @@ struct pv_mmu_ops pv_mmu_ops = {
366 .flush_tlb_single = native_flush_tlb_single, 385 .flush_tlb_single = native_flush_tlb_single,
367 .flush_tlb_others = native_flush_tlb_others, 386 .flush_tlb_others = native_flush_tlb_others,
368 387
388 .pgd_alloc = __paravirt_pgd_alloc,
389 .pgd_free = paravirt_nop,
390
369 .alloc_pte = paravirt_nop, 391 .alloc_pte = paravirt_nop,
370 .alloc_pmd = paravirt_nop, 392 .alloc_pmd = paravirt_nop,
371 .alloc_pmd_clone = paravirt_nop, 393 .alloc_pmd_clone = paravirt_nop,
@@ -380,6 +402,9 @@ struct pv_mmu_ops pv_mmu_ops = {
380 .pte_update = paravirt_nop, 402 .pte_update = paravirt_nop,
381 .pte_update_defer = paravirt_nop, 403 .pte_update_defer = paravirt_nop,
382 404
405 .ptep_modify_prot_start = __ptep_modify_prot_start,
406 .ptep_modify_prot_commit = __ptep_modify_prot_commit,
407
383#ifdef CONFIG_HIGHPTE 408#ifdef CONFIG_HIGHPTE
384 .kmap_atomic_pte = kmap_atomic, 409 .kmap_atomic_pte = kmap_atomic,
385#endif 410#endif
@@ -403,6 +428,7 @@ struct pv_mmu_ops pv_mmu_ops = {
403#endif /* PAGETABLE_LEVELS >= 3 */ 428#endif /* PAGETABLE_LEVELS >= 3 */
404 429
405 .pte_val = native_pte_val, 430 .pte_val = native_pte_val,
431 .pte_flags = native_pte_val,
406 .pgd_val = native_pgd_val, 432 .pgd_val = native_pgd_val,
407 433
408 .make_pte = native_make_pte, 434 .make_pte = native_make_pte,
@@ -416,6 +442,8 @@ struct pv_mmu_ops pv_mmu_ops = {
416 .enter = paravirt_nop, 442 .enter = paravirt_nop,
417 .leave = paravirt_nop, 443 .leave = paravirt_nop,
418 }, 444 },
445
446 .set_fixmap = native_set_fixmap,
419}; 447};
420 448
421EXPORT_SYMBOL_GPL(pv_time_ops); 449EXPORT_SYMBOL_GPL(pv_time_ops);