1. 17 8月, 2011 1 次提交
    • J
      xen/x86: replace order-based range checking of M2P table by linear one · ccbcdf7c
      Jan Beulich 提交于
      The order-based approach is not only less efficient (requiring a shift
      and a compare, typical generated code looking like this
      
      	mov	eax, [machine_to_phys_order]
      	mov	ecx, eax
      	shr	ebx, cl
      	test	ebx, ebx
      	jnz	...
      
      whereas a direct check requires just a compare, like in
      
      	cmp	ebx, [machine_to_phys_nr]
      	jae	...
      
      ), but also slightly dangerous in the 32-on-64 case - the element
      address calculation can wrap if the next power of two boundary is
      sufficiently far away from the actual upper limit of the table, and
      hence can result in user space addresses being accessed (with it being
      unknown what may actually be mapped there).
      
      Additionally, the elimination of the mistaken use of fls() here (should
      have been __fls()) fixes a latent issue on x86-64 that would trigger
      if the code was run on a system with memory extending beyond the 44-bit
      boundary.
      
      CC: stable@kernel.org
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      [v1: Based on Jeremy's feedback]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      ccbcdf7c
  2. 05 8月, 2011 4 次提交
  3. 29 7月, 2011 1 次提交
  4. 28 7月, 2011 16 次提交
  5. 27 7月, 2011 16 次提交
  6. 26 7月, 2011 2 次提交
    • M
      Revert "microblaze: PCI fix typo fault in of_node pointer moving into pci_bus" · 6dbd3085
      Michal Simek 提交于
      This reverts commit c9d761b7.
      
      Ben' commit "microblaze/pci: Move the remains of pci_32.c to pci-common.c"
      (sha1: bf13a6fa)
      completely removed pci_32.c that's why my fixing commit caused
      the problem with merging and need to be revert.
      Signed-off-by: NMichal Simek <monstr@monstr.eu>
      6dbd3085
    • D
      MIPS: Close races in TLB modify handlers. · bf28607f
      David Daney 提交于
      Page table entries are made invalid by writing a zero into the the PTE
      slot in a page table.  This creates a race condition with the TLB
      modify handlers when they are updating the PTE.
      
      CPU0                              CPU1
      
      Test for _PAGE_PRESENT
      .                                 set to not _PAGE_PRESENT (zero)
      Set to _PAGE_VALID
      
      So now the page not present value (zero) is suddenly valid and user
      space programs have access to physical page zero.
      
      We close the race by putting the test for _PAGE_PRESENT and setting of
      _PAGE_VALID into an atomic LL/SC section.  This requires more registers
      than just K0 and K1 in the handlers, so we need to save some registers
      to a save area and then restore them when we are done.
      
      The save area is an array of cacheline aligned structures that should
      not suffer cache line bouncing as they are CPU private.
      
      [ralf@linux-mips.org: Fix !defined(CONFIG_MIPS_PGD_C0_CONTEXT) build error.]
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      To: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/2577/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      bf28607f