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-09-26 14:04:21 +08:00
|
|
|
#
|
|
|
|
# Makefile for the linux ppc-specific parts of the memory manager.
|
|
|
|
#
|
|
|
|
|
2012-11-27 01:41:08 +08:00
|
|
|
ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
|
2005-10-11 17:40:20 +08:00
|
|
|
|
2018-09-14 23:30:51 +08:00
|
|
|
CFLAGS_REMOVE_slb.o = $(CC_FLAGS_FTRACE)
|
|
|
|
|
2014-11-06 00:27:41 +08:00
|
|
|
obj-y := fault.o mem.o pgtable.o mmap.o \
|
2016-12-07 15:47:24 +08:00
|
|
|
init_$(BITS).o pgtable_$(BITS).o \
|
2017-12-02 00:47:08 +08:00
|
|
|
init-common.o mmu_context.o drmem.o
|
2008-12-19 03:13:42 +08:00
|
|
|
obj-$(CONFIG_PPC_MMU_NOHASH) += mmu_context_nohash.o tlb_nohash.o \
|
|
|
|
tlb_nohash_low.o
|
2016-08-11 14:03:14 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3E) += tlb_low_$(BITS)e.o
|
2009-06-03 05:17:45 +08:00
|
|
|
hash64-$(CONFIG_PPC_NATIVE) := hash_native_64.o
|
2016-04-29 21:25:44 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3E_64) += pgtable-book3e.o
|
2018-11-29 22:06:51 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3S_64) += pgtable-hash64.o hash_utils_64.o slb.o \
|
|
|
|
$(hash64-y) mmu_context_book3s64.o \
|
|
|
|
pgtable-book3s64.o pgtable-frag.o
|
2018-11-29 22:07:01 +08:00
|
|
|
obj-$(CONFIG_PPC32) += pgtable-frag.o
|
2016-04-29 21:26:05 +08:00
|
|
|
obj-$(CONFIG_PPC_RADIX_MMU) += pgtable-radix.o tlb-radix.o
|
2018-11-17 18:25:02 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3S_32) += ppc_mmu_32.o hash_low_32.o mmu_context_hash32.o
|
2018-11-17 18:25:04 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3S) += tlb_hash$(BITS).o
|
2018-08-07 00:42:03 +08:00
|
|
|
ifdef CONFIG_PPC_BOOK3S_64
|
2015-12-01 11:36:49 +08:00
|
|
|
obj-$(CONFIG_PPC_4K_PAGES) += hash64_4k.o
|
2015-12-01 11:36:43 +08:00
|
|
|
obj-$(CONFIG_PPC_64K_PAGES) += hash64_64k.o
|
|
|
|
endif
|
2007-08-20 20:27:07 +08:00
|
|
|
obj-$(CONFIG_40x) += 40x_mmu.o
|
2005-09-26 14:04:21 +08:00
|
|
|
obj-$(CONFIG_44x) += 44x_mmu.o
|
powerpc/8xx: Map linear kernel RAM with 8M pages
On a live running system (VoIP gateway for Air Trafic Control), over
a 10 minutes period (with 277s idle), we get 87 millions DTLB misses
and approximatly 35 secondes are spent in DTLB handler.
This represents 5.8% of the overall time and even 10.8% of the
non-idle time.
Among those 87 millions DTLB misses, 15% are on user addresses and
85% are on kernel addresses. And within the kernel addresses, 93%
are on addresses from the linear address space and only 7% are on
addresses from the virtual address space.
MPC8xx has no BATs but it has 8Mb page size. This patch implements
mapping of kernel RAM using 8Mb pages, on the same model as what is
done on the 40x.
In 4k pages mode, each PGD entry maps a 4Mb area: we map every two
entries to the same 8Mb physical page. In each second entry, we add
4Mb to the page physical address to ease life of the FixupDAR
routine. This is just ignored by HW.
In 16k pages mode, each PGD entry maps a 64Mb area: each PGD entry
will point to the first page of the area. The DTLB handler adds
the 3 bits from EPN to map the correct page.
With this patch applied, we now get only 13 millions TLB misses
during the 10 minutes period. The idle time has increased to 313s
and the overall time spent in DTLB miss handler is 6.3s, which
represents 1% of the overall time and 2.2% of non-idle time.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <oss@buserror.net>
2016-02-10 00:07:50 +08:00
|
|
|
obj-$(CONFIG_PPC_8xx) += 8xx_mmu.o
|
2009-10-17 07:48:40 +08:00
|
|
|
obj-$(CONFIG_PPC_FSL_BOOK3E) += fsl_booke_mmu.o
|
2005-10-10 19:58:35 +08:00
|
|
|
obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
|
2015-02-23 23:14:31 +08:00
|
|
|
obj-$(CONFIG_PPC_SPLPAR) += vphn.o
|
2007-05-08 14:27:27 +08:00
|
|
|
obj-$(CONFIG_PPC_MM_SLICES) += slice.o
|
2009-10-27 03:24:31 +08:00
|
|
|
obj-y += hugetlbpage.o
|
2018-08-07 00:42:03 +08:00
|
|
|
ifdef CONFIG_HUGETLB_PAGE
|
2017-10-19 12:08:43 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3S_64) += hugetlbpage-hash64.o
|
2016-04-29 21:26:25 +08:00
|
|
|
obj-$(CONFIG_PPC_RADIX_MMU) += hugetlbpage-radix.o
|
2011-06-28 17:54:48 +08:00
|
|
|
obj-$(CONFIG_PPC_BOOK3E_MMU) += hugetlbpage-book3e.o
|
2009-10-27 03:24:31 +08:00
|
|
|
endif
|
2013-06-20 17:00:21 +08:00
|
|
|
obj-$(CONFIG_TRANSPARENT_HUGEPAGE) += hugepage-hash64.o
|
[POWERPC] Provide a way to protect 4k subpages when using 64k pages
Using 64k pages on 64-bit PowerPC systems makes life difficult for
emulators that are trying to emulate an ISA, such as x86, which use a
smaller page size, since the emulator can no longer use the MMU and
the normal system calls for controlling page protections. Of course,
the emulator can emulate the MMU by checking and possibly remapping
the address for each memory access in software, but that is pretty
slow.
This provides a facility for such programs to control the access
permissions on individual 4k sub-pages of 64k pages. The idea is
that the emulator supplies an array of protection masks to apply to a
specified range of virtual addresses. These masks are applied at the
level where hardware PTEs are inserted into the hardware page table
based on the Linux PTEs, so the Linux PTEs are not affected. Note
that this new mechanism does not allow any access that would otherwise
be prohibited; it can only prohibit accesses that would otherwise be
allowed. This new facility is only available on 64-bit PowerPC and
only when the kernel is configured for 64k pages.
The masks are supplied using a new subpage_prot system call, which
takes a starting virtual address and length, and a pointer to an array
of protection masks in memory. The array has a 32-bit word per 64k
page to be protected; each 32-bit word consists of 16 2-bit fields,
for which 0 allows any access (that is otherwise allowed), 1 prevents
write accesses, and 2 or 3 prevent any access.
Implicit in this is that the regions of the address space that are
protected are switched to use 4k hardware pages rather than 64k
hardware pages (on machines with hardware 64k page support). In fact
the whole process is switched to use 4k hardware pages when the
subpage_prot system call is used, but this could be improved in future
to switch only the affected segments.
The subpage protection bits are stored in a 3 level tree akin to the
page table tree. The top level of this tree is stored in a structure
that is appended to the top level of the page table tree, i.e., the
pgd array. Since it will often only be 32-bit addresses (below 4GB)
that are protected, the pointers to the first four bottom level pages
are also stored in this structure (each bottom level page contains the
protection bits for 1GB of address space), so the protection bits for
addresses below 4GB can be accessed with one fewer loads than those
for higher addresses.
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-01-24 05:35:13 +08:00
|
|
|
obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o
|
2009-05-27 11:36:10 +08:00
|
|
|
obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
|
2009-06-19 03:25:00 +08:00
|
|
|
obj-$(CONFIG_HIGHMEM) += highmem.o
|
2014-10-08 16:54:50 +08:00
|
|
|
obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o
|
2015-06-05 14:35:24 +08:00
|
|
|
obj-$(CONFIG_SPAPR_TCE_IOMMU) += mmu_context_iommu.o
|
2019-02-18 20:28:36 +08:00
|
|
|
obj-$(CONFIG_PPC_PTDUMP) += ptdump/
|
2018-01-19 09:50:24 +08:00
|
|
|
obj-$(CONFIG_PPC_MEM_KEYS) += pkeys.o
|
2019-02-22 08:40:46 +08:00
|
|
|
|
|
|
|
# Disable kcov instrumentation on sensitive code
|
|
|
|
# This is necessary for booting with kcov enabled on book3e machines
|
|
|
|
KCOV_INSTRUMENT_tlb_nohash.o := n
|
|
|
|
KCOV_INSTRUMENT_fsl_booke_mmu.o := n
|