aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/paravirt.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-01-28 17:35:07 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2009-01-30 17:51:45 -0500
commitda5de7c22eb705be709a57e486e7475a6969b994 (patch)
tree29b3655e38fea6bd6ef11437d2fea14b397c8b03 /arch/x86/kernel/paravirt.c
parent791bad9d28d405d9397ea0c370ffb7c7bdd2aa6e (diff)
x86/paravirt: use callee-saved convention for pte_val/make_pte/etc
Impact: Optimization In the native case, pte_val, make_pte, etc are all just identity functions, so there's no need to clobber a lot of registers over them. (This changes the 32-bit callee-save calling convention to return both EAX and EDX so functions can return 64-bit values.) Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/paravirt.c')
-rw-r--r--arch/x86/kernel/paravirt.c53
1 files changed, 12 insertions, 41 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 8adb6b5aa421..cea11c8e3049 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -391,43 +391,12 @@ struct pv_apic_ops pv_apic_ops = {
391#endif 391#endif
392}; 392};
393 393
394typedef pte_t make_pte_t(pteval_t);
395typedef pmd_t make_pmd_t(pmdval_t);
396typedef pud_t make_pud_t(pudval_t);
397typedef pgd_t make_pgd_t(pgdval_t);
398
399typedef pteval_t pte_val_t(pte_t);
400typedef pmdval_t pmd_val_t(pmd_t);
401typedef pudval_t pud_val_t(pud_t);
402typedef pgdval_t pgd_val_t(pgd_t);
403
404
405#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE) 394#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
406/* 32-bit pagetable entries */ 395/* 32-bit pagetable entries */
407#define paravirt_native_make_pte (make_pte_t *)_paravirt_ident_32 396#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_32)
408#define paravirt_native_pte_val (pte_val_t *)_paravirt_ident_32
409
410#define paravirt_native_make_pmd (make_pmd_t *)_paravirt_ident_32
411#define paravirt_native_pmd_val (pmd_val_t *)_paravirt_ident_32
412
413#define paravirt_native_make_pud (make_pud_t *)_paravirt_ident_32
414#define paravirt_native_pud_val (pud_val_t *)_paravirt_ident_32
415
416#define paravirt_native_make_pgd (make_pgd_t *)_paravirt_ident_32
417#define paravirt_native_pgd_val (pgd_val_t *)_paravirt_ident_32
418#else 397#else
419/* 64-bit pagetable entries */ 398/* 64-bit pagetable entries */
420#define paravirt_native_make_pte (make_pte_t *)_paravirt_ident_64 399#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64)
421#define paravirt_native_pte_val (pte_val_t *)_paravirt_ident_64
422
423#define paravirt_native_make_pmd (make_pmd_t *)_paravirt_ident_64
424#define paravirt_native_pmd_val (pmd_val_t *)_paravirt_ident_64
425
426#define paravirt_native_make_pud (make_pud_t *)_paravirt_ident_64
427#define paravirt_native_pud_val (pud_val_t *)_paravirt_ident_64
428
429#define paravirt_native_make_pgd (make_pgd_t *)_paravirt_ident_64
430#define paravirt_native_pgd_val (pgd_val_t *)_paravirt_ident_64
431#endif 400#endif
432 401
433struct pv_mmu_ops pv_mmu_ops = { 402struct pv_mmu_ops pv_mmu_ops = {
@@ -481,21 +450,23 @@ struct pv_mmu_ops pv_mmu_ops = {
481 .pmd_clear = native_pmd_clear, 450 .pmd_clear = native_pmd_clear,
482#endif 451#endif
483 .set_pud = native_set_pud, 452 .set_pud = native_set_pud,
484 .pmd_val = paravirt_native_pmd_val, 453
485 .make_pmd = paravirt_native_make_pmd, 454 .pmd_val = PTE_IDENT,
455 .make_pmd = PTE_IDENT,
486 456
487#if PAGETABLE_LEVELS == 4 457#if PAGETABLE_LEVELS == 4
488 .pud_val = paravirt_native_pud_val, 458 .pud_val = PTE_IDENT,
489 .make_pud = paravirt_native_make_pud, 459 .make_pud = PTE_IDENT,
460
490 .set_pgd = native_set_pgd, 461 .set_pgd = native_set_pgd,
491#endif 462#endif
492#endif /* PAGETABLE_LEVELS >= 3 */ 463#endif /* PAGETABLE_LEVELS >= 3 */
493 464
494 .pte_val = paravirt_native_pte_val, 465 .pte_val = PTE_IDENT,
495 .pgd_val = paravirt_native_pgd_val, 466 .pgd_val = PTE_IDENT,
496 467
497 .make_pte = paravirt_native_make_pte, 468 .make_pte = PTE_IDENT,
498 .make_pgd = paravirt_native_make_pgd, 469 .make_pgd = PTE_IDENT,
499 470
500 .dup_mmap = paravirt_nop, 471 .dup_mmap = paravirt_nop,
501 .exit_mmap = paravirt_nop, 472 .exit_mmap = paravirt_nop,