An error occurred fetching the project authors.
  1. 17 Mar, 2009 1 commit
    • Jeremy Fitzhardinge's avatar
      x86, paravirt: prevent gcc from generating the wrong addressing mode · 42854dc0
      Jeremy Fitzhardinge authored
      Impact: fix crash on VMI (VMware)
      
      When we generate a call sequence for calling a paravirtualized
      function, we presume that the generated code is "call *0xXXXXX",
      which is a 6 byte opcode; this is larger than a normal
      direct call, and so we can patch a direct call over it.
      
      At the moment, however we give gcc enough rope to hang us by
      putting the address in a register and generating a two byte
      indirect-via-register call.  Prevent this by explicitly
      dereferencing the function pointer and passing it into the
      asm as a constant.
      
      This prevents crashes in VMI, as it cannot handle unpatchable
      callsites.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Alok Kataria <akataria@vmware.com>
      LKML-Reference: <49BEEDC2.2070809@goop.org>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      42854dc0
  2. 12 Feb, 2009 1 commit
    • Jeremy Fitzhardinge's avatar
      x86/paravirt: make arch_flush_lazy_mmu/cpu disable preemption · d85cf93d
      Jeremy Fitzhardinge authored
      Impact: avoid access to percpu vars in preempible context
      
      They are intended to be used whenever there's the possibility
      that there's some stale state which is going to be overwritten
      with a queued update, or to force a state change when we may be
      in lazy mode.  Either way, we could end up calling it with
      preemption enabled, so wrap the functions in their own little
      preempt-disable section so they can be safely called in any
      context (though preemption should never be enabled if we're actually
      in a lazy state).
      
      (Move out of line to avoid #include dependencies.)
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      d85cf93d
  3. 09 Feb, 2009 1 commit
  4. 23 Oct, 2008 2 commits
  5. 22 Aug, 2008 2 commits
  6. 20 Aug, 2008 1 commit
  7. 24 Jul, 2008 1 commit
  8. 22 Jul, 2008 3 commits
    • Vegard Nossum's avatar
      x86: consolidate header guards · 77ef50a5
      Vegard Nossum authored
      This patch is the result of an automatic script that consolidates the
      format of all the headers in include/asm-x86/.
      
      The format:
      
      1. No leading underscore. Names with leading underscores are reserved.
      2. Pathname components are separated by two underscores. So we can
         distinguish between mm_types.h and mm/types.h.
      3. Everything except letters and numbers are turned into single
         underscores.
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@gmail.com>
      77ef50a5
    • Jeremy Fitzhardinge's avatar
      x86: rename PTE_MASK to PTE_PFN_MASK · 59438c9f
      Jeremy Fitzhardinge authored
      Rusty, in his peevish way, complained that macros defining constants
      should have a name which somewhat accurately reflects the actual
      purpose of the constant.
      
      Aside from the fact that PTE_MASK gives no clue as to what's actually
      being masked, and is misleadingly similar to the functionally entirely
      different PMD_MASK, PUD_MASK and PGD_MASK, I don't really see what the
      problem is.
      
      But if this patch silences the incessent noise, then it will have
      achieved its goal (TODO: write test-case).
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      59438c9f
    • Rusty Russell's avatar
      x86: fix pte_flags() to only return flags, fix lguest (updated) · c2e3277f
      Rusty Russell authored
      (Jeremy said:
      	rusty: use PTE_MASK
      	rusty: use PTE_MASK
      	rusty: use PTE_MASK
       When I asked:
      	jsgf: does that include the NX flag?
       He responded eloquently:
      	rusty: use PTE_MASK
      	rusty: use PTE_MASK
      	yes, it's the official constant of masking flags out of ptes
      )
      
      Change a15af1c9 'x86/paravirt: add
      pte_flags to just get pte flags' removed lguest's private pte_flags()
      in favor of a generic one.
      
      Unfortunately, the generic one doesn't filter out the non-flags bits:
      this results in lguest creating corrupt shadow page tables and blowing
      up host memory.
      
      Since noone is supposed to use the pfn part of pte_flags(), it seems
      safest to always do the filtering.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Acked-by: default avatarJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-and-morning-tea-spilled-by: default avatarIngo Molnar <mingo@elte.hu>
      c2e3277f
  9. 18 Jul, 2008 2 commits
    • Harvey Harrison's avatar
      x86: suppress sparse returning void warnings · 32172561
      Harvey Harrison authored
      include/asm/paravirt.h:1404:2: warning: returning void-valued expression
      include/asm/paravirt.h:1414:2: warning: returning void-valued expression
      Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      32172561
    • Maciej W. Rozycki's avatar
      x86: APIC: remove apic_write_around(); use alternatives · 593f4a78
      Maciej W. Rozycki authored
      Use alternatives to select the workaround for the 11AP Pentium erratum
      for the affected steppings on the fly rather than build time.  Remove the
      X86_GOOD_APIC configuration option and replace all the calls to
      apic_write_around() with plain apic_write(), protecting accesses to the
      ESR as appropriate due to the 3AP Pentium erratum.  Remove
      apic_read_around() and all its invocations altogether as not needed.
      Remove apic_write_atomic() and all its implementing backends.  The use of
      ASM_OUTPUT2() is not strictly needed for input constraints, but I have
      used it for readability's sake.
      
      I had the feeling no one else was brave enough to do it, so I went ahead
      and here it is.  Verified by checking the generated assembly and tested
      with both a 32-bit and a 64-bit configuration, also with the 11AP
      "feature" forced on and verified with gdb on /proc/kcore to work as
      expected (as an 11AP machines are quite hard to get hands on these days).
      Some script complained about the use of "volatile", but apic_write() needs
      it for the same reason and is effectively a replacement for writel(), so I
      have disregarded it.
      
      I am not sure what the policy wrt defconfig files is, they are generated
      and there is risk of a conflict resulting from an unrelated change, so I
      have left changes to them out.  The option will get removed from them at
      the next run.
      
      Some testing with machines other than mine will be needed to avoid some
      stupid mistake, but despite its volume, the change is not really that
      intrusive, so I am fairly confident that because it works for me, it will
      everywhere.
      Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      593f4a78
  10. 16 Jul, 2008 4 commits
    • Ingo Molnar's avatar
      x86: paravirt spinlocks, !CONFIG_SMP build fixes · 4bb689ee
      Ingo Molnar authored
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4bb689ee
    • Jeremy Fitzhardinge's avatar
      paravirt: introduce a "lock-byte" spinlock implementation · 8efcbab6
      Jeremy Fitzhardinge authored
      Implement a version of the old spinlock algorithm, in which everyone
      spins waiting for a lock byte.  In order to be compatible with the
      ticket-lock's use of a zero initializer, this uses the convention of
      '0' for unlocked and '1' for locked.
      
      This algorithm is much better than ticket locks in a virtual
      envionment, because it doesn't interact badly with the vcpu scheduler.
      If there are multiple vcpus spinning on a lock and the lock is
      released, the next vcpu to be scheduled will take the lock, rather
      than cycling around until the next ticketed vcpu gets it.
      
      To use this, you must call paravirt_use_bytelocks() very early, before
      any spinlocks have been taken.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Lameter <clameter@linux-foundation.org>
      Cc: Petr Tesarik <ptesarik@suse.cz>
      Cc: Virtualization <virtualization@lists.linux-foundation.org>
      Cc: Xen devel <xen-devel@lists.xensource.com>
      Cc: Thomas Friebel <thomas.friebel@amd.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8efcbab6
    • Jeremy Fitzhardinge's avatar
      x86/paravirt: add hooks for spinlock operations · 74d4affd
      Jeremy Fitzhardinge authored
      Ticket spinlocks have absolutely ghastly worst-case performance
      characteristics in a virtual environment.  If there is any contention
      for physical CPUs (ie, there are more runnable vcpus than cpus), then
      ticket locks can cause the system to end up spending 90+% of its time
      spinning.
      
      The problem is that (v)cpus waiting on a ticket spinlock will be
      granted access to the lock in strict order they got their tickets.  If
      the hypervisor scheduler doesn't give the vcpus time in that order,
      they will burn timeslices waiting for the scheduler to give the right
      vcpu some time.  In the worst case it could take O(n^2) vcpu scheduler
      timeslices for everyone waiting on the lock to get it, not counting
      new cpus trying to take the lock while the log-jam is sorted out.
      
      These hooks allow a paravirt backend to replace the spinlock
      implementation.
      
      At the very least, this could revert the implementation back to the
      old lock algorithm, which allows the next scheduled vcpu to take the
      lock, and has basically fairly good performance.
      
      It also allows the spinlocks to take advantages of the hypervisor
      features to make locks more efficient (spin and block, for example).
      
      The cost to native execution is an extra direct call when using a
      spinlock function.  There's no overhead if CONFIG_PARAVIRT is turned
      off.
      
      The lock structure is fixed at a single "unsigned int", initialized to
      zero, but the spinlock implementation can use it as it wishes.
      
      Thanks to Thomas Friebel's Xen Summit talk "Preventing Guests from
      Spinning Around" for pointing out this problem.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Lameter <clameter@linux-foundation.org>
      Cc: Petr Tesarik <ptesarik@suse.cz>
      Cc: Virtualization <virtualization@lists.linux-foundation.org>
      Cc: Xen devel <xen-devel@lists.xensource.com>
      Cc: Thomas Friebel <thomas.friebel@amd.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      74d4affd
    • Jeremy Fitzhardinge's avatar
      xen64: save lots of registers · c24481e9
      Jeremy Fitzhardinge authored
      The Xen hypercall interface is allowed to trash any or all of the
      argument registers, so we need to be careful that the kernel state
      isn't damaged.  On 32-bit kernels, the hypercall parameter registers
      same as a regparm function call, so we've got away without explicit
      clobbering so far.  The 64-bit ABI defines lots of caller-save
      registers, so save them all for safety.  We can trim this set later by
      re-distributing the responsibility for saving all these registers.
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c24481e9
  11. 14 Jul, 2008 1 commit
  12. 12 Jul, 2008 2 commits
  13. 09 Jul, 2008 1 commit
  14. 08 Jul, 2008 9 commits
  15. 25 Jun, 2008 1 commit
  16. 20 Jun, 2008 1 commit
  17. 27 May, 2008 1 commit
  18. 24 Apr, 2008 2 commits
  19. 17 Apr, 2008 2 commits
  20. 30 Jan, 2008 2 commits