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
|
|
|
/*
|
2012-07-20 17:15:04 +08:00
|
|
|
* Copyright IBM Corp. 1999, 2010
|
2005-11-07 16:59:12 +08:00
|
|
|
*
|
|
|
|
* Author(s): Hartmut Penner <hp@de.ibm.com>
|
|
|
|
* Martin Schwidefsky <schwidefsky@de.ibm.com>
|
|
|
|
* Rob van der Heij <rvdhei@iae.nl>
|
|
|
|
* Heiko Carstens <heiko.carstens@de.ibm.com>
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-02-27 05:37:53 +08:00
|
|
|
#include <linux/init.h>
|
2011-07-24 16:48:19 +08:00
|
|
|
#include <linux/linkage.h>
|
2010-02-27 05:37:53 +08:00
|
|
|
#include <asm/asm-offsets.h>
|
|
|
|
#include <asm/thread_info.h>
|
|
|
|
#include <asm/page.h>
|
2006-06-29 20:58:17 +08:00
|
|
|
|
2010-02-27 05:37:53 +08:00
|
|
|
__HEAD
|
2011-07-24 16:48:19 +08:00
|
|
|
ENTRY(startup_continue)
|
2016-02-29 22:59:18 +08:00
|
|
|
tm __LC_STFLE_FAC_LIST+5,0x80 # LPP available ?
|
2015-10-07 00:06:15 +08:00
|
|
|
jz 0f
|
|
|
|
xc __LC_LPP+1(7,0),__LC_LPP+1 # clear lpp and current_pid
|
|
|
|
mvi __LC_LPP,0x80 # and set LPP_MAGIC
|
|
|
|
.insn s,0xb2800000,__LC_LPP # load program parameter
|
2016-10-27 18:41:39 +08:00
|
|
|
0: larl %r1,tod_clock_base
|
|
|
|
mvc 0(16,%r1),__LC_BOOT_CLOCK
|
2010-02-27 05:37:53 +08:00
|
|
|
larl %r13,.LPG1 # get base
|
2006-09-28 22:56:37 +08:00
|
|
|
lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
|
|
|
|
lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
|
|
|
|
# move IPL device to lowcore
|
s390: remove all code using the access register mode
The vdso code for the getcpu() and the clock_gettime() call use the access
register mode to access the per-CPU vdso data page with the current code.
An alternative to the complicated AR mode is to use the secondary space
mode. This makes the vdso faster and quite a bit simpler. The downside is
that the uaccess code has to be changed quite a bit.
Which instructions are used depends on the machine and what kind of uaccess
operation is requested. The instruction dictates which ASCE value needs
to be loaded into %cr1 and %cr7.
The different cases:
* User copy with MVCOS for z10 and newer machines
The MVCOS instruction can copy between the primary space (aka user) and
the home space (aka kernel) directly. For set_fs(KERNEL_DS) the kernel
ASCE is loaded into %cr1. For set_fs(USER_DS) the user space is already
loaded in %cr1.
* User copy with MVCP/MVCS for older machines
To be able to execute the MVCP/MVCS instructions the kernel needs to
switch to primary mode. The control register %cr1 has to be set to the
kernel ASCE and %cr7 to either the kernel ASCE or the user ASCE dependent
on set_fs(KERNEL_DS) vs set_fs(USER_DS).
* Data access in the user address space for strnlen / futex
To use "normal" instruction with data from the user address space the
secondary space mode is used. The kernel needs to switch to primary mode,
%cr1 has to contain the kernel ASCE and %cr7 either the user ASCE or the
kernel ASCE, dependent on set_fs.
To load a new value into %cr1 or %cr7 is an expensive operation, the kernel
tries to be lazy about it. E.g. for multiple user copies in a row with
MVCP/MVCS the replacement of the vdso ASCE in %cr7 with the user ASCE is
done only once. On return to user space a CPU bit is checked that loads the
vdso ASCE again.
To enable and disable the data access via the secondary space two new
functions are added, enable_sacf_uaccess and disable_sacf_uaccess. The fact
that a context is in secondary space uaccess mode is stored in the
mm_segment_t value for the task. The code of an interrupt may use set_fs
as long as it returns to the previous state it got with get_fs with another
call to set_fs. The code in finish_arch_post_lock_switch simply has to do a
set_fs with the current mm_segment_t value for the task.
For CPUs with MVCOS:
CPU running in | %cr1 ASCE | %cr7 ASCE |
--------------------------------------|-----------|-----------|
user space | user | vdso |
kernel, USER_DS, normal-mode | user | vdso |
kernel, USER_DS, normal-mode, lazy | user | user |
kernel, USER_DS, sacf-mode | kernel | user |
kernel, KERNEL_DS, normal-mode | kernel | vdso |
kernel, KERNEL_DS, normal-mode, lazy | kernel | kernel |
kernel, KERNEL_DS, sacf-mode | kernel | kernel |
For CPUs without MVCOS:
CPU running in | %cr1 ASCE | %cr7 ASCE |
--------------------------------------|-----------|-----------|
user space | user | vdso |
kernel, USER_DS, normal-mode | user | vdso |
kernel, USER_DS, normal-mode lazy | kernel | user |
kernel, USER_DS, sacf-mode | kernel | user |
kernel, KERNEL_DS, normal-mode | kernel | vdso |
kernel, KERNEL_DS, normal-mode, lazy | kernel | kernel |
kernel, KERNEL_DS, sacf-mode | kernel | kernel |
The lines with "lazy" refer to the state after a copy via the secondary
space with a delayed reload of %cr1 and %cr7.
There are three hardware address spaces that can cause a DAT exception,
primary, secondary and home space. The exception can be related to
four different fault types: user space fault, vdso fault, kernel fault,
and the gmap faults.
Dependent on the set_fs state and normal vs. sacf mode there are a number
of fault combinations:
1) user address space fault via the primary ASCE
2) gmap address space fault via the primary ASCE
3) kernel address space fault via the primary ASCE for machines with
MVCOS and set_fs(KERNEL_DS)
4) vdso address space faults via the secondary ASCE with an invalid
address while running in secondary space in problem state
5) user address space fault via the secondary ASCE for user-copy
based on the secondary space mode, e.g. futex_ops or strnlen_user
6) kernel address space fault via the secondary ASCE for user-copy
with secondary space mode with set_fs(KERNEL_DS)
7) kernel address space fault via the primary ASCE for user-copy
with secondary space mode with set_fs(USER_DS) on machines without
MVCOS.
8) kernel address space fault via the home space ASCE
Replace user_space_fault() with a new function get_fault_type() that
can distinguish all four different fault types.
With these changes the futex atomic ops from the kernel and the
strnlen_user will get a little bit slower, as well as the old style
uaccess with MVCP/MVCS. All user accesses based on MVCOS will be as
fast as before. On the positive side, the user space vdso code is a
lot faster and Linux ceases to use the complicated AR mode.
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2017-08-22 18:08:22 +08:00
|
|
|
larl %r0,boot_vdso_data
|
2008-12-31 22:11:42 +08:00
|
|
|
stg %r0,__LC_VDSO_PER_CPU
|
2006-09-20 21:59:15 +08:00
|
|
|
#
|
|
|
|
# Setup stack
|
|
|
|
#
|
2016-11-08 18:08:26 +08:00
|
|
|
larl %r14,init_task
|
2006-09-28 22:56:37 +08:00
|
|
|
stg %r14,__LC_CURRENT
|
2016-11-08 18:08:26 +08:00
|
|
|
larl %r15,init_thread_union
|
2016-11-14 21:39:16 +08:00
|
|
|
aghi %r15,1<<(PAGE_SHIFT+THREAD_SIZE_ORDER) # init_task_union + THREAD_SIZE
|
2006-09-28 22:56:37 +08:00
|
|
|
stg %r15,__LC_KERNEL_STACK # set end of kernel stack
|
|
|
|
aghi %r15,-160
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
2007-02-06 04:18:24 +08:00
|
|
|
# Save ipl parameters, clear bss memory, initialize storage key for kernel pages,
|
|
|
|
# and create a kernel NSS if the SAVESYS= parm is defined
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
2007-02-06 04:18:24 +08:00
|
|
|
brasl %r14,startup_init
|
2006-09-28 22:56:37 +08:00
|
|
|
lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space,
|
|
|
|
# virtual and never return ...
|
|
|
|
.align 16
|
2010-02-27 05:37:53 +08:00
|
|
|
.LPG1:
|
2006-09-28 22:56:37 +08:00
|
|
|
.Lentry:.quad 0x0000000180000000,_stext
|
2011-07-24 16:48:29 +08:00
|
|
|
.Lctl: .quad 0x04040000 # cr0: AFP registers & secondary space
|
2006-09-28 22:56:37 +08:00
|
|
|
.quad 0 # cr1: primary space segment table
|
|
|
|
.quad .Lduct # cr2: dispatchable unit control table
|
|
|
|
.quad 0 # cr3: instruction authorization
|
2017-04-04 18:55:11 +08:00
|
|
|
.quad 0xffff # cr4: instruction authorization
|
2007-03-06 06:35:54 +08:00
|
|
|
.quad .Lduct # cr5: primary-aste origin
|
2006-09-28 22:56:37 +08:00
|
|
|
.quad 0 # cr6: I/O interrupts
|
|
|
|
.quad 0 # cr7: secondary space segment table
|
|
|
|
.quad 0 # cr8: access registers translation
|
|
|
|
.quad 0 # cr9: tracing off
|
|
|
|
.quad 0 # cr10: tracing off
|
|
|
|
.quad 0 # cr11: tracing off
|
|
|
|
.quad 0 # cr12: tracing off
|
|
|
|
.quad 0 # cr13: home space segment table
|
|
|
|
.quad 0xc0000000 # cr14: machine check handling off
|
2014-02-04 00:37:15 +08:00
|
|
|
.quad .Llinkage_stack # cr15: linkage stack operations
|
2006-09-28 22:56:37 +08:00
|
|
|
.Lpcmsk:.quad 0x0000000180000000
|
2005-04-17 06:20:36 +08:00
|
|
|
.L4malign:.quad 0xffffffffffc00000
|
2006-09-28 22:56:37 +08:00
|
|
|
.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
|
|
|
|
.Lnop: .long 0x07000700
|
2006-06-29 20:58:17 +08:00
|
|
|
.Lparmaddr:
|
|
|
|
.quad PARMAREA
|
2007-03-06 06:35:54 +08:00
|
|
|
.align 64
|
2014-02-04 00:37:15 +08:00
|
|
|
.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0
|
2007-03-06 06:35:54 +08:00
|
|
|
.long 0,0,0,0,0,0,0,0
|
2014-02-04 00:37:15 +08:00
|
|
|
.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0
|
2007-03-06 06:35:54 +08:00
|
|
|
.align 128
|
|
|
|
.Lduald:.rept 8
|
|
|
|
.long 0x80000000,0,0,0 # invalid access-list entries
|
|
|
|
.endr
|
2014-02-04 00:37:15 +08:00
|
|
|
.Llinkage_stack:
|
|
|
|
.long 0,0,0x89000000,0,0,0,0x8a000000,0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2011-07-24 16:48:19 +08:00
|
|
|
ENTRY(_ehead)
|
2010-02-27 05:37:53 +08:00
|
|
|
|
2010-05-12 15:32:13 +08:00
|
|
|
.org 0x100000 - 0x11000 # head.o ends at 0x11000
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
2006-06-29 20:58:17 +08:00
|
|
|
# startup-code, running in absolute addressing mode
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
2011-07-24 16:48:19 +08:00
|
|
|
ENTRY(_stext)
|
|
|
|
basr %r13,0 # get base
|
2005-10-31 07:00:11 +08:00
|
|
|
.LPG3:
|
2005-04-17 06:20:36 +08:00
|
|
|
# check control registers
|
2006-09-28 22:56:37 +08:00
|
|
|
stctg %c0,%c15,0(%r15)
|
2011-10-30 22:16:58 +08:00
|
|
|
oi 6(%r15),0x60 # enable sigp emergency & external call
|
2006-09-28 22:56:37 +08:00
|
|
|
oi 4(%r15),0x10 # switch on low address proctection
|
|
|
|
lctlg %c0,%c15,0(%r15)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-09-28 22:56:37 +08:00
|
|
|
lam 0,15,.Laregs-.LPG3(%r13) # load acrs needed by uaccess
|
|
|
|
brasl %r14,start_kernel # go to C code
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# We returned from start_kernel ?!? PANIK
|
|
|
|
#
|
2006-09-28 22:56:37 +08:00
|
|
|
basr %r13,0
|
|
|
|
lpswe .Ldw-.(%r13) # load disabled wait psw
|
2006-09-20 21:59:15 +08:00
|
|
|
|
2006-09-28 22:56:37 +08:00
|
|
|
.align 8
|
|
|
|
.Ldw: .quad 0x0002000180000000,0x0000000000000000
|
|
|
|
.Laregs:.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|