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 */
|
2008-10-23 12:26:29 +07:00
|
|
|
#ifndef _ASM_X86_TRAPS_H
|
|
|
|
#define _ASM_X86_TRAPS_H
|
2008-07-15 22:39:13 +07:00
|
|
|
|
2014-11-20 08:41:09 +07:00
|
|
|
#include <linux/context_tracking_state.h>
|
2011-06-06 00:50:24 +07:00
|
|
|
#include <linux/kprobes.h>
|
|
|
|
|
2008-09-23 16:53:52 +07:00
|
|
|
#include <asm/debugreg.h>
|
2009-03-30 04:47:48 +07:00
|
|
|
#include <asm/siginfo.h> /* TRAP_TRACE, ... */
|
2008-09-23 16:53:52 +07:00
|
|
|
|
2013-08-06 05:02:36 +07:00
|
|
|
#define dotraplinkage __visible
|
2008-09-30 23:41:36 +07:00
|
|
|
|
2008-07-15 22:39:13 +07:00
|
|
|
asmlinkage void divide_error(void);
|
|
|
|
asmlinkage void debug(void);
|
|
|
|
asmlinkage void nmi(void);
|
|
|
|
asmlinkage void int3(void);
|
|
|
|
asmlinkage void overflow(void);
|
|
|
|
asmlinkage void bounds(void);
|
|
|
|
asmlinkage void invalid_op(void);
|
|
|
|
asmlinkage void device_not_available(void);
|
2008-09-30 23:41:36 +07:00
|
|
|
#ifdef CONFIG_X86_64
|
|
|
|
asmlinkage void double_fault(void);
|
|
|
|
#endif
|
2008-07-15 22:39:13 +07:00
|
|
|
asmlinkage void coprocessor_segment_overrun(void);
|
|
|
|
asmlinkage void invalid_TSS(void);
|
|
|
|
asmlinkage void segment_not_present(void);
|
|
|
|
asmlinkage void stack_segment(void);
|
|
|
|
asmlinkage void general_protection(void);
|
|
|
|
asmlinkage void page_fault(void);
|
2010-10-14 16:22:52 +07:00
|
|
|
asmlinkage void async_page_fault(void);
|
2008-09-30 23:41:36 +07:00
|
|
|
asmlinkage void spurious_interrupt_bug(void);
|
2008-07-15 22:39:13 +07:00
|
|
|
asmlinkage void coprocessor_error(void);
|
|
|
|
asmlinkage void alignment_check(void);
|
|
|
|
#ifdef CONFIG_X86_MCE
|
|
|
|
asmlinkage void machine_check(void);
|
|
|
|
#endif /* CONFIG_X86_MCE */
|
2008-09-30 23:41:36 +07:00
|
|
|
asmlinkage void simd_coprocessor_error(void);
|
2008-07-15 22:39:13 +07:00
|
|
|
|
2017-09-01 00:42:49 +07:00
|
|
|
#if defined(CONFIG_X86_64) && defined(CONFIG_XEN_PV)
|
|
|
|
asmlinkage void xen_divide_error(void);
|
2017-11-02 14:59:07 +07:00
|
|
|
asmlinkage void xen_xennmi(void);
|
2017-09-01 00:42:49 +07:00
|
|
|
asmlinkage void xen_xendebug(void);
|
|
|
|
asmlinkage void xen_xenint3(void);
|
|
|
|
asmlinkage void xen_overflow(void);
|
|
|
|
asmlinkage void xen_bounds(void);
|
|
|
|
asmlinkage void xen_invalid_op(void);
|
|
|
|
asmlinkage void xen_device_not_available(void);
|
|
|
|
asmlinkage void xen_double_fault(void);
|
|
|
|
asmlinkage void xen_coprocessor_segment_overrun(void);
|
|
|
|
asmlinkage void xen_invalid_TSS(void);
|
|
|
|
asmlinkage void xen_segment_not_present(void);
|
|
|
|
asmlinkage void xen_stack_segment(void);
|
|
|
|
asmlinkage void xen_general_protection(void);
|
|
|
|
asmlinkage void xen_page_fault(void);
|
|
|
|
asmlinkage void xen_spurious_interrupt_bug(void);
|
|
|
|
asmlinkage void xen_coprocessor_error(void);
|
|
|
|
asmlinkage void xen_alignment_check(void);
|
|
|
|
#ifdef CONFIG_X86_MCE
|
|
|
|
asmlinkage void xen_machine_check(void);
|
|
|
|
#endif /* CONFIG_X86_MCE */
|
|
|
|
asmlinkage void xen_simd_coprocessor_error(void);
|
|
|
|
#endif
|
|
|
|
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_divide_error(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_debug(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_nmi(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_int3(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_overflow(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_bounds(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_invalid_op(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_device_not_available(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_invalid_TSS(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_segment_not_present(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code);
|
2008-12-19 01:33:56 +07:00
|
|
|
#ifdef CONFIG_X86_64
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code);
|
2018-11-22 09:04:09 +07:00
|
|
|
asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs);
|
|
|
|
asmlinkage __visible notrace
|
|
|
|
struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s);
|
|
|
|
void __init trap_init(void);
|
2008-12-19 01:33:56 +07:00
|
|
|
#endif
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_general_protection(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code);
|
|
|
|
dotraplinkage void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_coprocessor_error(struct pt_regs *regs, long error_code);
|
|
|
|
dotraplinkage void do_alignment_check(struct pt_regs *regs, long error_code);
|
2008-09-30 23:41:36 +07:00
|
|
|
#ifdef CONFIG_X86_MCE
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_machine_check(struct pt_regs *regs, long error_code);
|
2008-09-30 23:41:36 +07:00
|
|
|
#endif
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code);
|
2008-09-30 23:41:36 +07:00
|
|
|
#ifdef CONFIG_X86_32
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code);
|
2008-09-30 23:41:36 +07:00
|
|
|
#endif
|
2018-11-12 19:20:36 +07:00
|
|
|
dotraplinkage void do_mce(struct pt_regs *regs, long error_code);
|
2008-07-15 22:39:13 +07:00
|
|
|
|
2008-09-23 16:53:52 +07:00
|
|
|
static inline int get_si_code(unsigned long condition)
|
|
|
|
{
|
|
|
|
if (condition & DR_STEP)
|
|
|
|
return TRAP_TRACE;
|
|
|
|
else if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3))
|
|
|
|
return TRAP_HWBKPT;
|
|
|
|
else
|
|
|
|
return TRAP_BRKPT;
|
|
|
|
}
|
|
|
|
|
2008-07-15 22:39:13 +07:00
|
|
|
extern int panic_on_unrecovered_nmi;
|
|
|
|
|
2009-02-09 20:17:39 +07:00
|
|
|
void math_emulate(struct math_emu_info *);
|
2009-07-18 22:09:56 +07:00
|
|
|
#ifndef CONFIG_X86_32
|
2018-11-10 05:13:13 +07:00
|
|
|
asmlinkage void smp_thermal_interrupt(struct pt_regs *regs);
|
|
|
|
asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
|
|
|
|
asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
|
2008-09-30 23:41:36 +07:00
|
|
|
#endif
|
2008-07-15 22:39:13 +07:00
|
|
|
|
2018-12-05 06:34:56 +07:00
|
|
|
void smp_apic_timer_interrupt(struct pt_regs *regs);
|
|
|
|
void smp_spurious_interrupt(struct pt_regs *regs);
|
|
|
|
void smp_error_interrupt(struct pt_regs *regs);
|
|
|
|
asmlinkage void smp_irq_move_cleanup_interrupt(void);
|
|
|
|
|
2015-07-04 02:44:32 +07:00
|
|
|
extern void ist_enter(struct pt_regs *regs);
|
|
|
|
extern void ist_exit(struct pt_regs *regs);
|
2014-11-20 08:59:41 +07:00
|
|
|
extern void ist_begin_non_atomic(struct pt_regs *regs);
|
|
|
|
extern void ist_end_non_atomic(void);
|
2014-11-20 08:41:09 +07:00
|
|
|
|
2016-08-31 07:27:57 +07:00
|
|
|
#ifdef CONFIG_VMAP_STACK
|
|
|
|
void __noreturn handle_stack_overflow(const char *message,
|
|
|
|
struct pt_regs *regs,
|
|
|
|
unsigned long fault_address);
|
|
|
|
#endif
|
|
|
|
|
2012-03-10 07:07:10 +07:00
|
|
|
/* Interrupts/Exceptions */
|
|
|
|
enum {
|
|
|
|
X86_TRAP_DE = 0, /* 0, Divide-by-zero */
|
|
|
|
X86_TRAP_DB, /* 1, Debug */
|
|
|
|
X86_TRAP_NMI, /* 2, Non-maskable Interrupt */
|
|
|
|
X86_TRAP_BP, /* 3, Breakpoint */
|
|
|
|
X86_TRAP_OF, /* 4, Overflow */
|
|
|
|
X86_TRAP_BR, /* 5, Bound Range Exceeded */
|
|
|
|
X86_TRAP_UD, /* 6, Invalid Opcode */
|
|
|
|
X86_TRAP_NM, /* 7, Device Not Available */
|
|
|
|
X86_TRAP_DF, /* 8, Double Fault */
|
|
|
|
X86_TRAP_OLD_MF, /* 9, Coprocessor Segment Overrun */
|
|
|
|
X86_TRAP_TS, /* 10, Invalid TSS */
|
|
|
|
X86_TRAP_NP, /* 11, Segment Not Present */
|
|
|
|
X86_TRAP_SS, /* 12, Stack Segment Fault */
|
|
|
|
X86_TRAP_GP, /* 13, General Protection Fault */
|
|
|
|
X86_TRAP_PF, /* 14, Page Fault */
|
|
|
|
X86_TRAP_SPURIOUS, /* 15, Spurious Interrupt */
|
|
|
|
X86_TRAP_MF, /* 16, x87 Floating-Point Exception */
|
|
|
|
X86_TRAP_AC, /* 17, Alignment Check */
|
|
|
|
X86_TRAP_MC, /* 18, Machine Check */
|
|
|
|
X86_TRAP_XF, /* 19, SIMD Floating-Point Exception */
|
|
|
|
X86_TRAP_IRET = 32, /* 32, IRET Exception */
|
|
|
|
};
|
|
|
|
|
2017-10-28 03:25:28 +07:00
|
|
|
/*
|
|
|
|
* Page fault error code bits:
|
|
|
|
*
|
|
|
|
* bit 0 == 0: no page found 1: protection fault
|
|
|
|
* bit 1 == 0: read access 1: write access
|
|
|
|
* bit 2 == 0: kernel-mode access 1: user-mode access
|
|
|
|
* bit 3 == 1: use of reserved bit detected
|
|
|
|
* bit 4 == 1: fault was an instruction fetch
|
|
|
|
* bit 5 == 1: protection keys block access
|
|
|
|
*/
|
|
|
|
enum x86_pf_error_code {
|
|
|
|
X86_PF_PROT = 1 << 0,
|
|
|
|
X86_PF_WRITE = 1 << 1,
|
|
|
|
X86_PF_USER = 1 << 2,
|
|
|
|
X86_PF_RSVD = 1 << 3,
|
|
|
|
X86_PF_INSTR = 1 << 4,
|
|
|
|
X86_PF_PK = 1 << 5,
|
|
|
|
};
|
2008-10-23 12:26:29 +07:00
|
|
|
#endif /* _ASM_X86_TRAPS_H */
|