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 */
|
2008-06-20 14:18:09 +08:00
|
|
|
#ifndef ARCH_X86_CPU_H
|
|
|
|
#define ARCH_X86_CPU_H
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* attempt to consolidate cpu attributes */
|
|
|
|
struct cpu_dev {
|
2009-03-23 04:36:51 +08:00
|
|
|
const char *c_vendor;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* some have two possibilities for cpuid string */
|
2009-03-23 04:36:51 +08:00
|
|
|
const char *c_ident[2];
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-03-23 04:36:51 +08:00
|
|
|
void (*c_early_init)(struct cpuinfo_x86 *);
|
2011-08-06 02:01:16 +08:00
|
|
|
void (*c_bsp_init)(struct cpuinfo_x86 *);
|
2009-03-23 04:36:51 +08:00
|
|
|
void (*c_init)(struct cpuinfo_x86 *);
|
|
|
|
void (*c_identify)(struct cpuinfo_x86 *);
|
x86/tlb_info: get last level TLB entry number of CPU
For 4KB pages, x86 CPU has 2 or 1 level TLB, first level is data TLB and
instruction TLB, second level is shared TLB for both data and instructions.
For hupe page TLB, usually there is just one level and seperated by 2MB/4MB
and 1GB.
Although each levels TLB size is important for performance tuning, but for
genernal and rude optimizing, last level TLB entry number is suitable. And
in fact, last level TLB always has the biggest entry number.
This patch will get the biggest TLB entry number and use it in furture TLB
optimizing.
Accroding Borislav's suggestion, except tlb_ll[i/d]_* array, other
function and data will be released after system boot up.
For all kinds of x86 vendor friendly, vendor specific code was moved to its
specific files.
Signed-off-by: Alex Shi <alex.shi@intel.com>
Link: http://lkml.kernel.org/r/1340845344-27557-2-git-send-email-alex.shi@intel.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-06-28 09:02:16 +08:00
|
|
|
void (*c_detect_tlb)(struct cpuinfo_x86 *);
|
2009-03-23 04:36:51 +08:00
|
|
|
int c_x86_vendor;
|
2013-10-21 16:35:20 +08:00
|
|
|
#ifdef CONFIG_X86_32
|
|
|
|
/* Optional vendor specific routine to obtain the cache size. */
|
|
|
|
unsigned int (*legacy_cache_size)(struct cpuinfo_x86 *,
|
|
|
|
unsigned int);
|
|
|
|
|
|
|
|
/* Family/stepping-based lookup table for model names. */
|
|
|
|
struct legacy_cpu_model_info {
|
|
|
|
int family;
|
|
|
|
const char *model_names[16];
|
|
|
|
} legacy_models[5];
|
|
|
|
#endif
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
x86/tlb_info: get last level TLB entry number of CPU
For 4KB pages, x86 CPU has 2 or 1 level TLB, first level is data TLB and
instruction TLB, second level is shared TLB for both data and instructions.
For hupe page TLB, usually there is just one level and seperated by 2MB/4MB
and 1GB.
Although each levels TLB size is important for performance tuning, but for
genernal and rude optimizing, last level TLB entry number is suitable. And
in fact, last level TLB always has the biggest entry number.
This patch will get the biggest TLB entry number and use it in furture TLB
optimizing.
Accroding Borislav's suggestion, except tlb_ll[i/d]_* array, other
function and data will be released after system boot up.
For all kinds of x86 vendor friendly, vendor specific code was moved to its
specific files.
Signed-off-by: Alex Shi <alex.shi@intel.com>
Link: http://lkml.kernel.org/r/1340845344-27557-2-git-send-email-alex.shi@intel.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-06-28 09:02:16 +08:00
|
|
|
struct _tlb_table {
|
|
|
|
unsigned char descriptor;
|
|
|
|
char tlb_type;
|
|
|
|
unsigned int entries;
|
|
|
|
/* unsigned int ways; */
|
|
|
|
char info[128];
|
|
|
|
};
|
|
|
|
|
2008-09-05 03:09:45 +08:00
|
|
|
#define cpu_dev_register(cpu_devX) \
|
2009-03-12 20:08:49 +08:00
|
|
|
static const struct cpu_dev *const __cpu_dev_##cpu_devX __used \
|
2008-09-05 03:09:45 +08:00
|
|
|
__attribute__((__section__(".x86_cpu_dev.init"))) = \
|
|
|
|
&cpu_devX;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-03-12 20:08:49 +08:00
|
|
|
extern const struct cpu_dev *const __x86_cpu_dev_start[],
|
|
|
|
*const __x86_cpu_dev_end[];
|
x86: use ELF section to list CPU vendor specific code
Replace the hardcoded list of initialization functions for each CPU
vendor by a list in an ELF section, which is read at initialization in
arch/x86/kernel/cpu/cpu.c to fill the cpu_devs[] array. The ELF
section, named .x86cpuvendor.init, is reclaimed after boot, and
contains entries of type "struct cpu_vendor_dev" which associates a
vendor number with a pointer to a "struct cpu_dev" structure.
This first modification allows to remove all the VENDOR_init_cpu()
functions.
This patch also removes the hardcoded calls to early_init_amd() and
early_init_intel(). Instead, we add a "c_early_init" member to the
cpu_dev structure, which is then called if not NULL by the generic CPU
initialization code. Unfortunately, in early_cpu_detect(), this_cpu is
not yet set, so we have to use the cpu_devs[] array directly.
This patch is part of the Linux Tiny project, and is needed for
further patch that will allow to disable compilation of unused CPU
support code.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-02-15 19:00:23 +08:00
|
|
|
|
2010-09-21 09:01:46 +08:00
|
|
|
extern void get_cpu_cap(struct cpuinfo_x86 *c);
|
2018-07-24 20:45:47 +08:00
|
|
|
extern void get_cpu_address_sizes(struct cpuinfo_x86 *c);
|
2009-11-21 21:01:45 +08:00
|
|
|
extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
|
2018-05-13 17:29:07 +08:00
|
|
|
extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
|
2018-05-03 10:32:45 +08:00
|
|
|
extern void init_intel_cacheinfo(struct cpuinfo_x86 *c);
|
2018-05-13 17:29:07 +08:00
|
|
|
extern void init_amd_cacheinfo(struct cpuinfo_x86 *c);
|
2018-09-23 17:33:44 +08:00
|
|
|
extern void init_hygon_cacheinfo(struct cpuinfo_x86 *c);
|
2018-05-13 17:29:07 +08:00
|
|
|
|
2018-05-13 17:43:53 +08:00
|
|
|
extern void detect_num_cpu_cores(struct cpuinfo_x86 *c);
|
2018-06-06 06:55:39 +08:00
|
|
|
extern int detect_extended_topology_early(struct cpuinfo_x86 *c);
|
2018-05-13 17:29:07 +08:00
|
|
|
extern int detect_extended_topology(struct cpuinfo_x86 *c);
|
2018-06-06 06:53:57 +08:00
|
|
|
extern int detect_ht_early(struct cpuinfo_x86 *c);
|
2018-05-13 17:29:07 +08:00
|
|
|
extern void detect_ht(struct cpuinfo_x86 *c);
|
x86 / CPU: Always show current CPU frequency in /proc/cpuinfo
After commit 890da9cf0983 (Revert "x86: do not use cpufreq_quick_get()
for /proc/cpuinfo "cpu MHz"") the "cpu MHz" number in /proc/cpuinfo
on x86 can be either the nominal CPU frequency (which is constant)
or the frequency most recently requested by a scaling governor in
cpufreq, depending on the cpufreq configuration. That is somewhat
inconsistent and is different from what it was before 4.13, so in
order to restore the previous behavior, make it report the current
CPU frequency like the scaling_cur_freq sysfs file in cpufreq.
To that end, modify the /proc/cpuinfo implementation on x86 to use
aperfmperf_snapshot_khz() to snapshot the APERF and MPERF feedback
registers, if available, and use their values to compute the CPU
frequency to be reported as "cpu MHz".
However, do that carefully enough to avoid accumulating delays that
lead to unacceptable access times for /proc/cpuinfo on systems with
many CPUs. Run aperfmperf_snapshot_khz() once on all CPUs
asynchronously at the /proc/cpuinfo open time, add a single delay
upfront (if necessary) at that point and simply compute the current
frequency while running show_cpuinfo() for each individual CPU.
Also, to avoid slowing down /proc/cpuinfo accesses too much, reduce
the default delay between consecutive APERF and MPERF reads to 10 ms,
which should be sufficient to get large enough numbers for the
frequency computation in all cases.
Fixes: 890da9cf0983 (Revert "x86: do not use cpufreq_quick_get() for /proc/cpuinfo "cpu MHz"")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
2017-11-15 09:13:40 +08:00
|
|
|
|
|
|
|
unsigned int aperfmperf_get_khz(int cpu);
|
|
|
|
|
2018-04-26 10:04:22 +08:00
|
|
|
extern void x86_spec_ctrl_setup_ap(void);
|
|
|
|
|
2011-11-30 03:14:43 +08:00
|
|
|
#endif /* ARCH_X86_CPU_H */
|