diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-01-28 17:35:07 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-01-30 17:51:45 -0500 |
commit | da5de7c22eb705be709a57e486e7475a6969b994 (patch) | |
tree | 29b3655e38fea6bd6ef11437d2fea14b397c8b03 /arch/x86/xen/mmu.c | |
parent | 791bad9d28d405d9397ea0c370ffb7c7bdd2aa6e (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/xen/mmu.c')
-rw-r--r-- | arch/x86/xen/mmu.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 94e452c0b00c..5e41f7fc6cf1 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -492,28 +492,33 @@ pteval_t xen_pte_val(pte_t pte) | |||
492 | { | 492 | { |
493 | return pte_mfn_to_pfn(pte.pte); | 493 | return pte_mfn_to_pfn(pte.pte); |
494 | } | 494 | } |
495 | PV_CALLEE_SAVE_REGS_THUNK(xen_pte_val); | ||
495 | 496 | ||
496 | pgdval_t xen_pgd_val(pgd_t pgd) | 497 | pgdval_t xen_pgd_val(pgd_t pgd) |
497 | { | 498 | { |
498 | return pte_mfn_to_pfn(pgd.pgd); | 499 | return pte_mfn_to_pfn(pgd.pgd); |
499 | } | 500 | } |
501 | PV_CALLEE_SAVE_REGS_THUNK(xen_pgd_val); | ||
500 | 502 | ||
501 | pte_t xen_make_pte(pteval_t pte) | 503 | pte_t xen_make_pte(pteval_t pte) |
502 | { | 504 | { |
503 | pte = pte_pfn_to_mfn(pte); | 505 | pte = pte_pfn_to_mfn(pte); |
504 | return native_make_pte(pte); | 506 | return native_make_pte(pte); |
505 | } | 507 | } |
508 | PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte); | ||
506 | 509 | ||
507 | pgd_t xen_make_pgd(pgdval_t pgd) | 510 | pgd_t xen_make_pgd(pgdval_t pgd) |
508 | { | 511 | { |
509 | pgd = pte_pfn_to_mfn(pgd); | 512 | pgd = pte_pfn_to_mfn(pgd); |
510 | return native_make_pgd(pgd); | 513 | return native_make_pgd(pgd); |
511 | } | 514 | } |
515 | PV_CALLEE_SAVE_REGS_THUNK(xen_make_pgd); | ||
512 | 516 | ||
513 | pmdval_t xen_pmd_val(pmd_t pmd) | 517 | pmdval_t xen_pmd_val(pmd_t pmd) |
514 | { | 518 | { |
515 | return pte_mfn_to_pfn(pmd.pmd); | 519 | return pte_mfn_to_pfn(pmd.pmd); |
516 | } | 520 | } |
521 | PV_CALLEE_SAVE_REGS_THUNK(xen_pmd_val); | ||
517 | 522 | ||
518 | void xen_set_pud_hyper(pud_t *ptr, pud_t val) | 523 | void xen_set_pud_hyper(pud_t *ptr, pud_t val) |
519 | { | 524 | { |
@@ -590,12 +595,14 @@ pmd_t xen_make_pmd(pmdval_t pmd) | |||
590 | pmd = pte_pfn_to_mfn(pmd); | 595 | pmd = pte_pfn_to_mfn(pmd); |
591 | return native_make_pmd(pmd); | 596 | return native_make_pmd(pmd); |
592 | } | 597 | } |
598 | PV_CALLEE_SAVE_REGS_THUNK(xen_make_pmd); | ||
593 | 599 | ||
594 | #if PAGETABLE_LEVELS == 4 | 600 | #if PAGETABLE_LEVELS == 4 |
595 | pudval_t xen_pud_val(pud_t pud) | 601 | pudval_t xen_pud_val(pud_t pud) |
596 | { | 602 | { |
597 | return pte_mfn_to_pfn(pud.pud); | 603 | return pte_mfn_to_pfn(pud.pud); |
598 | } | 604 | } |
605 | PV_CALLEE_SAVE_REGS_THUNK(xen_pud_val); | ||
599 | 606 | ||
600 | pud_t xen_make_pud(pudval_t pud) | 607 | pud_t xen_make_pud(pudval_t pud) |
601 | { | 608 | { |
@@ -603,6 +610,7 @@ pud_t xen_make_pud(pudval_t pud) | |||
603 | 610 | ||
604 | return native_make_pud(pud); | 611 | return native_make_pud(pud); |
605 | } | 612 | } |
613 | PV_CALLEE_SAVE_REGS_THUNK(xen_make_pud); | ||
606 | 614 | ||
607 | pgd_t *xen_get_user_pgd(pgd_t *pgd) | 615 | pgd_t *xen_get_user_pgd(pgd_t *pgd) |
608 | { | 616 | { |
@@ -1813,11 +1821,11 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
1813 | .ptep_modify_prot_start = __ptep_modify_prot_start, | 1821 | .ptep_modify_prot_start = __ptep_modify_prot_start, |
1814 | .ptep_modify_prot_commit = __ptep_modify_prot_commit, | 1822 | .ptep_modify_prot_commit = __ptep_modify_prot_commit, |
1815 | 1823 | ||
1816 | .pte_val = xen_pte_val, | 1824 | .pte_val = PV_CALLEE_SAVE(xen_pte_val), |
1817 | .pgd_val = xen_pgd_val, | 1825 | .pgd_val = PV_CALLEE_SAVE(xen_pgd_val), |
1818 | 1826 | ||
1819 | .make_pte = xen_make_pte, | 1827 | .make_pte = PV_CALLEE_SAVE(xen_make_pte), |
1820 | .make_pgd = xen_make_pgd, | 1828 | .make_pgd = PV_CALLEE_SAVE(xen_make_pgd), |
1821 | 1829 | ||
1822 | #ifdef CONFIG_X86_PAE | 1830 | #ifdef CONFIG_X86_PAE |
1823 | .set_pte_atomic = xen_set_pte_atomic, | 1831 | .set_pte_atomic = xen_set_pte_atomic, |
@@ -1827,12 +1835,12 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
1827 | #endif /* CONFIG_X86_PAE */ | 1835 | #endif /* CONFIG_X86_PAE */ |
1828 | .set_pud = xen_set_pud_hyper, | 1836 | .set_pud = xen_set_pud_hyper, |
1829 | 1837 | ||
1830 | .make_pmd = xen_make_pmd, | 1838 | .make_pmd = PV_CALLEE_SAVE(xen_make_pmd), |
1831 | .pmd_val = xen_pmd_val, | 1839 | .pmd_val = PV_CALLEE_SAVE(xen_pmd_val), |
1832 | 1840 | ||
1833 | #if PAGETABLE_LEVELS == 4 | 1841 | #if PAGETABLE_LEVELS == 4 |
1834 | .pud_val = xen_pud_val, | 1842 | .pud_val = PV_CALLEE_SAVE(xen_pud_val), |
1835 | .make_pud = xen_make_pud, | 1843 | .make_pud = PV_CALLEE_SAVE(xen_make_pud), |
1836 | .set_pgd = xen_set_pgd_hyper, | 1844 | .set_pgd = xen_set_pgd_hyper, |
1837 | 1845 | ||
1838 | .alloc_pud = xen_alloc_pte_init, | 1846 | .alloc_pud = xen_alloc_pte_init, |