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 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2002-2003 Hewlett-Packard Co
|
|
|
|
* David Mosberger-Tang <davidm@hpl.hp.com>
|
|
|
|
*/
|
|
|
|
#ifndef _ASM_IA64_THREAD_INFO_H
|
|
|
|
#define _ASM_IA64_THREAD_INFO_H
|
|
|
|
|
2005-09-13 23:50:39 +08:00
|
|
|
#ifndef ASM_OFFSETS_C
|
2005-09-10 02:57:26 +08:00
|
|
|
#include <asm/asm-offsets.h>
|
2005-09-13 23:50:39 +08:00
|
|
|
#endif
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/ptrace.h>
|
|
|
|
|
2018-01-02 23:12:01 +08:00
|
|
|
#define THREAD_SIZE KERNEL_STACK_SIZE
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
/*
|
|
|
|
* On IA-64, we want to keep the task structure and kernel stack together, so they can be
|
|
|
|
* mapped by a single TLB entry and so they can be addressed by the "current" pointer
|
|
|
|
* without having to do pointer masking.
|
|
|
|
*/
|
|
|
|
struct thread_info {
|
|
|
|
struct task_struct *task; /* XXX not really needed, except for dup_task_struct() */
|
|
|
|
__u32 flags; /* thread_info flags (see TIF_*) */
|
|
|
|
__u32 cpu; /* current CPU */
|
2006-01-27 07:55:52 +08:00
|
|
|
__u32 last_cpu; /* Last CPU thread ran on */
|
2006-06-26 19:59:11 +08:00
|
|
|
__u32 status; /* Thread synchronous flags */
|
2005-04-17 06:20:36 +08:00
|
|
|
mm_segment_t addr_limit; /* user-level address space limit */
|
2005-06-23 15:09:07 +08:00
|
|
|
int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
|
2012-07-25 13:56:04 +08:00
|
|
|
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
2017-01-06 01:11:48 +08:00
|
|
|
__u64 utime;
|
|
|
|
__u64 stime;
|
|
|
|
__u64 gtime;
|
|
|
|
__u64 hardirq_time;
|
|
|
|
__u64 softirq_time;
|
|
|
|
__u64 idle_time;
|
2008-01-29 13:27:30 +08:00
|
|
|
__u64 ac_stamp;
|
|
|
|
__u64 ac_leave;
|
|
|
|
__u64 ac_stime;
|
|
|
|
__u64 ac_utime;
|
|
|
|
#endif
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define INIT_THREAD_INFO(tsk) \
|
|
|
|
{ \
|
|
|
|
.task = &tsk, \
|
|
|
|
.flags = 0, \
|
|
|
|
.cpu = 0, \
|
|
|
|
.addr_limit = KERNEL_DS, \
|
2009-07-10 20:57:56 +08:00
|
|
|
.preempt_count = INIT_PREEMPT_COUNT, \
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2005-09-13 23:50:39 +08:00
|
|
|
#ifndef ASM_OFFSETS_C
|
2005-04-17 06:20:36 +08:00
|
|
|
/* how to get the thread information struct from C */
|
|
|
|
#define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE))
|
Clarify naming of thread info/stack allocators
We've had the thread info allocated together with the thread stack for
most architectures for a long time (since the thread_info was split off
from the task struct), but that is about to change.
But the patches that move the thread info to be off-stack (and a part of
the task struct instead) made it clear how confused the allocator and
freeing functions are.
Because the common case was that we share an allocation with the thread
stack and the thread_info, the two pointers were identical. That
identity then meant that we would have things like
ti = alloc_thread_info_node(tsk, node);
...
tsk->stack = ti;
which certainly _worked_ (since stack and thread_info have the same
value), but is rather confusing: why are we assigning a thread_info to
the stack? And if we move the thread_info away, the "confusing" code
just gets to be entirely bogus.
So remove all this confusion, and make it clear that we are doing the
stack allocation by renaming and clarifying the function names to be
about the stack. The fact that the thread_info then shares the
allocation is an implementation detail, and not really about the
allocation itself.
This is a pure renaming and type fix: we pass in the same pointer, it's
just that we clarify what the pointer means.
The ia64 code that actually only has one single allocation (for all of
task_struct, thread_info and kernel thread stack) now looks a bit odd,
but since "tsk->stack" is actually not even used there, that oddity
doesn't matter. It would be a separate thing to clean that up, I
intentionally left the ia64 changes as a pure brute-force renaming and
type change.
Acked-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-06-25 06:09:37 +08:00
|
|
|
#define alloc_thread_stack_node(tsk, node) \
|
|
|
|
((unsigned long *) ((char *) (tsk) + IA64_TASK_SIZE))
|
2006-01-12 17:06:05 +08:00
|
|
|
#define task_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE))
|
2005-09-13 23:50:39 +08:00
|
|
|
#else
|
|
|
|
#define current_thread_info() ((struct thread_info *) 0)
|
Clarify naming of thread info/stack allocators
We've had the thread info allocated together with the thread stack for
most architectures for a long time (since the thread_info was split off
from the task struct), but that is about to change.
But the patches that move the thread info to be off-stack (and a part of
the task struct instead) made it clear how confused the allocator and
freeing functions are.
Because the common case was that we share an allocation with the thread
stack and the thread_info, the two pointers were identical. That
identity then meant that we would have things like
ti = alloc_thread_info_node(tsk, node);
...
tsk->stack = ti;
which certainly _worked_ (since stack and thread_info have the same
value), but is rather confusing: why are we assigning a thread_info to
the stack? And if we move the thread_info away, the "confusing" code
just gets to be entirely bogus.
So remove all this confusion, and make it clear that we are doing the
stack allocation by renaming and clarifying the function names to be
about the stack. The fact that the thread_info then shares the
allocation is an implementation detail, and not really about the
allocation itself.
This is a pure renaming and type fix: we pass in the same pointer, it's
just that we clarify what the pointer means.
The ia64 code that actually only has one single allocation (for all of
task_struct, thread_info and kernel thread stack) now looks a bit odd,
but since "tsk->stack" is actually not even used there, that oddity
doesn't matter. It would be a separate thing to clean that up, I
intentionally left the ia64 changes as a pure brute-force renaming and
type change.
Acked-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-06-25 06:09:37 +08:00
|
|
|
#define alloc_thread_stack_node(tsk, node) ((unsigned long *) 0)
|
2006-01-12 17:06:05 +08:00
|
|
|
#define task_thread_info(tsk) ((struct thread_info *) 0)
|
2005-09-13 23:50:39 +08:00
|
|
|
#endif
|
2016-08-11 17:35:21 +08:00
|
|
|
#define free_thread_stack(tsk) /* nothing */
|
2006-01-12 17:06:05 +08:00
|
|
|
#define task_stack_page(tsk) ((void *)(tsk))
|
|
|
|
|
|
|
|
#define __HAVE_THREAD_FUNCTIONS
|
2012-07-25 13:56:04 +08:00
|
|
|
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
2008-01-29 13:27:30 +08:00
|
|
|
#define setup_thread_stack(p, org) \
|
|
|
|
*task_thread_info(p) = *task_thread_info(org); \
|
|
|
|
task_thread_info(p)->ac_stime = 0; \
|
|
|
|
task_thread_info(p)->ac_utime = 0; \
|
|
|
|
task_thread_info(p)->task = (p);
|
|
|
|
#else
|
2006-01-12 17:06:05 +08:00
|
|
|
#define setup_thread_stack(p, org) \
|
|
|
|
*task_thread_info(p) = *task_thread_info(org); \
|
|
|
|
task_thread_info(p)->task = (p);
|
2008-01-29 13:27:30 +08:00
|
|
|
#endif
|
2006-01-12 17:06:05 +08:00
|
|
|
#define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2011-03-23 07:30:41 +08:00
|
|
|
#define alloc_task_struct_node(node) \
|
|
|
|
({ \
|
|
|
|
struct page *page = alloc_pages_node(node, GFP_KERNEL | __GFP_COMP, \
|
|
|
|
KERNEL_STACK_SIZE_ORDER); \
|
|
|
|
struct task_struct *ret = page ? page_address(page) : NULL; \
|
|
|
|
\
|
2011-03-24 07:41:43 +08:00
|
|
|
ret; \
|
2011-03-23 07:30:41 +08:00
|
|
|
})
|
2005-04-17 06:20:36 +08:00
|
|
|
#define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* thread information flags
|
|
|
|
* - these are process state flags that various assembly files may need to access
|
|
|
|
* - pending work-to-be-done flags are in least-significant 16 bits, other flags
|
|
|
|
* in top 16 bits
|
|
|
|
*/
|
2007-07-31 15:38:00 +08:00
|
|
|
#define TIF_SIGPENDING 0 /* signal pending */
|
|
|
|
#define TIF_NEED_RESCHED 1 /* rescheduling necessary */
|
|
|
|
#define TIF_SYSCALL_TRACE 2 /* syscall trace active */
|
|
|
|
#define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */
|
|
|
|
#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
|
2020-10-10 04:49:43 +08:00
|
|
|
#define TIF_NOTIFY_SIGNAL 5 /* signal notification exist */
|
2007-12-12 22:21:16 +08:00
|
|
|
#define TIF_NOTIFY_RESUME 6 /* resumption notification requested */
|
2010-05-14 17:13:27 +08:00
|
|
|
#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
|
2005-09-11 15:20:14 +08:00
|
|
|
#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */
|
2005-12-30 18:27:01 +08:00
|
|
|
#define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */
|
2007-12-12 22:23:34 +08:00
|
|
|
#define TIF_RESTORE_RSE 21 /* user RBS is newer than kernel RBS */
|
2014-04-11 15:59:08 +08:00
|
|
|
#define TIF_POLLING_NRFLAG 22 /* idle is polling for TIF_NEED_RESCHED */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
|
|
|
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
|
2007-01-31 17:50:31 +08:00
|
|
|
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
|
|
|
|
#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
|
2007-12-12 22:21:16 +08:00
|
|
|
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
2020-10-10 04:49:43 +08:00
|
|
|
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
|
2005-04-17 06:20:36 +08:00
|
|
|
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
|
|
|
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
2005-09-11 15:20:14 +08:00
|
|
|
#define _TIF_MCA_INIT (1 << TIF_MCA_INIT)
|
2005-12-30 18:27:01 +08:00
|
|
|
#define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED)
|
2007-12-12 22:23:34 +08:00
|
|
|
#define _TIF_RESTORE_RSE (1 << TIF_RESTORE_RSE)
|
2014-04-11 15:59:08 +08:00
|
|
|
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* "work to do on user-return" bits */
|
2007-12-12 22:21:16 +08:00
|
|
|
#define TIF_ALLWORK_MASK (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
|
2020-10-10 04:49:43 +08:00
|
|
|
_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)
|
2005-04-17 06:20:36 +08:00
|
|
|
/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */
|
|
|
|
#define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
|
|
|
|
|
|
|
|
#endif /* _ASM_IA64_THREAD_INFO_H */
|