1. 31 1月, 2009 7 次提交
    • J
      x86/paravirt: add register-saving thunks to reduce caller register pressure · ecb93d1c
      Jeremy Fitzhardinge 提交于
      Impact: Optimization
      
      One of the problems with inserting a pile of C calls where previously
      there were none is that the register pressure is greatly increased.
      The C calling convention says that the caller must expect a certain
      set of registers may be trashed by the callee, and that the callee can
      use those registers without restriction.  This includes the function
      argument registers, and several others.
      
      This patch seeks to alleviate this pressure by introducing wrapper
      thunks that will do the register saving/restoring, so that the
      callsite doesn't need to worry about it, but the callee function can
      be conventional compiler-generated code.  In many cases (particularly
      performance-sensitive cases) the callee will be in assembler anyway,
      and need not use the compiler's calling convention.
      
      Standard calling convention is:
      	 arguments	    return	scratch
      x86-32	 eax edx ecx	    eax		?
      x86-64	 rdi rsi rdx rcx    rax		r8 r9 r10 r11
      
      The thunk preserves all argument and scratch registers.  The return
      register is not preserved, and is available as a scratch register for
      unwrapped callee code (and of course the return value).
      
      Wrapped function pointers are themselves wrapped in a struct
      paravirt_callee_save structure, in order to get some warning from the
      compiler when functions with mismatched calling conventions are used.
      
      The most common paravirt ops, both statically and dynamically, are
      interrupt enable/disable/save/restore, so handle them first.  This is
      particularly easy since their calls are handled specially anyway.
      
      XXX Deal with VMI.  What's their calling convention?
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      ecb93d1c
    • J
      x86/paravirt: selectively save/restore regs around pvops calls · 9104a18d
      Jeremy Fitzhardinge 提交于
      Impact: Optimization
      
      Each asm paravirt-ops call says what registers are available for
      clobbering.  This patch makes use of this to selectively save/restore
      registers around each pvops call.  In many cases this significantly
      shrinks code size.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      9104a18d
    • J
      x86: fix paravirt clobber in entry_64.S · b8aa287f
      Jeremy Fitzhardinge 提交于
      Impact: Fix latent bug
      
      The clobber is trying to say that anything except RDI is available for
      clobbering, but actually clobbers everything.  This hasn't mattered
      because the clobbers were basically ignored, but subsequent patches
      will rely on them.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      b8aa287f
    • J
      x86/pvops: add a paravirt_ident functions to allow special patching · 41edafdb
      Jeremy Fitzhardinge 提交于
      Impact: Optimization
      
      Several paravirt ops implementations simply return their arguments,
      the most obvious being the make_pte/pte_val class of operations on
      native.
      
      On 32-bit, the identity function is literally a no-op, as the calling
      convention uses the same registers for the first argument and return.
      On 64-bit, it can be implemented with a single "mov".
      
      This patch adds special identity functions for 32 and 64 bit argument,
      and machinery to recognize them and replace them with either nops or a
      mov as appropriate.
      
      At the moment, the only users for the identity functions are the
      pagetable entry conversion functions.
      
      The result is a measureable improvement on pagetable-heavy benchmarks
      (2-3%, reducing the pvops overhead from 5 to 2%).
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      41edafdb
    • J
      xen: move remaining mmu-related stuff into mmu.c · 319f3ba5
      Jeremy Fitzhardinge 提交于
      Impact: Cleanup
      
      Move remaining mmu-related stuff into mmu.c.
      A general cleanup, and lay the groundwork for later patches.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      319f3ba5
    • H
      Merge branch 'core/percpu' into x86/paravirt · 9b7ed8fa
      H. Peter Anvin 提交于
      9b7ed8fa
    • I
      Merge branch 'linus' into core/percpu · c43e0e46
      Ingo Molnar 提交于
      Conflicts:
      	kernel/irq/handle.c
      c43e0e46
  2. 30 1月, 2009 33 次提交