1. 03 1月, 2018 2 次提交
  2. 07 12月, 2017 3 次提交
  3. 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
  4. 28 10月, 2017 1 次提交
    • A
      efi/libstub: arm: omit sorting of the UEFI memory map · 29f9007b
      Ard Biesheuvel 提交于
      ARM shares its EFI stub implementation with arm64, which has some
      special handling in the virtual remapping code to
      a) make sure that we can map everything even if the OS executes
         with 64k page size, and
      b) make sure that adjacent regions with the same attributes are not
         reordered or moved apart in memory.
      
      The latter is a workaround for a 'feature' that was shortly recommended
      by UEFI spec v2.5, but deprecated shortly after, due to the fact that
      it broke many OS installers, including non-Linux ones, and it was never
      widely implemented for ARM systems. Before implementing b), the arm64
      code simply rounded up all regions to 64 KB granularity, but given that
      that results in moving adjacent regions apart, it had to be refined when
      b) was implemented.
      
      The adjacency check requires a sort() pass, due to the fact that the
      UEFI spec does not mandate any ordering, and the inclusion of the
      lib/sort.c code into the ARM EFI stub is causing some trouble with
      the decompressor build due to the fact that its EXPORT_SYMBOL() call
      triggers the creation of ksymtab/kcrctab sections.
      
      So let's simply do away with the adjacency check for ARM, and simply put
      all UEFI runtime regions together if they have the same memory attributes.
      This is guaranteed to work, given that ARM only supports 4 KB pages,
      and allows us to remove the sort() call entirely.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Tested-by: NJeffy Chen <jeffy.chen@rock-chips.com>
      Tested-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Tested-by: NMatthias Brugger <matthias.bgg@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      29f9007b
  5. 25 10月, 2017 2 次提交
  6. 30 8月, 2017 1 次提交
  7. 26 8月, 2017 5 次提交
  8. 24 8月, 2017 1 次提交
  9. 21 8月, 2017 7 次提交
  10. 17 8月, 2017 1 次提交
    • B
      efi: Introduce efi_early_memdesc_ptr to get pointer to memmap descriptor · 02e43c2d
      Baoquan He 提交于
      The existing map iteration helper for_each_efi_memory_desc_in_map can
      only be used after the kernel initializes the EFI subsystem to set up
      struct efi_memory_map.
      
      Before that we also need iterate map descriptors which are stored in several
      intermediate structures, like struct efi_boot_memmap for arch independent
      usage and struct efi_info for x86 arch only.
      
      Introduce efi_early_memdesc_ptr() to get pointer to a map descriptor, and
      replace several places where that primitive is open coded.
      Signed-off-by: NBaoquan He <bhe@redhat.com>
      [ Various improvements to the text. ]
      Acked-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: ard.biesheuvel@linaro.org
      Cc: fanc.fnst@cn.fujitsu.com
      Cc: izumi.taku@jp.fujitsu.com
      Cc: keescook@chromium.org
      Cc: linux-efi@vger.kernel.org
      Cc: n-horiguchi@ah.jp.nec.com
      Cc: thgarnie@google.com
      Link: http://lkml.kernel.org/r/20170816134651.GF21273@x1Signed-off-by: NIngo Molnar <mingo@kernel.org>
      02e43c2d
  11. 16 8月, 2017 1 次提交
    • M
      efi/arm64: add EFI_KIMG_ALIGN · 170976bc
      Mark Rutland 提交于
      The EFI stub is intimately coupled with the kernel, and takes advantage
      of this by relocating the kernel at a weaker alignment than the
      documented boot protocol mandates.
      
      However, it does so by assuming it can align the kernel to the segment
      alignment, and assumes that this is 64K. In subsequent patches, we'll
      have to consider other details to determine this de-facto alignment
      constraint.
      
      This patch adds a new EFI_KIMG_ALIGN definition that will track the
      kernel's de-facto alignment requirements. Subsequent patches will modify
      this as required.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NWill Deacon <will.deacon@arm.com>
      Tested-by: NLaura Abbott <labbott@redhat.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      170976bc
  12. 04 8月, 2017 1 次提交
    • L
      treewide: Consolidate Apple DMI checks · 630b3aff
      Lukas Wunner 提交于
      We're about to amend ACPI bus scan with DMI checks whether we're running
      on a Mac to support Apple device properties in AML.  The DMI checks are
      performed for every single device, adding overhead for everything x86
      that isn't Apple, which is the majority.  Rafael and Andy therefore
      request to perform the DMI match only once and cache the result.
      
      Outside of ACPI various other Apple DMI checks exist and it seems
      reasonable to use the cached value there as well.  Rafael, Andy and
      Darren suggest performing the DMI check in arch code and making it
      available with a header in include/linux/platform_data/x86/.
      
      To this end, add early_platform_quirks() to arch/x86/kernel/quirks.c
      to perform the DMI check and invoke it from setup_arch().  Switch over
      all existing Apple DMI checks, thereby fixing two deficiencies:
      
      * They are now #defined to false on non-x86 arches and can thus be
        optimized away if they're located in cross-arch code.
      
      * Some of them only match "Apple Inc." but not "Apple Computer, Inc.",
        which is used by BIOSes released between January 2006 (when the first
        x86 Macs started shipping) and January 2007 (when the company name
        changed upon introduction of the iPhone).
      Suggested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Suggested-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Suggested-by: NDarren Hart <dvhart@infradead.org>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      630b3aff
  13. 18 7月, 2017 1 次提交
  14. 13 7月, 2017 1 次提交
  15. 23 6月, 2017 3 次提交
    • D
      efi: Process the MEMATTR table only if EFI_MEMMAP is enabled · 457ea3f7
      Daniel Kiper 提交于
      Otherwise e.g. Xen dom0 on x86_64 EFI platforms crashes.
      
      In theory we can check EFI_PARAVIRT too, however,
      EFI_MEMMAP looks more targeted and covers more cases.
      Signed-off-by: NDaniel Kiper <daniel.kiper@oracle.com>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: andrew.cooper3@citrix.com
      Cc: boris.ostrovsky@oracle.com
      Cc: jgross@suse.com
      Cc: linux-efi@vger.kernel.org
      Cc: matt@codeblueprint.co.uk
      Cc: stable@vger.kernel.org
      Cc: xen-devel@lists.xenproject.org
      Link: http://lkml.kernel.org/r/1498128697-12943-2-git-send-email-daniel.kiper@oracle.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      457ea3f7
    • T
      trace, ras: add ARM processor error trace event · e9279e83
      Tyler Baicar 提交于
      Currently there are trace events for the various RAS
      errors with the exception of ARM processor type errors.
      Add a new trace event for such errors so that the user
      will know when they occur. These trace events are
      consistent with the ARM processor error section type
      defined in UEFI 2.6 spec section N.2.4.4.
      Signed-off-by: NTyler Baicar <tbaicar@codeaurora.org>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      e9279e83
    • T
      efi: print unrecognized CPER section · 0fc300f4
      Tyler Baicar 提交于
      UEFI spec allows for non-standard section in Common Platform Error
      Record. This is defined in section N.2.3 of UEFI version 2.5.
      
      Currently if the CPER section's type (UUID) does not match with
      one of the section types that the kernel knows how to parse, the
      section is skipped. Therefore, user is not able to see
      such CPER data, for instance, error record of non-standard section.
      
      This change prints out the raw data in hex in the dmesg buffer so
      that non-standard sections are reported to the user. Non-standard
      section type errors should be reported to the user because these
      can include errors which are vendor specific. The data length is
      taken from Error Data length field of Generic Error Data Entry.
      
      The following is a sample output from dmesg:
       Hardware error from APEI Generic Hardware Error Source: 2
       It has been corrected by h/w and requires no further action
       event severity: corrected
        time: precise 2017-03-15 20:37:35
        Error 0, type: corrected
         section type: unknown, d2e2621c-f936-468d-0d84-15a4ed015c8b
         section length: 0x238
         00000000: 4d415201 4d492031 453a4d45 435f4343  .RAM1 IMEM:ECC_C
         00000010: 53515f45 44525f42 00000000 00000000  E_QSB_RD........
         00000020: 00000000 00000000 00000000 00000000  ................
         00000030: 00000000 00000000 01010000 01010000  ................
         00000040: 00000000 00000000 00000005 00000000  ................
         00000050: 01010000 00000000 00000001 00dddd00  ................
      ...
      
      The raw data from the error can then be decoded using vendor
      specific tools.
      Signed-off-by: NTyler Baicar <tbaicar@codeaurora.org>
      CC: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
      Reviewed-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0fc300f4
  16. 22 6月, 2017 3 次提交
  17. 09 6月, 2017 1 次提交
    • D
      efi: Fix boot panic because of invalid BGRT image address · 792ef14d
      Dave Young 提交于
      Maniaxx reported a kernel boot crash in the EFI code, which I emulated
      by using same invalid phys addr in code:
      
        BUG: unable to handle kernel paging request at ffffffffff280001
        IP: efi_bgrt_init+0xfb/0x153
        ...
        Call Trace:
         ? bgrt_init+0xbc/0xbc
         acpi_parse_bgrt+0xe/0x12
         acpi_table_parse+0x89/0xb8
         acpi_boot_init+0x445/0x4e2
         ? acpi_parse_x2apic+0x79/0x79
         ? dmi_ignore_irq0_timer_override+0x33/0x33
         setup_arch+0xb63/0xc82
         ? early_idt_handler_array+0x120/0x120
         start_kernel+0xb7/0x443
         ? early_idt_handler_array+0x120/0x120
         x86_64_start_reservations+0x29/0x2b
         x86_64_start_kernel+0x154/0x177
         secondary_startup_64+0x9f/0x9f
      
      There is also a similar bug filed in bugzilla.kernel.org:
      
        https://bugzilla.kernel.org/show_bug.cgi?id=195633
      
      The crash is caused by this commit:
      
        7b0a9114 efi/x86: Move the EFI BGRT init code to early init code
      
      The root cause is the firmware on those machines provides invalid BGRT
      image addresses.
      
      In a kernel before above commit BGRT initializes late and uses ioremap()
      to map the image address. Ioremap validates the address, if it is not a
      valid physical address ioremap() just fails and returns. However in current
      kernel EFI BGRT initializes early and uses early_memremap() which does not
      validate the image address, and kernel panic happens.
      
      According to ACPI spec the BGRT image address should fall into
      EFI_BOOT_SERVICES_DATA, see the section 5.2.22.4 of below document:
      
        http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
      
      Fix this issue by validating the image address in efi_bgrt_init(). If the
      image address does not fall into any EFI_BOOT_SERVICES_DATA areas we just
      bail out with a warning message.
      Reported-by: NManiaxx <tripleshiftone@gmail.com>
      Signed-off-by: NDave Young <dyoung@redhat.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Fixes: 7b0a9114 ("efi/x86: Move the EFI BGRT init code to early init code")
      Link: http://lkml.kernel.org/r/20170609084558.26766-2-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      792ef14d
  18. 05 6月, 2017 5 次提交