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 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* S390 version
|
2017-06-27 10:44:11 +00:00
|
|
|
* Copyright IBM Corp. 1999, 2017
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
#ifndef _ASM_S390_SETUP_H
|
|
|
|
#define _ASM_S390_SETUP_H
|
|
|
|
|
2019-07-16 23:27:01 +00:00
|
|
|
#include <linux/bits.h>
|
2012-10-09 08:47:31 +00:00
|
|
|
#include <uapi/asm/setup.h>
|
2020-01-22 12:38:22 +00:00
|
|
|
#include <linux/build_bug.h>
|
2006-12-07 04:40:38 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#define PARMAREA 0x10400
|
2019-04-08 10:49:58 +00:00
|
|
|
|
2021-09-29 07:09:34 +00:00
|
|
|
#define COMMAND_LINE_SIZE CONFIG_COMMAND_LINE_SIZE
|
2015-10-01 15:02:48 +00:00
|
|
|
/*
|
2015-12-15 08:26:30 +00:00
|
|
|
* Machine features detected in early.c
|
2015-10-01 15:02:48 +00:00
|
|
|
*/
|
|
|
|
|
2019-07-16 23:27:01 +00:00
|
|
|
#define MACHINE_FLAG_VM BIT(0)
|
|
|
|
#define MACHINE_FLAG_KVM BIT(1)
|
|
|
|
#define MACHINE_FLAG_LPAR BIT(2)
|
|
|
|
#define MACHINE_FLAG_DIAG9C BIT(3)
|
|
|
|
#define MACHINE_FLAG_ESOP BIT(4)
|
|
|
|
#define MACHINE_FLAG_IDTE BIT(5)
|
|
|
|
#define MACHINE_FLAG_EDAT1 BIT(7)
|
|
|
|
#define MACHINE_FLAG_EDAT2 BIT(8)
|
|
|
|
#define MACHINE_FLAG_TOPOLOGY BIT(10)
|
|
|
|
#define MACHINE_FLAG_TE BIT(11)
|
|
|
|
#define MACHINE_FLAG_TLB_LC BIT(12)
|
|
|
|
#define MACHINE_FLAG_VX BIT(13)
|
|
|
|
#define MACHINE_FLAG_TLB_GUEST BIT(14)
|
|
|
|
#define MACHINE_FLAG_NX BIT(15)
|
|
|
|
#define MACHINE_FLAG_GS BIT(16)
|
|
|
|
#define MACHINE_FLAG_SCC BIT(17)
|
2021-07-08 12:55:42 +00:00
|
|
|
#define MACHINE_FLAG_PCI_MIO BIT(18)
|
s390/mm: add support for RDP (Reset DAT-Protection)
RDP instruction allows to reset DAT-protection bit in a PTE, with less
CPU synchronization overhead than IPTE instruction. In particular, IPTE
can cause machine-wide synchronization overhead, and excessive IPTE usage
can negatively impact machine performance.
RDP can be used instead of IPTE, if the new PTE only differs in SW bits
and _PAGE_PROTECT HW bit, for PTE protection changes from RO to RW.
SW PTE bit changes are allowed, e.g. for dirty and young tracking, but none
of the other HW-defined part of the PTE must change. This is because the
architecture forbids such changes to an active and valid PTE, which
is why invalidation with IPTE is always used first, before writing a new
entry.
The RDP optimization helps mainly for fault-driven SW dirty-bit tracking.
Writable PTEs are initially always mapped with HW _PAGE_PROTECT bit set,
to allow SW dirty-bit accounting on first write protection fault, where
the DAT-protection would then be reset. The reset is now done with RDP
instead of IPTE, if RDP instruction is available.
RDP cannot always guarantee that the DAT-protection reset is propagated
to all CPUs immediately. This means that spurious TLB protection faults
on other CPUs can now occur. For this, common code provides a
flush_tlb_fix_spurious_fault() handler, which will now be used to do a
CPU-local TLB flush. However, this will clear the whole TLB of a CPU, and
not just the affected entry. For more fine-grained flushing, by simply
doing a (local) RDP again, flush_tlb_fix_spurious_fault() would need to
also provide the PTE pointer.
Note that spurious TLB protection faults cannot really be distinguished
from racing pagetable updates, where another thread already installed the
correct PTE. In such a case, the local TLB flush would be unnecessary
overhead, but overall reduction of CPU synchronization overhead by not
using IPTE is still expected to be beneficial.
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-02-06 16:48:21 +00:00
|
|
|
#define MACHINE_FLAG_RDP BIT(19)
|
2019-07-16 23:27:01 +00:00
|
|
|
|
|
|
|
#define LPP_MAGIC BIT(31)
|
2016-03-08 13:00:23 +00:00
|
|
|
#define LPP_PID_MASK _AC(0xffffffff, UL)
|
2015-10-06 16:06:15 +00:00
|
|
|
|
2017-06-27 10:44:11 +00:00
|
|
|
/* Offsets to entry points in kernel/head.S */
|
|
|
|
|
|
|
|
#define STARTUP_NORMAL_OFFSET 0x10000
|
|
|
|
#define STARTUP_KDUMP_OFFSET 0x10010
|
|
|
|
|
2021-09-23 19:22:52 +00:00
|
|
|
#define LEGACY_COMMAND_LINE_SIZE 896
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
2010-02-26 21:37:43 +00:00
|
|
|
#include <asm/lowcore.h>
|
|
|
|
#include <asm/types.h>
|
|
|
|
|
2019-03-06 16:36:26 +00:00
|
|
|
struct parmarea {
|
|
|
|
unsigned long ipl_device; /* 0x10400 */
|
|
|
|
unsigned long initrd_start; /* 0x10408 */
|
|
|
|
unsigned long initrd_size; /* 0x10410 */
|
|
|
|
unsigned long oldmem_base; /* 0x10418 */
|
|
|
|
unsigned long oldmem_size; /* 0x10420 */
|
2019-07-15 13:30:33 +00:00
|
|
|
unsigned long kernel_version; /* 0x10428 */
|
2021-09-23 19:22:52 +00:00
|
|
|
unsigned long max_command_line_size; /* 0x10430 */
|
|
|
|
char pad1[0x10480-0x10438]; /* 0x10438 - 0x10480 */
|
|
|
|
char command_line[COMMAND_LINE_SIZE]; /* 0x10480 */
|
2019-03-06 16:36:26 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 17:12:39 +00:00
|
|
|
extern struct parmarea parmarea;
|
|
|
|
|
2020-01-31 06:16:27 +00:00
|
|
|
extern unsigned int zlib_dfltcc_support;
|
|
|
|
#define ZLIB_DFLTCC_DISABLED 0
|
|
|
|
#define ZLIB_DFLTCC_FULL 1
|
|
|
|
#define ZLIB_DFLTCC_DEFLATE_ONLY 2
|
|
|
|
#define ZLIB_DFLTCC_INFLATE_ONLY 3
|
|
|
|
#define ZLIB_DFLTCC_FULL_DEBUG 4
|
|
|
|
|
2017-11-17 17:44:28 +00:00
|
|
|
extern int noexec_disabled;
|
2020-10-19 09:01:33 +00:00
|
|
|
extern unsigned long ident_map_size;
|
2006-12-04 14:40:38 +00:00
|
|
|
|
2020-07-13 12:12:49 +00:00
|
|
|
/* The Write Back bit position in the physaddr is given by the SLPC PCI */
|
|
|
|
extern unsigned long mio_wb_bit_mask;
|
|
|
|
|
2009-04-14 13:36:16 +00:00
|
|
|
#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
|
|
|
|
#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
|
2010-02-26 21:37:38 +00:00
|
|
|
#define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
|
|
|
|
|
2009-04-14 13:36:16 +00:00
|
|
|
#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
|
2012-11-07 12:17:37 +00:00
|
|
|
#define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
|
2009-04-14 13:36:16 +00:00
|
|
|
#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
|
2012-09-28 13:06:41 +00:00
|
|
|
#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
|
2012-09-27 08:45:06 +00:00
|
|
|
#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
|
2010-10-25 14:10:52 +00:00
|
|
|
#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
|
2012-07-31 09:03:04 +00:00
|
|
|
#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
|
2014-04-03 11:55:01 +00:00
|
|
|
#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
|
2014-10-06 15:53:53 +00:00
|
|
|
#define MACHINE_HAS_VX (S390_lowcore.machine_flags & MACHINE_FLAG_VX)
|
2016-07-26 14:53:09 +00:00
|
|
|
#define MACHINE_HAS_TLB_GUEST (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_GUEST)
|
2016-03-22 09:54:24 +00:00
|
|
|
#define MACHINE_HAS_NX (S390_lowcore.machine_flags & MACHINE_FLAG_NX)
|
2016-01-26 13:10:34 +00:00
|
|
|
#define MACHINE_HAS_GS (S390_lowcore.machine_flags & MACHINE_FLAG_GS)
|
2016-10-27 10:41:39 +00:00
|
|
|
#define MACHINE_HAS_SCC (S390_lowcore.machine_flags & MACHINE_FLAG_SCC)
|
2021-07-08 12:55:42 +00:00
|
|
|
#define MACHINE_HAS_PCI_MIO (S390_lowcore.machine_flags & MACHINE_FLAG_PCI_MIO)
|
s390/mm: add support for RDP (Reset DAT-Protection)
RDP instruction allows to reset DAT-protection bit in a PTE, with less
CPU synchronization overhead than IPTE instruction. In particular, IPTE
can cause machine-wide synchronization overhead, and excessive IPTE usage
can negatively impact machine performance.
RDP can be used instead of IPTE, if the new PTE only differs in SW bits
and _PAGE_PROTECT HW bit, for PTE protection changes from RO to RW.
SW PTE bit changes are allowed, e.g. for dirty and young tracking, but none
of the other HW-defined part of the PTE must change. This is because the
architecture forbids such changes to an active and valid PTE, which
is why invalidation with IPTE is always used first, before writing a new
entry.
The RDP optimization helps mainly for fault-driven SW dirty-bit tracking.
Writable PTEs are initially always mapped with HW _PAGE_PROTECT bit set,
to allow SW dirty-bit accounting on first write protection fault, where
the DAT-protection would then be reset. The reset is now done with RDP
instead of IPTE, if RDP instruction is available.
RDP cannot always guarantee that the DAT-protection reset is propagated
to all CPUs immediately. This means that spurious TLB protection faults
on other CPUs can now occur. For this, common code provides a
flush_tlb_fix_spurious_fault() handler, which will now be used to do a
CPU-local TLB flush. However, this will clear the whole TLB of a CPU, and
not just the affected entry. For more fine-grained flushing, by simply
doing a (local) RDP again, flush_tlb_fix_spurious_fault() would need to
also provide the PTE pointer.
Note that spurious TLB protection faults cannot really be distinguished
from racing pagetable updates, where another thread already installed the
correct PTE. In such a case, the local TLB flush would be unnecessary
overhead, but overall reduction of CPU synchronization overhead by not
using IPTE is still expected to be beneficial.
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-02-06 16:48:21 +00:00
|
|
|
#define MACHINE_HAS_RDP (S390_lowcore.machine_flags & MACHINE_FLAG_RDP)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Console mode. Override with conmode=
|
|
|
|
*/
|
|
|
|
extern unsigned int console_mode;
|
|
|
|
extern unsigned int console_devno;
|
|
|
|
extern unsigned int console_irq;
|
|
|
|
|
|
|
|
#define CONSOLE_IS_UNDEFINED (console_mode == 0)
|
|
|
|
#define CONSOLE_IS_SCLP (console_mode == 1)
|
|
|
|
#define CONSOLE_IS_3215 (console_mode == 2)
|
|
|
|
#define CONSOLE_IS_3270 (console_mode == 3)
|
2016-07-07 05:52:38 +00:00
|
|
|
#define CONSOLE_IS_VT220 (console_mode == 4)
|
|
|
|
#define CONSOLE_IS_HVC (console_mode == 5)
|
2005-04-16 22:20:36 +00:00
|
|
|
#define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
|
|
|
|
#define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
|
|
|
|
#define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
|
2016-07-07 05:52:38 +00:00
|
|
|
#define SET_CONSOLE_VT220 do { console_mode = 4; } while (0)
|
|
|
|
#define SET_CONSOLE_HVC do { console_mode = 5; } while (0)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2012-03-28 17:30:02 +00:00
|
|
|
#ifdef CONFIG_PFAULT
|
|
|
|
extern int pfault_init(void);
|
|
|
|
extern void pfault_fini(void);
|
|
|
|
#else /* CONFIG_PFAULT */
|
|
|
|
#define pfault_init() ({-1;})
|
|
|
|
#define pfault_fini() do { } while (0)
|
|
|
|
#endif /* CONFIG_PFAULT */
|
|
|
|
|
2017-08-07 13:16:15 +00:00
|
|
|
#ifdef CONFIG_VMCP
|
|
|
|
void vmcp_cma_reserve(void);
|
|
|
|
#else
|
|
|
|
static inline void vmcp_cma_reserve(void) { }
|
|
|
|
#endif
|
|
|
|
|
2016-02-24 13:27:46 +00:00
|
|
|
void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault);
|
|
|
|
|
2016-06-14 10:56:01 +00:00
|
|
|
void cmma_init(void);
|
|
|
|
void cmma_init_nodat(void);
|
2012-03-28 17:30:02 +00:00
|
|
|
|
|
|
|
extern void (*_machine_restart)(char *command);
|
|
|
|
extern void (*_machine_halt)(void);
|
|
|
|
extern void (*_machine_power_off)(void);
|
|
|
|
|
2019-02-03 20:37:20 +00:00
|
|
|
extern unsigned long __kaslr_offset;
|
|
|
|
static inline unsigned long kaslr_offset(void)
|
|
|
|
{
|
|
|
|
return __kaslr_offset;
|
|
|
|
}
|
|
|
|
|
2023-03-31 13:03:22 +00:00
|
|
|
extern int __kaslr_enabled;
|
|
|
|
static inline int kaslr_enabled(void)
|
|
|
|
{
|
|
|
|
if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
|
|
|
|
return __kaslr_enabled;
|
|
|
|
return 0;
|
|
|
|
}
|
2021-06-15 12:15:07 +00:00
|
|
|
|
2021-06-15 12:25:41 +00:00
|
|
|
struct oldmem_data {
|
|
|
|
unsigned long start;
|
|
|
|
unsigned long size;
|
|
|
|
};
|
|
|
|
extern struct oldmem_data oldmem_data;
|
|
|
|
|
2023-03-09 19:12:28 +00:00
|
|
|
static __always_inline u32 gen_lpswe(unsigned long addr)
|
2020-01-22 12:38:22 +00:00
|
|
|
{
|
|
|
|
BUILD_BUG_ON(addr > 0xfff);
|
|
|
|
return 0xb2b20000 | addr;
|
|
|
|
}
|
2006-02-12 01:56:03 +00:00
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* _ASM_S390_SETUP_H */
|