1. 15 5月, 2016 1 次提交
    • Z
      arm64: bpf: jit JMP_JSET_{X,K} · 98397fc5
      Zi Shen Lim 提交于
      Original implementation commit e54bcde3 ("arm64: eBPF JIT compiler")
      had the relevant code paths, but due to an oversight always fail jiting.
      
      As a result, we had been falling back to BPF interpreter whenever a BPF
      program has JMP_JSET_{X,K} instructions.
      
      With this fix, we confirm that the corresponding tests in lib/test_bpf
      continue to pass, and also jited.
      
      ...
      [    2.784553] test_bpf: #30 JSET jited:1 188 192 197 PASS
      [    2.791373] test_bpf: #31 tcpdump port 22 jited:1 325 677 625 PASS
      [    2.808800] test_bpf: #32 tcpdump complex jited:1 323 731 991 PASS
      ...
      [    3.190759] test_bpf: #237 JMP_JSET_K: if (0x3 & 0x2) return 1 jited:1 110 PASS
      [    3.192524] test_bpf: #238 JMP_JSET_K: if (0x3 & 0xffffffff) return 1 jited:1 98 PASS
      [    3.211014] test_bpf: #249 JMP_JSET_X: if (0x3 & 0x2) return 1 jited:1 120 PASS
      [    3.212973] test_bpf: #250 JMP_JSET_X: if (0x3 & 0xffffffff) return 1 jited:1 89 PASS
      ...
      
      Fixes: e54bcde3 ("arm64: eBPF JIT compiler")
      Signed-off-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NYang Shi <yang.shi@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98397fc5
  2. 12 5月, 2016 6 次提交
  3. 11 5月, 2016 4 次提交
  4. 10 5月, 2016 2 次提交
  5. 07 5月, 2016 1 次提交
  6. 06 5月, 2016 6 次提交
    • D
      parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls · f0b22d1b
      Dmitry V. Levin 提交于
      Do not load one entry beyond the end of the syscall table when the
      syscall number of a traced process equals to __NR_Linux_syscalls.
      Similar bug with regular processes was fixed by commit 3bb457af
      ("[PARISC] Fix bug when syscall nr is __NR_Linux_syscalls").
      
      This bug was found by strace test suite.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
      Acked-by: NHelge Deller <deller@gmx.de>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      f0b22d1b
    • C
      x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO · 886123fb
      Chen Yu 提交于
      Currently we read the tsc radio: ratio = (MSR_PLATFORM_INFO >> 8) & 0x1f;
      
      Thus we get bit 8-12 of MSR_PLATFORM_INFO, however according to the SDM
      (35.5), the ratio bits are bit 8-15.
      
      Ignoring the upper bits can result in an incorrect tsc ratio, which causes the
      TSC calibration and the Local APIC timer frequency to be incorrect.
      
      Fix this problem by masking 0xff instead.
      
      [ tglx: Massaged changelog ]
      
      Fixes: 7da7c156 "x86, tsc: Add static (MSR) TSC calibration on Intel Atom SoCs"
      Signed-off-by: NChen Yu <yu.c.chen@intel.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: stable@vger.kernel.org
      Cc: Bin Gao <bin.gao@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: http://lkml.kernel.org/r/1462505619-5516-1-git-send-email-yu.c.chen@intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      886123fb
    • A
      mm: thp: kvm: fix memory corruption in KVM with THP enabled · 127393fb
      Andrea Arcangeli 提交于
      After the THP refcounting change, obtaining a compound pages from
      get_user_pages() no longer allows us to assume the entire compound page
      is immediately mappable from a secondary MMU.
      
      A secondary MMU doesn't want to call get_user_pages() more than once for
      each compound page, in order to know if it can map the whole compound
      page.  So a secondary MMU needs to know from a single get_user_pages()
      invocation when it can map immediately the entire compound page to avoid
      a flood of unnecessary secondary MMU faults and spurious
      atomic_inc()/atomic_dec() (pages don't have to be pinned by MMU notifier
      users).
      
      Ideally instead of the page->_mapcount < 1 check, get_user_pages()
      should return the granularity of the "page" mapping in the "mm" passed
      to get_user_pages().  However it's non trivial change to pass the "pmd"
      status belonging to the "mm" walked by get_user_pages up the stack (up
      to the caller of get_user_pages).  So the fix just checks if there is
      not a single pte mapping on the page returned by get_user_pages, and in
      turn if the caller can assume that the whole compound page is mapped in
      the current "mm" (in a pmd_trans_huge()).  In such case the entire
      compound page is safe to map into the secondary MMU without additional
      get_user_pages() calls on the surrounding tail/head pages.  In addition
      of being faster, not having to run other get_user_pages() calls also
      reduces the memory footprint of the secondary MMU fault in case the pmd
      split happened as result of memory pressure.
      
      Without this fix after a MADV_DONTNEED (like invoked by QEMU during
      postcopy live migration or balloning) or after generic swapping (with a
      failure in split_huge_page() that would only result in pmd splitting and
      not a physical page split), KVM would map the whole compound page into
      the shadow pagetables, despite regular faults or userfaults (like
      UFFDIO_COPY) may map regular pages into the primary MMU as result of the
      pte faults, leading to the guest mode and userland mode going out of
      sync and not working on the same memory at all times.
      
      Any other secondary MMU notifier manager (KVM is just one of the many
      MMU notifier users) will need the same information if it doesn't want to
      run a flood of get_user_pages_fast and it can support multiple
      granularity in the secondary MMU mappings, so I think it is justified to
      be exposed not just to KVM.
      
      The other option would be to move transparent_hugepage_adjust to
      mm/huge_memory.c but that currently has all kind of KVM data structures
      in it, so it's definitely not a cut-and-paste work, so I couldn't do a
      fix as cleaner as this one for 4.6.
      Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
      Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
      Cc: "Li, Liang Z" <liang.z.li@intel.com>
      Cc: Amit Shah <amit.shah@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      127393fb
    • V
      ARM: 8573/1: domain: move {set,get}_domain under config guard · ec953b70
      Vladimir Murzin 提交于
      Recursive undefined instrcution falut is seen with R-class taking an
      exception. The reson for that is __show_regs() tries to get domain
      information, but domains is not available on !MMU cores, like R/M
      class.
      
      Fix it by puting {set,get}_domain functions under CONFIG_CPU_CP15_MMU
      guard and providing stubs for the case where domains is not supported.
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      ec953b70
    • J
      ARM: 8572/1: nommu: change memory reserve for the vectors · 5b526bd9
      Jean-Philippe Brucker 提交于
      Commit 19accfd3 (ARM: move vector stubs) moved the vector stubs in an
      additional page above the base vector one. This change wasn't taken into
      account by the nommu memreserve.
      This patch ensures that the kernel won't overwrite any vector stub on
      nommu.
      
      [changed the MPU side too]
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      5b526bd9
    • J
      ARM: 8571/1: nommu: fix PMSAv7 setup · 695665b0
      Jean-Philippe Brucker 提交于
      Commit 1c2f87c2 (ARM: 8025/1: Get rid of meminfo) broke the support for
      MPU on ARMv7-R. This patch adapts the code inside CONFIG_ARM_MPU to use
      memblocks appropriately.
      
      MPU initialisation only uses the first memory region, and removes all
      subsequent ones. Because looping over all regions that need removal is
      inefficient, and memblock_remove already handles memory ranges, we can
      flatten the 'for_each_memblock' part.
      Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      695665b0
  7. 05 5月, 2016 7 次提交
    • W
      x86/sysfb_efi: Fix valid BAR address range check · c10fcb14
      Wang YanQing 提交于
      The code for checking whether a BAR address range is valid will break
      out of the loop when a start address of 0x0 is encountered.
      
      This behaviour is wrong since by breaking out of the loop we may miss
      the BAR that describes the EFI frame buffer in a later iteration.
      
      Because of this bug I can't use video=efifb: boot parameter to get
      efifb on my new ThinkPad E550 for my old linux system hard disk with
      3.10 kernel. In 3.10, efifb is the only choice due to DRM/I915 not
      supporting the GPU.
      
      This patch also add a trivial optimization to break out after we find
      the frame buffer address range without testing later BARs.
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      [ Rewrote changelog. ]
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: NPeter Jones <pjones@redhat.com>
      Cc: <stable@vger.kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1462454061-21561-2-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c10fcb14
    • V
      ARC: support HIGHMEM even without PAE40 · 26f9d5fd
      Vineet Gupta 提交于
      Initial HIGHMEM support on ARC was introduced for PAE40 where the low
      memory (0x8000_0000 based) and high memory (0x1_0000_0000) were
      physically contiguous. So CONFIG_FLATMEM sufficed (despite a peipheral
      hole in the middle, which wasted a bit of struct page memory, but things
      worked).
      
      However w/o PAE, highmem was not possible and we could only reach
      ~1.75GB of DDR. Now there is a use case to access ~4GB of DDR w/o PAE40
      The idea is to have low memory at canonical 0x8000_0000 and highmem
      at 0 so enire 4GB address space is available for physical addressing
      This needs additional platform/interconnect mapping to convert
      the non contiguous physical addresses into linear bus adresses.
      
      From Linux point of view, non contiguous divide means FLATMEM no
      longer works and DISCONTIGMEM is needed to track the pfns in the 2
      regions.
      
      This scheme would also work for PAE40, only better in that we don't
      waste struct page memory for the peripheral hole.
      
      The DT description will be something like
      
          memory {
              ...
              reg = <0x80000000 0x200000000   /* 512MB: lowmem */
                     0x00000000 0x10000000>;  /* 256MB: highmem */
         }
      Signed-off-by: NNoam Camus <noamc@ezchip.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      26f9d5fd
    • V
      ARC: Fix PAE40 boot failures due to PTE truncation · 2519d753
      Vineet Gupta 提交于
      So a benign looking cleanup which macro'ized PAGE_SHIFT shifts turned
      out to be bad (since it was done non-sensically across the board).
      
      It caused boot failures with PAE40 as forced cast to (unsigned long)
      from newly introduced virt_to_pfn() was causing truncatiion of the
      (long long) pte/paddr values.
      
      It is OK to use this in accessors dealing with kernel virtual address,
      pointers etc, but not for PTE values themelves.
      
      Fixes: cJ2ff5cf2735c ("ARC: mm: Use virt_to_pfn() for addr >> PAGE_SHIFT pattern)
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      2519d753
    • V
      ARC: Add missing io barriers to io{read,write}{16,32}be() · e5bc0478
      Vineet Gupta 提交于
      While reviewing a different change to asm-generic/io.h Arnd spotted that
      ARC ioread32 and ioread32be both of which come from asm-generic versions
      are not symmetrical in terms of calling the io barriers.
      
      generic ioread32   -> ARC readl()                  [ has barriers]
      generic ioread32be -> __be32_to_cpu(__raw_readl()) [ lacks barriers]
      
      While generic ioread32be is being remediated to call readl(), that involves
      a swab32(), causing double swaps on ioread32be() on Big Endian systems.
      
      So provide our versions of big endian IO accessors to ensure io barrier
      calls while also keeping them optimal
      Suggested-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Cc: stable@vger.kernel.org  [4.2+]
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      e5bc0478
    • P
      perf/x86/amd/iommu: Do not register a task ctx for uncore like PMUs · 8482716b
      Peter Zijlstra 提交于
      The new sanity check introduced by:
      
        26657848 ("perf/core: Verify we have a single perf_hw_context PMU")
      
      ... triggered on the AMD IOMMU driver.
      
      IOMMUs are not per logical CPU, they cannot have per-task counters. Fix it.
      Reported-by: NBorislav Petkov <bp@alien8.de>
      Tested-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: jroedel@suse.de
      Cc: suravee.suthikulpanit@amd.com
      Link: http://lkml.kernel.org/r/20160423224255.GB3430@twins.programming.kicks-ass.netSigned-off-by: NIngo Molnar <mingo@kernel.org>
      8482716b
    • A
      x86/platform/UV: Bring back the call to map_low_mmrs in uv_system_init · 08914f43
      Alex Thorlton 提交于
      A while back the following commit:
      
        d394f2d9 ("x86/platform/UV: Remove EFI memmap quirk for UV2+")
      
      changed uv_system_init() to only call map_low_mmrs() on older UV1 hardware,
      which requires EFI_OLD_MEMMAP to be set in order to boot.
      
      The recent changes to the EFI memory mapping code in:
      
        d2f7cbe7 ("x86/efi: Runtime services virtual mapping")
      
      exposed some issues with the fact that we were relying on the EFI memory
      mapping mechanisms to map in our MMRs for us, after commit d394f2d9.
      
      Rather than revert the entire commit and go back to forcing
      EFI_OLD_MEMMAP on all UVs, we're going to add the call to map_low_mmrs()
      back into uv_system_init(), and then fix up our EFI runtime calls to use
      the appropriate page table.
      
      For now, UV2+ will still need efi=old_map to boot, but there will be
      other changes soon that should eliminate the need for this.
      Signed-off-by: NAlex Thorlton <athorlton@sgi.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Russ Anderson <rja@sgi.com>
      Cc: Dimitri Sivanich <sivanich@sgi.com>
      Link: http://lkml.kernel.org/r/1462401592-120735-1-git-send-email-athorlton@sgi.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      08914f43
    • A
      perf/x86: Add model numbers for Kabylake CPUs · cba1b379
      Andi Kleen 提交于
      Everything the same as Skylake, just new model numbers.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461977748-17616-1-git-send-email-andi@firstfloor.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      cba1b379
  8. 04 5月, 2016 1 次提交
    • J
      x86/efi-bgrt: Switch all pr_err() to pr_notice() for invalid BGRT · 7f9b474c
      Josh Boyer 提交于
      The promise of pretty boot splashes from firmware via BGRT was at
      best only that; a promise.  The kernel diligently checks to make
      sure the BGRT data firmware gives it is valid, and dutifully warns
      the user when it isn't.  However, it does so via the pr_err log
      level which seems unnecessary.  The user cannot do anything about
      this and there really isn't an error on the part of Linux to
      correct.
      
      This lowers the log level by using pr_notice instead.  Users will
      no longer have their boot process uglified by the kernel reminding
      us that firmware can and often is broken when the 'quiet' kernel
      parameter is specified.  Ironic, considering BGRT is supposed to
      make boot pretty to begin with.
      Signed-off-by: NJosh Boyer <jwboyer@fedoraproject.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Môshe van der Sterre <me@moshe.nl>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1462303781-8686-4-git-send-email-matt@codeblueprint.co.ukSigned-off-by: NIngo Molnar <mingo@kernel.org>
      7f9b474c
  9. 03 5月, 2016 1 次提交
    • S
      signals/sigaltstack, x86/signals: Unify the x86 sigaltstack check with other architectures · 0b4521e8
      Stas Sergeev 提交于
      Currently x86's get_sigframe() checks for "current->sas_ss_size"
      to determine whether there is a need to switch to sigaltstack.
      The common practice used by all other arches is to check for
      sas_ss_flags(sp) == 0
      
      This patch makes the code consistent with other architectures.
      
      The slight complexity of the patch is added by the optimization on
      !sigstack check that was requested by Andy Lutomirski: sas_ss_flags(sp)==0
      already implies that we are not on a sigstack, so the code is shuffled
      to avoid the duplicate checking.
      
      This patch should have no user-visible impact.
      Signed-off-by: NStas Sergeev <stsp@list.ru>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1460665206-13646-2-git-send-email-stsp@list.ruSigned-off-by: NIngo Molnar <mingo@kernel.org>
      0b4521e8
  10. 02 5月, 2016 1 次提交
    • A
      powerpc: Fix bad inline asm constraint in create_zero_mask() · b4c11211
      Anton Blanchard 提交于
      In create_zero_mask() we have:
      
      	addi	%1,%2,-1
      	andc	%1,%1,%2
      	popcntd	%0,%1
      
      using the "r" constraint for %2. r0 is a valid register in the "r" set,
      but addi X,r0,X turns it into an li:
      
      	li	r7,-1
      	andc	r7,r7,r0
      	popcntd	r4,r7
      
      Fix this by using the "b" constraint, for which r0 is not a valid
      register.
      
      This was found with a kernel build using gcc trunk, narrowed down to
      when -frename-registers was enabled at -O2. It is just luck however
      that we aren't seeing this on older toolchains.
      
      Thanks to Segher for working with me to find this issue.
      
      Cc: stable@vger.kernel.org
      Fixes: d0cebfa6 ("powerpc: word-at-a-time optimization for 64-bit Little Endian")
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b4c11211
  11. 30 4月, 2016 1 次提交
    • A
      ARM: davinci: only use NVMEM when available · 04b9665b
      Arnd Bergmann 提交于
      The davinci platform contains code that calls into the nvmem
      subsystem, but that might be a loadable module, causing a
      link error:
      
      arch/arm/mach-davinci/built-in.o: In function `davinci_get_mac_addr':
      :(.text+0x1088): undefined reference to `nvmem_device_read'
      arch/arm/mach-davinci/built-in.o: In function `read_factory_config':
      :(.text+0x214c): undefined reference to `nvmem_device_read'
      
      Also, when NVMEM is completely disabled, the functions fail with
      nonobvious error messages.
      
      This ensures we only call the API functions when the code is actually
      reachable from the board file, and otherwise prints a unique log
      message.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: bec3c11b ("misc: at24: replace memory_accessor with nvmem_device_read")
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NKevin Hilman <khilman@baylibre.com>
      04b9665b
  12. 28 4月, 2016 9 次提交