1. 22 5月, 2018 1 次提交
    • M
      arm_pmu: simplify arm_pmu::handle_irq · 0788f1e9
      Mark Rutland 提交于
      The arm_pmu::handle_irq() callback has the same prototype as a generic
      IRQ handler, taking the IRQ number and a void pointer argument which it
      must convert to an arm_pmu pointer.
      
      This means that all arm_pmu::handle_irq() take an IRQ number they never
      use, and all must explicitly cast the void pointer to an arm_pmu
      pointer.
      
      Instead, let's change arm_pmu::handle_irq to take an arm_pmu pointer,
      allowing these casts to be removed. The redundant IRQ number parameter
      is also removed.
      Suggested-by: NHoeun Ryu <hoeun.ryu@lge.com>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0788f1e9
  2. 03 4月, 2018 1 次提交
  3. 24 3月, 2018 1 次提交
  4. 10 3月, 2018 7 次提交
  5. 22 2月, 2018 1 次提交
    • I
      treewide/trivial: Remove ';;$' typo noise · ed7158ba
      Ingo Molnar 提交于
      On lkml suggestions were made to split up such trivial typo fixes into per subsystem
      patches:
      
        --- a/arch/x86/boot/compressed/eboot.c
        +++ b/arch/x86/boot/compressed/eboot.c
        @@ -439,7 +439,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height)
                struct efi_uga_draw_protocol *uga = NULL, *first_uga;
                efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
                unsigned long nr_ugas;
        -       u32 *handles = (u32 *)uga_handle;;
        +       u32 *handles = (u32 *)uga_handle;
                efi_status_t status = EFI_INVALID_PARAMETER;
                int i;
      
      This patch is the result of the following script:
      
        $ sed -i 's/;;$/;/g' $(git grep -E ';;$'  | grep "\.[ch]:"  | grep -vwE 'for|ia64' | cut -d: -f1 | sort | uniq)
      
      ... followed by manual review to make sure it's all good.
      
      Splitting this up is just crazy talk, let's get over with this and just do it.
      Reported-by: NPavel Machek <pavel@ucw.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ed7158ba
  6. 23 1月, 2018 1 次提交
    • E
      signal/ptrace: Add force_sig_ptrace_errno_trap and use it where needed · f71dd7dc
      Eric W. Biederman 提交于
      There are so many places that build struct siginfo by hand that at
      least one of them is bound to get it wrong.  A handful of cases in the
      kernel arguably did just that when using the errno field of siginfo to
      pass no errno values to userspace.  The usage is limited to a single
      si_code so at least does not mess up anything else.
      
      Encapsulate this questionable pattern in a helper function so
      that the userspace ABI is preserved.
      
      Update all of the places that use this pattern to use the new helper
      function.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      f71dd7dc
  7. 21 1月, 2018 2 次提交
  8. 05 1月, 2018 2 次提交
  9. 19 12月, 2017 1 次提交
    • B
      PCI: Remove PCI_REASSIGN_ALL_RSRC use on arm and arm64 · 7153884c
      Bjorn Helgaas 提交于
      On arm, PCI_REASSIGN_ALL_RSRC is used only in pcibios_assign_all_busses(),
      which helps decide whether to reconfigure bridge bus numbers.  It has
      nothing to do with BAR assignments.  On arm64 and powerpc,
      pcibios_assign_all_busses() tests PCI_REASSIGN_ALL_BUS, which makes more
      sense.
      
      Align arm with arm64 and powerpc, so they all use PCI_REASSIGN_ALL_BUS for
      pcibios_assign_all_busses().
      
      Remove PCI_REASSIGN_ALL_RSRC from the generic, Tegra, Versatile, and
      R-Car drivers.  These drivers are used only on arm or arm64, where
      PCI_REASSIGN_ALL_RSRC is not used after this change, so removing it
      should have no effect.
      
      No functional change intended.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NManikanta Maddireddy <mmaddireddy@nvidia.com>
      Reviewed-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      7153884c
  10. 18 12月, 2017 2 次提交
  11. 27 11月, 2017 1 次提交
    • R
      ARM: avoid faulting on qemu · 3aaf33be
      Russell King 提交于
      When qemu starts a kernel in a bare environment, the default SCR has
      the AW and FW bits clear, which means that the kernel can't modify
      the PSR A or PSR F bits, and means that FIQs and imprecise aborts are
      always masked.
      
      When running uboot under qemu, the AW and FW SCR bits are set, and the
      kernel functions normally - and this is how real hardware behaves.
      
      Fix this for qemu by ignoring the FIQ bit.
      
      Fixes: 8bafae20 ("ARM: BUG if jumping to usermode address in kernel mode")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      3aaf33be
  12. 26 11月, 2017 1 次提交
  13. 06 11月, 2017 2 次提交
  14. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  15. 29 10月, 2017 2 次提交
  16. 23 10月, 2017 3 次提交
  17. 14 10月, 2017 1 次提交
  18. 12 10月, 2017 3 次提交
  19. 29 9月, 2017 1 次提交
    • R
      ARM: better diagnostics with missing/corrupt dtb · 99cf8f90
      Russell King 提交于
      With a kernel containing both DT and atag support, the diagnostics
      output when the dtb is missing or corrupt assume that we're trying
      to boot using atags and the machine ID, and only print the machine
      ID.  This is not useful for diagnosing a missing or corrupt dtb.
      
      Move the message into arch/arm/kernel/setup.c, and print the address
      of the dtb/atag list, and the first 16 bytes of memory of the dtb or
      atag list.
      
      This allows us to see whether the dtb was corrupted in some way,
      causing the fallback to the machine ID / atag list.
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      99cf8f90
  20. 28 9月, 2017 1 次提交
  21. 18 9月, 2017 2 次提交
    • T
      arm/syscalls: Optimize address limit check · e33f8d32
      Thomas Garnier 提交于
      Disable the generic address limit check in favor of an architecture
      specific optimized implementation. The generic implementation using
      pending work flags did not work well with ARM and alignment faults.
      
      The address limit is checked on each syscall return path to user-mode
      path as well as the irq user-mode return function. If the address limit
      was changed, a function is called to report data corruption (stopping
      the kernel or process based on configuration).
      
      The address limit check has to be done before any pending work because
      they can reset the address limit and the process is killed using a
      SIGKILL signal. For example the lkdtm address limit check does not work
      because the signal to kill the process will reset the user-mode address
      limit.
      Signed-off-by: NThomas Garnier <thgarnie@google.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Tested-by: NKees Cook <keescook@chromium.org>
      Tested-by: NLeonard Crestez <leonard.crestez@nxp.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Pratyush Anand <panand@redhat.com>
      Cc: Dave Martin <Dave.Martin@arm.com>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: linux-api@vger.kernel.org
      Cc: Yonghong Song <yhs@fb.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1504798247-48833-4-git-send-email-keescook@chromium.org
      e33f8d32
    • T
      Revert "arm/syscalls: Check address limit on user-mode return" · 2404269b
      Thomas Garnier 提交于
      This reverts commit 73ac5d6a.
      
      The work pending loop can call set_fs after addr_limit_user_check
      removed the _TIF_FSCHECK flag. This may happen at anytime based on how
      ARM handles alignment exceptions. It leads to an infinite loop condition.
      
      After discussion, it has been agreed that the generic approach is not
      tailored to the ARM architecture and any fix might not be complete. This
      patch will be replaced by an architecture specific implementation. The
      work flag approach will be kept for other architectures.
      Reported-by: NLeonard Crestez <leonard.crestez@nxp.com>
      Signed-off-by: NThomas Garnier <thgarnie@google.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Pratyush Anand <panand@redhat.com>
      Cc: Dave Martin <Dave.Martin@arm.com>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: linux-api@vger.kernel.org
      Cc: Yonghong Song <yhs@fb.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1504798247-48833-3-git-send-email-keescook@chromium.org
      2404269b
  22. 11 9月, 2017 3 次提交
    • N
      ARM: XIP kernel: store .data compressed in ROM · ca8b5d97
      Nicolas Pitre 提交于
      The .data segment stored in ROM is only copied to RAM once at boot time
      and never referenced afterwards. This is arguably a suboptimal usage of
      ROM resources.
      
      This patch allows for compressing the .data segment before storing it
      into ROM and decompressing it to RAM rather than simply copying it,
      saving on precious ROM space.
      
      Because global data is not available yet (obviously) we must allocate
      decompressor workspace memory on the stack. The .bss area is used as a
      stack area for that purpose before it is cleared. The required stack
      frame is 9568 bytes for __inflate_kernel_data() alone, so make sure
      the .bss is large enough to cope with that plus extra room for called
      functions or fail the build.
      
      Those numbers were picked arbitrarily based on the above 9568 byte
      stack frame:
      
      10240 (2.5 * PAGE_SIZE): used to override -Wframe-larger-than whose
      default value is 1024.
      12288 (3 * PAGE_SIZE): minimum .bss size to contain the stack.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Tested-by: NChris Brandt <Chris.Brandt@renesas.com>
      ca8b5d97
    • N
      ARM: vmlinux-xip.lds.S: fix multiple issues · 0d302c71
      Nicolas Pitre 提交于
      The XIP linker script has several problems:
      
      - PAGE_ALIGNED_DATA is missing and is likely to end up somewhere with
        the wrong LMA.
      
      - BUG_TABLE definitely has the wrong LMA, it is not copied to RAM, and
        its VMA is unaccounted for and likely to clash with dynamic memory
        usage.
      
      - TCM usage is similarly broken.
      
      - PERCPU_SECTION is left in ROM despite being written to.
      
      Let's use generic macros for those things and locate them appropriately.
      Incidentally, those macros are usable with a LMA != VMA already by
      properly defining LOAD_OFFSET.
      
      TCM is not fixed here. It never worked in a XIP configuration anyway, so
      that can wait until another round of cleanups.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Tested-by: NChris Brandt <Chris.Brandt@renesas.com>
      0d302c71
    • N
      ARM: vmlinux.lds.S: replace open coded .data sections with generic macros · 861e37da
      Nicolas Pitre 提交于
      Our .data section is missing PAGE_ALIGNED_DATA() which contains,
      amongst other things, the vdso page. This creates a System.map that
      looks like this:
      
      c15769a8 D _edata
      c1577000 d vdso_data_store
      c1578000 D __start___bug_table
      c1580544 D __stop___bug_table
      c1580544 B __bss_start
      
      By using RW_DATA_SECTION() we pick whatever generic sections might be
      added in the future and have page-aligned data next to other strongly
      aligned data. Furthermore we now include the entire thing, including the
      bug table, in the data accounting surrounded by _sdata/_edata.
      
      While at it let's also remplace the open coded .init.data by its
      equivalent INIT_DATA_SECTION().
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Tested-by: NChris Brandt <Chris.Brandt@renesas.com>
      861e37da