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
|
2012-11-22 09:33:59 +07:00
|
|
|
#
|
|
|
|
# KVM configuration
|
|
|
|
#
|
|
|
|
source "virt/kvm/Kconfig"
|
|
|
|
|
|
|
|
menuconfig VIRTUALIZATION
|
|
|
|
bool "Virtualization"
|
|
|
|
---help---
|
|
|
|
Say Y here to get to see options for using your Linux host to run
|
|
|
|
other operating systems inside virtual machines (guests).
|
|
|
|
This option alone does not add any kernel code.
|
|
|
|
|
|
|
|
If you say N, all options in this submenu will be skipped and disabled.
|
|
|
|
|
|
|
|
if VIRTUALIZATION
|
|
|
|
|
|
|
|
config KVM
|
|
|
|
tristate "Kernel-based Virtual Machine (KVM) support"
|
|
|
|
depends on HAVE_KVM
|
2018-11-08 06:14:02 +07:00
|
|
|
depends on MIPS_FP_SUPPORT
|
2016-06-23 23:34:39 +07:00
|
|
|
select EXPORT_UASM
|
2012-11-22 09:33:59 +07:00
|
|
|
select PREEMPT_NOTIFIERS
|
2016-12-06 21:50:52 +07:00
|
|
|
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
|
2020-05-23 14:56:31 +07:00
|
|
|
select HAVE_KVM_EVENTFD
|
2017-12-12 23:41:34 +07:00
|
|
|
select HAVE_KVM_VCPU_ASYNC_IOCTL
|
2012-11-22 09:33:59 +07:00
|
|
|
select KVM_MMIO
|
KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU
Implement the SYNC_MMU capability for KVM MIPS, allowing changes in the
underlying user host virtual address (HVA) mappings to be promptly
reflected in the corresponding guest physical address (GPA) mappings.
This allows for several features to work with guest RAM which require
mappings to be altered or protected, such as copy-on-write, KSM (Kernel
Samepage Merging), idle page tracking, memory swapping, and guest memory
ballooning.
There are two main aspects of this change, described below.
The KVM MMU notifier architecture callbacks are implemented so we can be
notified of changes in the HVA mappings. These arrange for the guest
physical address (GPA) page tables to be modified and possibly for
derived mappings (GVA page tables and TLBs) to be flushed.
- kvm_unmap_hva[_range]() - These deal with HVA mappings being removed,
for example before a copy-on-write takes place, which requires the
corresponding GPA page table mappings to be removed too.
- kvm_set_spte_hva() - These update a GPA page table entry to match the
new HVA entry, but must be careful to respect KVM specific
configuration such as not dirtying a clean guest page which is dirty
to the host, and write protecting writable pages in read only
memslots (which will soon be supported).
- kvm[_test]_age_hva() - These update GPA page table entries to be old
(invalid) so that access can be tracked, making them young again.
The GPA page fault handling (kvm_mips_map_page) is updated to use
gfn_to_pfn_prot() (which may provide read-only pages), to handle
asynchronous page table invalidation from MMU notifier callbacks, and to
handle more cases in the fast path.
- mmu_notifier_seq is used to detect asynchronous page table
invalidations while we're holding a pfn from gfn_to_pfn_prot()
outside of kvm->mmu_lock, retrying if invalidations have taken place,
e.g. a COW or a KSM page merge.
- The fast path (_kvm_mips_map_page_fast) now handles marking old pages
as young / accessed, and disallowing dirtying of clean pages that
aren't actually writable (e.g. shared pages that should COW, and
read-only memory regions when they are enabled in a future patch).
- Due to the use of MMU notifications we no longer need to keep the
page references after we've updated the GPA page tables.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
2016-12-13 23:32:39 +07:00
|
|
|
select MMU_NOTIFIER
|
2014-12-05 23:24:45 +07:00
|
|
|
select SRCU
|
2012-11-22 09:33:59 +07:00
|
|
|
---help---
|
|
|
|
Support for hosting Guest kernels.
|
2017-03-14 17:15:32 +07:00
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "Virtualization mode"
|
|
|
|
depends on KVM
|
|
|
|
default KVM_MIPS_TE
|
|
|
|
|
|
|
|
config KVM_MIPS_TE
|
|
|
|
bool "Trap & Emulate"
|
|
|
|
---help---
|
|
|
|
Use trap and emulate to virtualize 32-bit guests in user mode. This
|
|
|
|
does not require any special hardware Virtualization support beyond
|
|
|
|
standard MIPS32/64 r2 or later, but it does require the guest kernel
|
|
|
|
to be configured with CONFIG_KVM_GUEST=y so that it resides in the
|
|
|
|
user address segment.
|
|
|
|
|
|
|
|
config KVM_MIPS_VZ
|
|
|
|
bool "MIPS Virtualization (VZ) ASE"
|
|
|
|
---help---
|
|
|
|
Use the MIPS Virtualization (VZ) ASE to virtualize guests. This
|
|
|
|
supports running unmodified guest kernels (with CONFIG_KVM_GUEST=n),
|
|
|
|
but requires hardware support.
|
|
|
|
|
|
|
|
endchoice
|
2012-11-22 09:33:59 +07:00
|
|
|
|
|
|
|
config KVM_MIPS_DYN_TRANS
|
|
|
|
bool "KVM/MIPS: Dynamic binary translation to reduce traps"
|
2017-03-14 17:15:32 +07:00
|
|
|
depends on KVM_MIPS_TE
|
|
|
|
default y
|
2012-11-22 09:33:59 +07:00
|
|
|
---help---
|
|
|
|
When running in Trap & Emulate mode patch privileged
|
|
|
|
instructions to reduce the number of traps.
|
|
|
|
|
|
|
|
If unsure, say Y.
|
|
|
|
|
|
|
|
config KVM_MIPS_DEBUG_COP0_COUNTERS
|
|
|
|
bool "Maintain counters for COP0 accesses"
|
|
|
|
depends on KVM
|
|
|
|
---help---
|
|
|
|
Maintain statistics for Guest COP0 accesses.
|
|
|
|
A histogram of COP0 accesses is printed when the VM is
|
|
|
|
shutdown.
|
|
|
|
|
|
|
|
If unsure, say N.
|
|
|
|
|
|
|
|
endif # VIRTUALIZATION
|