License cleanup: add SPDX GPL-2.0 license identifier to files with no license
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: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 21:07:57 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2014-04-16 08:59:30 +07:00
|
|
|
#ifndef _ASM_EFI_H
|
|
|
|
#define _ASM_EFI_H
|
|
|
|
|
2017-04-04 23:02:39 +07:00
|
|
|
#include <asm/boot.h>
|
2016-09-02 20:54:03 +07:00
|
|
|
#include <asm/cpufeature.h>
|
2017-08-03 23:23:22 +07:00
|
|
|
#include <asm/fpsimd.h>
|
2014-04-16 08:59:30 +07:00
|
|
|
#include <asm/io.h>
|
2017-07-14 21:54:36 +07:00
|
|
|
#include <asm/memory.h>
|
2015-11-30 19:28:19 +07:00
|
|
|
#include <asm/mmu_context.h>
|
2014-07-05 00:41:53 +07:00
|
|
|
#include <asm/neon.h>
|
2016-04-26 03:07:09 +07:00
|
|
|
#include <asm/ptrace.h>
|
2015-11-30 19:28:19 +07:00
|
|
|
#include <asm/tlbflush.h>
|
2014-04-16 08:59:30 +07:00
|
|
|
|
|
|
|
#ifdef CONFIG_EFI
|
|
|
|
extern void efi_init(void);
|
|
|
|
#else
|
|
|
|
#define efi_init()
|
|
|
|
#endif
|
|
|
|
|
2015-11-30 19:28:19 +07:00
|
|
|
int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
|
2016-06-29 19:51:27 +07:00
|
|
|
int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md);
|
2016-04-26 03:06:46 +07:00
|
|
|
|
2016-04-26 03:07:04 +07:00
|
|
|
#define arch_efi_call_virt_setup() \
|
2014-07-05 00:41:53 +07:00
|
|
|
({ \
|
2014-10-20 21:27:26 +07:00
|
|
|
efi_virtmap_load(); \
|
2017-08-03 23:23:22 +07:00
|
|
|
__efi_fpsimd_begin(); \
|
2014-07-05 00:41:53 +07:00
|
|
|
})
|
|
|
|
|
2016-06-25 14:20:27 +07:00
|
|
|
#define arch_efi_call_virt(p, f, args...) \
|
2014-07-05 00:41:53 +07:00
|
|
|
({ \
|
2014-10-20 21:27:26 +07:00
|
|
|
efi_##f##_t *__f; \
|
2016-06-25 14:20:27 +07:00
|
|
|
__f = p->f; \
|
2018-03-08 15:00:13 +07:00
|
|
|
__efi_rt_asm_wrapper(__f, #f, args); \
|
2016-04-26 03:07:04 +07:00
|
|
|
})
|
|
|
|
|
|
|
|
#define arch_efi_call_virt_teardown() \
|
|
|
|
({ \
|
2017-08-03 23:23:22 +07:00
|
|
|
__efi_fpsimd_end(); \
|
2014-10-20 21:27:26 +07:00
|
|
|
efi_virtmap_unload(); \
|
2014-07-05 00:41:53 +07:00
|
|
|
})
|
|
|
|
|
2018-03-08 15:00:13 +07:00
|
|
|
efi_status_t __efi_rt_asm_wrapper(void *, const char *, ...);
|
|
|
|
|
2016-04-26 03:07:09 +07:00
|
|
|
#define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT)
|
|
|
|
|
2014-07-02 19:54:41 +07:00
|
|
|
/* arch specific definitions used by the stub code */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from
|
|
|
|
* start of kernel and may not cross a 2MiB boundary. We set alignment to
|
|
|
|
* 2MiB so we know it won't cross a 2MiB boundary.
|
|
|
|
*/
|
|
|
|
#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */
|
2017-04-04 23:02:37 +07:00
|
|
|
|
2017-07-21 20:25:33 +07:00
|
|
|
/*
|
|
|
|
* In some configurations (e.g. VMAP_STACK && 64K pages), stacks built into the
|
|
|
|
* kernel need greater alignment than we require the segments to be padded to.
|
|
|
|
*/
|
|
|
|
#define EFI_KIMG_ALIGN \
|
|
|
|
(SEGMENT_ALIGN > THREAD_ALIGN ? SEGMENT_ALIGN : THREAD_ALIGN)
|
2017-07-14 21:54:36 +07:00
|
|
|
|
2017-04-04 23:02:37 +07:00
|
|
|
/* on arm64, the FDT may be located anywhere in system RAM */
|
|
|
|
static inline unsigned long efi_get_max_fdt_addr(unsigned long dram_base)
|
|
|
|
{
|
|
|
|
return ULONG_MAX;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* On arm64, we have to ensure that the initrd ends up in the linear region,
|
|
|
|
* which is a 1 GB aligned region of size '1UL << (VA_BITS - 1)' that is
|
|
|
|
* guaranteed to cover the kernel Image.
|
|
|
|
*
|
|
|
|
* Since the EFI stub is part of the kernel Image, we can relax the
|
|
|
|
* usual requirements in Documentation/arm64/booting.txt, which still
|
|
|
|
* apply to other bootloaders, and are required for some kernel
|
|
|
|
* configurations.
|
|
|
|
*/
|
|
|
|
static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base,
|
|
|
|
unsigned long image_addr)
|
|
|
|
{
|
|
|
|
return (image_addr & ~(SZ_1G - 1UL)) + (1UL << (VA_BITS - 1));
|
|
|
|
}
|
2014-07-02 19:54:41 +07:00
|
|
|
|
2016-04-26 03:06:49 +07:00
|
|
|
#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)
|
|
|
|
#define __efi_call_early(f, ...) f(__VA_ARGS__)
|
2017-02-06 18:22:41 +07:00
|
|
|
#define efi_call_runtime(f, ...) sys_table_arg->runtime->f(__VA_ARGS__)
|
2016-04-26 03:06:49 +07:00
|
|
|
#define efi_is_64bit() (true)
|
2014-07-02 19:54:41 +07:00
|
|
|
|
2016-11-13 04:32:35 +07:00
|
|
|
#define efi_call_proto(protocol, f, instance, ...) \
|
|
|
|
((protocol##_t *)instance)->f(instance, ##__VA_ARGS__)
|
|
|
|
|
2016-04-26 03:06:52 +07:00
|
|
|
#define alloc_screen_info(x...) &screen_info
|
|
|
|
#define free_screen_info(x...)
|
|
|
|
|
2017-08-19 02:49:35 +07:00
|
|
|
/* redeclare as 'hidden' so the compiler will generate relative references */
|
|
|
|
extern struct screen_info screen_info __attribute__((__visibility__("hidden")));
|
|
|
|
|
2016-04-26 03:06:56 +07:00
|
|
|
static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-11-17 19:50:21 +07:00
|
|
|
#define EFI_ALLOC_ALIGN SZ_64K
|
|
|
|
|
2014-10-20 21:27:26 +07:00
|
|
|
/*
|
2015-01-22 17:01:40 +07:00
|
|
|
* On ARM systems, virtually remapped UEFI runtime services are set up in two
|
2014-10-20 21:27:26 +07:00
|
|
|
* distinct stages:
|
|
|
|
* - The stub retrieves the final version of the memory map from UEFI, populates
|
|
|
|
* the virt_addr fields and calls the SetVirtualAddressMap() [SVAM] runtime
|
|
|
|
* service to communicate the new mapping to the firmware (Note that the new
|
|
|
|
* mapping is not live at this time)
|
2015-01-22 17:01:40 +07:00
|
|
|
* - During an early initcall(), the EFI system table is permanently remapped
|
|
|
|
* and the virtual remapping of the UEFI Runtime Services regions is loaded
|
|
|
|
* into a private set of page tables. If this all succeeds, the Runtime
|
|
|
|
* Services are enabled and the EFI_RUNTIME_SERVICES bit set.
|
2014-10-20 21:27:26 +07:00
|
|
|
*/
|
|
|
|
|
2015-11-30 19:28:19 +07:00
|
|
|
static inline void efi_set_pgd(struct mm_struct *mm)
|
|
|
|
{
|
2016-09-02 20:54:03 +07:00
|
|
|
__switch_mm(mm);
|
|
|
|
|
|
|
|
if (system_uses_ttbr0_pan()) {
|
|
|
|
if (mm != current->active_mm) {
|
|
|
|
/*
|
|
|
|
* Update the current thread's saved ttbr0 since it is
|
2018-01-10 20:18:30 +07:00
|
|
|
* restored as part of a return from exception. Enable
|
|
|
|
* access to the valid TTBR0_EL1 and invoke the errata
|
|
|
|
* workaround directly since there is no return from
|
|
|
|
* exception when invoking the EFI run-time services.
|
2016-09-02 20:54:03 +07:00
|
|
|
*/
|
|
|
|
update_saved_ttbr0(current, mm);
|
2018-01-10 20:18:30 +07:00
|
|
|
uaccess_ttbr0_enable();
|
|
|
|
post_ttbr_update_workaround();
|
2016-09-02 20:54:03 +07:00
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* Defer the switch to the current thread's TTBR0_EL1
|
|
|
|
* until uaccess_enable(). Restore the current
|
|
|
|
* thread's saved ttbr0 corresponding to its active_mm
|
|
|
|
*/
|
2018-01-10 20:18:30 +07:00
|
|
|
uaccess_ttbr0_disable();
|
2017-12-06 17:42:10 +07:00
|
|
|
update_saved_ttbr0(current, current->active_mm);
|
2016-09-02 20:54:03 +07:00
|
|
|
}
|
|
|
|
}
|
2015-11-30 19:28:19 +07:00
|
|
|
}
|
|
|
|
|
2014-10-20 21:27:26 +07:00
|
|
|
void efi_virtmap_load(void);
|
|
|
|
void efi_virtmap_unload(void);
|
|
|
|
|
2014-04-16 08:59:30 +07:00
|
|
|
#endif /* _ASM_EFI_H */
|