Skip to content
  1. Nov 01, 2013
  2. Sep 28, 2013
  3. Sep 27, 2013
  4. Sep 25, 2013
    • Jayachandran C's avatar
      MIPS: mm: Move some checks out of 'for' loop in DMA operations · 55c25c2f
      Jayachandran C authored
      
      
      The check cpu_needs_post_dma_flush() in mips_dma_sync_sg_for_cpu() and
      the check !plat_device_is_coherent() in mips_dma_sync_sg_for_device()
      can be moved outside the for loop.
      
      As a side effect, this also avoids a GCC bug that caused kernel compile
      to fail with the error:
      
      arch/mips/mm/dma-default.c: In function 'mips_dma_sync_sg_for_cpu':
      arch/mips/mm/dma-default.c:316:1: internal compiler error: in add_insn_before, at emit-rtl.c:3852
      
      This gcc failure is seen in Code Sourcery toolchains [e.g. gcc version
      4.7.2 (Sourcery CodeBench Lite 2012.09-99)] after commit "MIPS: Optimize
      current_cpu_type() for better code."
      
      Signed-off-by: default avatarJayachandran C <jchandra@broadcom.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/5907/
      
      
      Reviewed-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Tested-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      55c25c2f
    • David Vrabel's avatar
      xen/p2m: check MFN is in range before using the m2p table · 0160676b
      David Vrabel authored
      
      
      On hosts with more than 168 GB of memory, a 32-bit guest may attempt
      to grant map an MFN that is error cannot lookup in its mapping of the
      m2p table.  There is an m2p lookup as part of m2p_add_override() and
      m2p_remove_override().  The lookup falls off the end of the mapped
      portion of the m2p and (because the mapping is at the highest virtual
      address) wraps around and the lookup causes a fault on what appears to
      be a user space address.
      
      do_page_fault() (thinking it's a fault to a userspace address), tries
      to lock mm->mmap_sem.  If the gntdev device is used for the grant map,
      m2p_add_override() is called from from gnttab_mmap() with mm->mmap_sem
      already locked.  do_page_fault() then deadlocks.
      
      The deadlock would most commonly occur when a 64-bit guest is started
      and xenconsoled attempts to grant map its console ring.
      
      Introduce mfn_to_pfn_no_overrides() which checks the MFN is within the
      mapped portion of the m2p table before accessing the table and use
      this in m2p_add_override(), m2p_remove_override(), and mfn_to_pfn()
      (which already had the correct range check).
      
      All faults caused by accessing the non-existant parts of the m2p are
      thus within the kernel address space and exception_fixup() is called
      without trying to lock mm->mmap_sem.
      
      This means that for MFNs that are outside the mapped range of the m2p
      then mfn_to_pfn() will always look in the m2p overrides.  This is
      correct because it must be a foreign MFN (and the PFN in the m2p in
      this case is only relevant for the other domain).
      
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Cc: Stefano Stabellini <stefano.stabellini@citrix.com>
      Cc: Jan Beulich <JBeulich@suse.com>
      --
      v3: check for auto_translated_physmap in mfn_to_pfn_no_overrides()
      v2: in mfn_to_pfn() look in m2p_overrides if the MFN is out of
          range as it's probably foreign.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      0160676b
    • Dave Jones's avatar
      x86/reboot: Fix apparent cut-n-paste mistake in Dell reboot workaround · 7a20c2fa
      Dave Jones authored
      
      
      This seems to have been copied from the Optiplex 990 entry
      above, but somoene forgot to change the ident text.
      
      Signed-off-by: default avatarDave Jones <davej@fedoraproject.org>
      Link: http://lkml.kernel.org/r/20130925001344.GA13554@redhat.com
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7a20c2fa
    • Benjamin Herrenschmidt's avatar
      powerpc/pseries: Do not start secondaries in Open Firmware · dbe78b40
      Benjamin Herrenschmidt authored
      
      
      Starting secondary CPUs early on from Open Firmware and placing them
      in a holding spin loop slows down the boot process significantly under
      some hypervisors such as KVM.
      
      This is also unnecessary when RTAS supports querying the CPU state
      
      So let's not do it.
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      dbe78b40
    • Benjamin Herrenschmidt's avatar
      powerpc/zImage: make the "OF" wrapper support ePAPR boot · 0c9fa291
      Benjamin Herrenschmidt authored
      
      
      This makes the "OF" zImage wrapper (zImage.pseries, zImage.pmac,
      zImage.maple) work if booted via a flat device-tree (ePAPR boot
      mode), and thus potentially usable with kexec.
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0c9fa291
    • Benjamin Herrenschmidt's avatar
      powerpc: Remove ksp_limit on ppc64 · cbc9565e
      Benjamin Herrenschmidt authored
      
      
      We've been keeping that field in thread_struct for a while, it contains
      the "limit" of the current stack pointer and is meant to be used for
      detecting stack overflows.
      
      It has a few problems however:
      
       - First, it was never actually *used* on 64-bit. Set and updated but
      not actually exploited
      
       - When switching stack to/from irq and softirq stacks, it's update
      is racy unless we hard disable interrupts, which is costly. This
      is fine on 32-bit as we don't soft-disable there but not on 64-bit.
      
      Thus rather than fixing 2 in order to implement 1 in some hypothetical
      future, let's remove the code completely from 64-bit. In order to avoid
      a clutter of ifdef's, we remove the updates from C code completely
      during interrupt stack switching, and instead maintain it from the
      asm helper that is used to do the stack switching in the first place.
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      cbc9565e
    • Benjamin Herrenschmidt's avatar
      powerpc/irq: Run softirqs off the top of the irq stack · 0366a1c7
      Benjamin Herrenschmidt authored
      
      
      Nowadays, irq_exit() calls __do_softirq() pretty much directly
      instead of calling do_softirq() which switches to the decicated
      softirq stack.
      
      This has lead to observed stack overflows on powerpc since we call
      irq_enter() and irq_exit() outside of the scope that switches to
      the irq stack.
      
      This fixes it by moving the stack switching up a level, making
      irq_enter() and irq_exit() run off the irq stack.
      
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0366a1c7
    • Rob Herring's avatar
      openrisc: clean-up prom.h · ede2033c
      Rob Herring authored
      
      
      Clean-up some copy/paste declarations that are not necessary. All the
      functions either don't exist or are already declared in other headers.
      This is needed in preparation of of_irq.h clean-up.
      
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: linux@lists.openrisc.net
      ede2033c
    • Konrad Rzeszutek Wilk's avatar
      xen: Do not enable spinlocks before jump_label_init() has executed · a945928e
      Konrad Rzeszutek Wilk authored
      
      
      xen_init_spinlocks() currently calls static_key_slow_inc() before
      jump_label_init() is invoked. When CONFIG_JUMP_LABEL is set (which usually is
      the case) the effect of this static_key_slow_inc() is deferred until after
      jump_label_init(). This is different from when CONFIG_JUMP_LABEL is not set, in
      which case the key is set immediately. Thus, depending on the value of config
      option, we may observe different behavior.
      
      In addition, when we come to __jump_label_transform() from jump_label_init(),
      the key (paravirt_ticketlocks_enabled) is already enabled. On processors where
      ideal_nop is not the same as default_nop this will cause a BUG() since it is
      expected that before a key is enabled the latter is replaced by the former
      during initialization.
      
      To address this problem we need to move
      static_key_slow_inc(&paravirt_ticketlocks_enabled) so that it is called
      after jump_label_init(). We also need to make sure that this is done before
      other cpus start to boot. early_initcall appears to be  a good place to do so.
      (Note that we cannot move whole xen_init_spinlocks() there since pv_lock_ops
      need to be set before alternative_instructions() runs.)
      
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v2: Added extra comments in the code]
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a945928e
  5. Sep 24, 2013
  6. Sep 23, 2013
  7. Sep 22, 2013
  8. Sep 20, 2013
  9. Sep 19, 2013