1. 29 10月, 2014 3 次提交
  2. 28 10月, 2014 2 次提交
    • M
      x86/irq: Fix XT-PIC-XT-PIC in /proc/interrupts · 60e684f0
      Maciej W. Rozycki 提交于
      Fix duplicate XT-PIC seen in /proc/interrupts on x86 systems
      that make  use of 8259A Programmable Interrupt Controllers.
      Specifically convert  output like this:
      
                 CPU0
        0:      76573    XT-PIC-XT-PIC    timer
        1:         11    XT-PIC-XT-PIC    i8042
        2:          0    XT-PIC-XT-PIC    cascade
        4:          8    XT-PIC-XT-PIC    serial
        6:          3    XT-PIC-XT-PIC    floppy
        7:          0    XT-PIC-XT-PIC    parport0
        8:          1    XT-PIC-XT-PIC    rtc0
       10:        448    XT-PIC-XT-PIC    fddi0
       12:         23    XT-PIC-XT-PIC    eth0
       14:       2464    XT-PIC-XT-PIC    ide0
      NMI:          0   Non-maskable interrupts
      ERR:          0
      
      to one like this:
      
                 CPU0
        0:     122033    XT-PIC  timer
        1:         11    XT-PIC  i8042
        2:          0    XT-PIC  cascade
        4:          8    XT-PIC  serial
        6:          3    XT-PIC  floppy
        7:          0    XT-PIC  parport0
        8:          1    XT-PIC  rtc0
       10:        145    XT-PIC  fddi0
       12:         31    XT-PIC  eth0
       14:       2245    XT-PIC  ide0
      NMI:          0   Non-maskable interrupts
      ERR:          0
      
      that is one like we used to have from ~2.2 till it was changed
      sometime.
      
      The rationale is there is no value in this duplicate
      information, it  merely clutters output and looks ugly.  We only
      have one handler for  8259A interrupts so there is no need to
      give it a name separate from the  name already given to
      irq_chip.
      
      We could define meaningful names for handlers based on bits in
      the ELCR  register on systems that have it or the value of the
      LTIM bit we use in  ICW1 otherwise (hardcoded to 0 though with
      MCA support gone), to tell  edge-triggered and level-triggered
      inputs apart.  While that information  does not affect 8259A
      interrupt handlers it could help people determine  which lines
      are shareable and which are not.  That is material for a
      separate change though.
      
      Any tools that parse /proc/interrupts are supposed not to be
      affected  since it was many years we used the format this change
      converts back to.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.11.1410260147190.21390@eddie.linux-mips.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      60e684f0
    • W
      x86, cma: Reserve DMA contiguous area after initmem_init() · 3c325f82
      Weijie Yang 提交于
      Fengguang Wu reported a boot crash on the x86 platform
      via the 0-day Linux Kernel Performance Test:
      
        cma: dma_contiguous_reserve: reserving 31 MiB for global area
        BUG: Int 6: CR2   (null)
        [<41850786>] dump_stack+0x16/0x18
        [<41d2b1db>] early_idt_handler+0x6b/0x6b
        [<41072227>] ? __phys_addr+0x2e/0xca
        [<41d4ee4d>] cma_declare_contiguous+0x3c/0x2d7
        [<41d6d359>] dma_contiguous_reserve_area+0x27/0x47
        [<41d6d4d1>] dma_contiguous_reserve+0x158/0x163
        [<41d33e0f>] setup_arch+0x79b/0xc68
        [<41d2b7cf>] start_kernel+0x9c/0x456
        [<41d2b2ca>] i386_start_kernel+0x79/0x7d
      
      (See details at: https://lkml.org/lkml/2014/10/8/708)
      
      It is because dma_contiguous_reserve() is called before
      initmem_init() in x86, the variable high_memory is not
      initialized but accessed by __pa(high_memory) in
      dma_contiguous_reserve().
      
      This patch moves dma_contiguous_reserve() after initmem_init()
      so that high_memory is initialized before accessed.
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NWeijie Yang <weijie.yang@samsung.com>
      Acked-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Cc: iamjoonsoo.kim@lge.com
      Cc: 'Linux-MM' <linux-mm@kvack.org>
      Cc: 'Weijie Yang' <weijie.yang.kh@gmail.com>
      Link: http://lkml.kernel.org/r/000101cfef69%2431e528a0%2495af79e0%24%25yang@samsung.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      3c325f82
  3. 25 10月, 2014 1 次提交
  4. 23 10月, 2014 1 次提交
  5. 20 10月, 2014 1 次提交
  6. 19 10月, 2014 2 次提交
  7. 17 10月, 2014 1 次提交
  8. 15 10月, 2014 1 次提交
    • A
      x86: bpf_jit: fix two bugs in eBPF JIT compiler · e0ee9c12
      Alexei Starovoitov 提交于
      1.
      JIT compiler using multi-pass approach to converge to final image size,
      since x86 instructions are variable length. It starts with large
      gaps between instructions (so some jumps may use imm32 instead of imm8)
      and iterates until total program size is the same as in previous pass.
      This algorithm works only if program size is strictly decreasing.
      Programs that use LD_ABS insn need additional code in prologue, but it
      was not emitted during 1st pass, so there was a chance that 2nd pass would
      adjust imm32->imm8 jump offsets to the same number of bytes as increase in
      prologue, which may cause algorithm to erroneously decide that size converged.
      Fix it by always emitting largest prologue in the first pass which
      is detected by oldproglen==0 check.
      Also change error check condition 'proglen != oldproglen' to fail gracefully.
      
      2.
      while staring at the code realized that 64-byte buffer may not be enough
      when 1st insn is large, so increase it to 128 to avoid buffer overflow
      (theoretical maximum size of prologue+div is 109) and add runtime check.
      
      Fixes: 62258278 ("net: filter: x86: internal BPF JIT")
      Reported-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Tested-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0ee9c12
  9. 14 10月, 2014 7 次提交
  10. 13 10月, 2014 1 次提交
  11. 10 10月, 2014 2 次提交
    • G
      nosave: consolidate __nosave_{begin,end} in <asm/sections.h> · 7f8998c7
      Geert Uytterhoeven 提交于
      The different architectures used their own (and different) declarations:
      
          extern __visible const void __nosave_begin, __nosave_end;
          extern const void __nosave_begin, __nosave_end;
          extern long __nosave_begin, __nosave_end;
      
      Consolidate them using the first variant in <asm/sections.h>.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7f8998c7
    • M
      mm: remove misleading ARCH_USES_NUMA_PROT_NONE · 6a33979d
      Mel Gorman 提交于
      ARCH_USES_NUMA_PROT_NONE was defined for architectures that implemented
      _PAGE_NUMA using _PROT_NONE.  This saved using an additional PTE bit and
      relied on the fact that PROT_NONE vmas were skipped by the NUMA hinting
      fault scanner.  This was found to be conceptually confusing with a lot of
      implicit assumptions and it was asked that an alternative be found.
      
      Commit c46a7c81 "x86: define _PAGE_NUMA by reusing software bits on the
      PMD and PTE levels" redefined _PAGE_NUMA on x86 to be one of the swap PTE
      bits and shrunk the maximum possible swap size but it did not go far
      enough.  There are no architectures that reuse _PROT_NONE as _PROT_NUMA
      but the relics still exist.
      
      This patch removes ARCH_USES_NUMA_PROT_NONE and removes some unnecessary
      duplication in powerpc vs the generic implementation by defining the types
      the core NUMA helpers expected to exist from x86 with their ppc64
      equivalent.  This necessitated that a PTE bit mask be created that
      identified the bits that distinguish present from NUMA pte entries but it
      is expected this will only differ between arches based on _PAGE_PROTNONE.
      The naming for the generic helpers was taken from x86 originally but ppc64
      has types that are equivalent for the purposes of the helper so they are
      mapped instead of duplicating code.
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      Reviewed-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a33979d
  12. 09 10月, 2014 2 次提交
  13. 08 10月, 2014 7 次提交
  14. 07 10月, 2014 1 次提交
    • A
      x86_64, entry: Filter RFLAGS.NT on entry from userspace · 8c7aa698
      Andy Lutomirski 提交于
      The NT flag doesn't do anything in long mode other than causing IRET
      to #GP.  Oddly, CPL3 code can still set NT using popf.
      
      Entry via hardware or software interrupt clears NT automatically, so
      the only relevant entries are fast syscalls.
      
      If user code causes kernel code to run with NT set, then there's at
      least some (small) chance that it could cause trouble.  For example,
      user code could cause a call to EFI code with NT set, and who knows
      what would happen?  Apparently some games on Wine sometimes do
      this (!), and, if an IRET return happens, they will segfault.  That
      segfault cannot be handled, because signal delivery fails, too.
      
      This patch programs the CPU to clear NT on entry via SYSCALL (both
      32-bit and 64-bit, by my reading of the AMD APM), and it clears NT
      in software on entry via SYSENTER.
      
      To save a few cycles, this borrows a trick from Jan Beulich in Xen:
      it checks whether NT is set before trying to clear it.  As a result,
      it seems to have very little effect on SYSENTER performance on my
      machine.
      
      There's another minor bug fix in here: it looks like the CFI
      annotations were wrong if CONFIG_AUDITSYSCALL=n.
      
      Testers beware: on Xen, SYSENTER with NT set turns into a GPF.
      
      I haven't touched anything on 32-bit kernels.
      
      The syscall mask change comes from a variant of this patch by Anish
      Bhatt.
      
      Note to stable maintainers: there is no known security issue here.
      A misguided program can set NT and cause the kernel to try and fail
      to deliver SIGSEGV, crashing the program.  This patch fixes Far Cry
      on Wine: https://bugs.winehq.org/show_bug.cgi?id=33275
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NAnish Bhatt <anish@chelsio.com>
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Link: http://lkml.kernel.org/r/395749a5d39a29bd3e4b35899cf3a3c1340e5595.1412189265.git.luto@amacapital.netSigned-off-by: NH. Peter Anvin <hpa@zytor.com>
      8c7aa698
  15. 06 10月, 2014 1 次提交
  16. 03 10月, 2014 6 次提交
  17. 02 10月, 2014 1 次提交