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 */
|
2017-10-02 09:28:36 +00:00
|
|
|
#ifndef __X86_MCE_INTERNAL_H__
|
|
|
|
#define __X86_MCE_INTERNAL_H__
|
|
|
|
|
2018-12-05 20:05:13 +00:00
|
|
|
#undef pr_fmt
|
|
|
|
#define pr_fmt(fmt) "mce: " fmt
|
|
|
|
|
2011-12-21 22:29:42 +00:00
|
|
|
#include <linux/device.h>
|
2009-05-27 19:56:54 +00:00
|
|
|
#include <asm/mce.h>
|
|
|
|
|
|
|
|
enum severity_level {
|
|
|
|
MCE_NO_SEVERITY,
|
2014-11-18 02:09:19 +00:00
|
|
|
MCE_DEFERRED_SEVERITY,
|
|
|
|
MCE_UCNA_SEVERITY = MCE_DEFERRED_SEVERITY,
|
2009-05-27 19:56:57 +00:00
|
|
|
MCE_KEEP_SEVERITY,
|
2009-05-27 19:56:54 +00:00
|
|
|
MCE_SOME_SEVERITY,
|
2009-05-27 19:56:57 +00:00
|
|
|
MCE_AO_SEVERITY,
|
2009-05-27 19:56:54 +00:00
|
|
|
MCE_UC_SEVERITY,
|
2009-05-27 19:56:57 +00:00
|
|
|
MCE_AR_SEVERITY,
|
2009-05-27 19:56:54 +00:00
|
|
|
MCE_PANIC_SEVERITY,
|
|
|
|
};
|
|
|
|
|
2017-04-18 18:42:35 +00:00
|
|
|
extern struct blocking_notifier_head x86_mce_decoder_chain;
|
2015-08-12 16:29:34 +00:00
|
|
|
|
2009-07-08 22:31:43 +00:00
|
|
|
#define ATTR_LEN 16
|
x86/MCE/intel: Cleanup CMCI storm logic
Initially, this started with the yet another report about a race
condition in the CMCI storm adaptive period length thing. Yes, we have
to admit, it is fragile and error prone. So let's simplify it.
The simpler logic is: now, after we enter storm mode, we go straight to
polling with CMCI_STORM_INTERVAL, i.e. once a second. We remain in storm
mode as long as we see errors being logged while polling.
Theoretically, if we see an uninterrupted error stream, we will remain
in storm mode indefinitely and keep polling the MSRs.
However, when the storm is actually a burst of errors, once we have
logged them all, we back out of it after ~5 mins of polling and no more
errors logged.
If we encounter an error during those 5 minutes, we reset the polling
interval to 5 mins.
Making machine_check_poll() return a bool and denoting whether it has
seen an error or not lets us simplify a bunch of code and move the storm
handling private to mce_intel.c.
Some minor cleanups while at it.
Reported-by: Calvin Owens <calvinowens@fb.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/1417746575-23299-1-git-send-email-calvinowens@fb.com
Signed-off-by: Borislav Petkov <bp@suse.de>
2015-01-13 14:08:51 +00:00
|
|
|
#define INITIAL_CHECK_INTERVAL 5 * 60 /* 5 minutes */
|
2009-07-08 22:31:43 +00:00
|
|
|
|
|
|
|
/* One object for each MCE bank, shared by all CPUs */
|
|
|
|
struct mce_bank {
|
|
|
|
u64 ctl; /* subevents to enable */
|
|
|
|
unsigned char init; /* initialise bank? */
|
2011-12-21 22:29:42 +00:00
|
|
|
struct device_attribute attr; /* device attribute */
|
2009-07-08 22:31:43 +00:00
|
|
|
char attrname[ATTR_LEN]; /* attribute name */
|
|
|
|
};
|
|
|
|
|
2015-08-12 16:29:34 +00:00
|
|
|
struct mce_evt_llist {
|
|
|
|
struct llist_node llnode;
|
|
|
|
struct mce mce;
|
|
|
|
};
|
|
|
|
|
2017-01-23 18:35:13 +00:00
|
|
|
void mce_gen_pool_process(struct work_struct *__unused);
|
2015-08-12 16:29:34 +00:00
|
|
|
bool mce_gen_pool_empty(void);
|
|
|
|
int mce_gen_pool_add(struct mce *mce);
|
|
|
|
int mce_gen_pool_init(void);
|
2016-04-30 12:33:56 +00:00
|
|
|
struct llist_node *mce_gen_pool_prepare_records(void);
|
2015-08-12 16:29:34 +00:00
|
|
|
|
2015-03-23 15:42:53 +00:00
|
|
|
extern int (*mce_severity)(struct mce *a, int tolerant, char **msg, bool is_excp);
|
2009-07-31 01:41:42 +00:00
|
|
|
struct dentry *mce_get_debugfs_dir(void);
|
2009-05-27 19:56:57 +00:00
|
|
|
|
2009-07-08 22:31:43 +00:00
|
|
|
extern struct mce_bank *mce_banks;
|
2013-07-01 15:38:47 +00:00
|
|
|
extern mce_banks_t mce_banks_ce_disabled;
|
2009-07-08 22:31:43 +00:00
|
|
|
|
2012-08-09 18:44:51 +00:00
|
|
|
#ifdef CONFIG_X86_MCE_INTEL
|
x86/MCE/intel: Cleanup CMCI storm logic
Initially, this started with the yet another report about a race
condition in the CMCI storm adaptive period length thing. Yes, we have
to admit, it is fragile and error prone. So let's simplify it.
The simpler logic is: now, after we enter storm mode, we go straight to
polling with CMCI_STORM_INTERVAL, i.e. once a second. We remain in storm
mode as long as we see errors being logged while polling.
Theoretically, if we see an uninterrupted error stream, we will remain
in storm mode indefinitely and keep polling the MSRs.
However, when the storm is actually a burst of errors, once we have
logged them all, we back out of it after ~5 mins of polling and no more
errors logged.
If we encounter an error during those 5 minutes, we reset the polling
interval to 5 mins.
Making machine_check_poll() return a bool and denoting whether it has
seen an error or not lets us simplify a bunch of code and move the storm
handling private to mce_intel.c.
Some minor cleanups while at it.
Reported-by: Calvin Owens <calvinowens@fb.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/1417746575-23299-1-git-send-email-calvinowens@fb.com
Signed-off-by: Borislav Petkov <bp@suse.de>
2015-01-13 14:08:51 +00:00
|
|
|
unsigned long cmci_intel_adjust_timer(unsigned long interval);
|
|
|
|
bool mce_intel_cmci_poll(void);
|
2012-08-09 18:44:51 +00:00
|
|
|
void mce_intel_hcpu_update(unsigned long cpu);
|
2013-07-01 15:38:47 +00:00
|
|
|
void cmci_disable_bank(int bank);
|
2012-08-09 18:44:51 +00:00
|
|
|
#else
|
x86/MCE/intel: Cleanup CMCI storm logic
Initially, this started with the yet another report about a race
condition in the CMCI storm adaptive period length thing. Yes, we have
to admit, it is fragile and error prone. So let's simplify it.
The simpler logic is: now, after we enter storm mode, we go straight to
polling with CMCI_STORM_INTERVAL, i.e. once a second. We remain in storm
mode as long as we see errors being logged while polling.
Theoretically, if we see an uninterrupted error stream, we will remain
in storm mode indefinitely and keep polling the MSRs.
However, when the storm is actually a burst of errors, once we have
logged them all, we back out of it after ~5 mins of polling and no more
errors logged.
If we encounter an error during those 5 minutes, we reset the polling
interval to 5 mins.
Making machine_check_poll() return a bool and denoting whether it has
seen an error or not lets us simplify a bunch of code and move the storm
handling private to mce_intel.c.
Some minor cleanups while at it.
Reported-by: Calvin Owens <calvinowens@fb.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/1417746575-23299-1-git-send-email-calvinowens@fb.com
Signed-off-by: Borislav Petkov <bp@suse.de>
2015-01-13 14:08:51 +00:00
|
|
|
# define cmci_intel_adjust_timer mce_adjust_timer_default
|
|
|
|
static inline bool mce_intel_cmci_poll(void) { return false; }
|
2012-08-09 18:44:51 +00:00
|
|
|
static inline void mce_intel_hcpu_update(unsigned long cpu) { }
|
2013-07-01 15:38:47 +00:00
|
|
|
static inline void cmci_disable_bank(int bank) { }
|
2012-08-09 18:44:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void mce_timer_kick(unsigned long interval);
|
|
|
|
|
ACPI, APEI, Use ERST for persistent storage of MCE
Traditionally, fatal MCE will cause Linux print error log to console
then reboot. Because MCE registers will preserve their content after
warm reboot, the hardware error can be logged to disk or network after
reboot. But system may fail to warm reboot, then you may lose the
hardware error log. ERST can help here. Through saving the hardware
error log into flash via ERST before go panic, the hardware error log
can be gotten from the flash after system boot successful again.
The fatal MCE processing procedure with ERST involved is as follow:
- Hardware detect error, MCE raised
- MCE read MCE registers, check error severity (fatal), prepare error record
- Write MCE error record into flash via ERST
- Go panic, then trigger system reboot
- System reboot, /sbin/mcelog run, it reads /dev/mcelog to check flash
for error record of previous boot via ERST, and output and clear
them if available
- /sbin/mcelog logs error records into disk or network
ERST only accepts CPER record format, but there is no pre-defined CPER
section can accommodate all information in struct mce, so a customized
section type is defined to hold struct mce inside a CPER record as an
error section.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-05-18 06:35:22 +00:00
|
|
|
#ifdef CONFIG_ACPI_APEI
|
|
|
|
int apei_write_mce(struct mce *m);
|
|
|
|
ssize_t apei_read_mce(struct mce *m, u64 *record_id);
|
|
|
|
int apei_check_mce(void);
|
|
|
|
int apei_clear_mce(u64 record_id);
|
|
|
|
#else
|
|
|
|
static inline int apei_write_mce(struct mce *m)
|
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
static inline ssize_t apei_read_mce(struct mce *m, u64 *record_id)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline int apei_check_mce(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline int apei_clear_mce(u64 record_id)
|
|
|
|
{
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
#endif
|
2015-08-12 16:29:44 +00:00
|
|
|
|
|
|
|
void mce_inject_log(struct mce *m);
|
2016-04-30 12:33:56 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We consider records to be equivalent if bank+status+addr+misc all match.
|
|
|
|
* This is only used when the system is going down because of a fatal error
|
|
|
|
* to avoid cluttering the console log with essentially repeated information.
|
|
|
|
* In normal processing all errors seen are logged.
|
|
|
|
*/
|
|
|
|
static inline bool mce_cmp(struct mce *m1, struct mce *m2)
|
|
|
|
{
|
|
|
|
return m1->bank != m2->bank ||
|
|
|
|
m1->status != m2->status ||
|
|
|
|
m1->addr != m2->addr ||
|
|
|
|
m1->misc != m2->misc;
|
|
|
|
}
|
2017-03-27 09:33:03 +00:00
|
|
|
|
|
|
|
extern struct device_attribute dev_attr_trigger;
|
|
|
|
|
|
|
|
#ifdef CONFIG_X86_MCELOG_LEGACY
|
2017-06-13 16:28:31 +00:00
|
|
|
void mce_work_trigger(void);
|
|
|
|
void mce_register_injector_chain(struct notifier_block *nb);
|
|
|
|
void mce_unregister_injector_chain(struct notifier_block *nb);
|
2017-03-27 09:33:03 +00:00
|
|
|
#else
|
|
|
|
static inline void mce_work_trigger(void) { }
|
2017-06-13 16:28:31 +00:00
|
|
|
static inline void mce_register_injector_chain(struct notifier_block *nb) { }
|
|
|
|
static inline void mce_unregister_injector_chain(struct notifier_block *nb) { }
|
2017-03-27 09:33:03 +00:00
|
|
|
#endif
|
2017-10-02 09:28:36 +00:00
|
|
|
|
2018-02-21 10:18:53 +00:00
|
|
|
struct mca_config {
|
|
|
|
bool dont_log_ce;
|
|
|
|
bool cmci_disabled;
|
|
|
|
bool ignore_ce;
|
2018-02-21 10:18:54 +00:00
|
|
|
|
|
|
|
__u64 lmce_disabled : 1,
|
|
|
|
disabled : 1,
|
|
|
|
ser : 1,
|
|
|
|
recovery : 1,
|
|
|
|
bios_cmci_threshold : 1,
|
|
|
|
__reserved : 59;
|
|
|
|
|
2018-02-21 10:18:53 +00:00
|
|
|
u8 banks;
|
|
|
|
s8 bootlog;
|
|
|
|
int tolerant;
|
|
|
|
int monarch_timeout;
|
|
|
|
int panic_timeout;
|
|
|
|
u32 rip_msr;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct mca_config mca_cfg;
|
|
|
|
|
|
|
|
struct mce_vendor_flags {
|
|
|
|
/*
|
|
|
|
* Indicates that overflow conditions are not fatal, when set.
|
|
|
|
*/
|
|
|
|
__u64 overflow_recov : 1,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* (AMD) SUCCOR stands for S/W UnCorrectable error COntainment and
|
|
|
|
* Recovery. It indicates support for data poisoning in HW and deferred
|
|
|
|
* error interrupts.
|
|
|
|
*/
|
|
|
|
succor : 1,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* (AMD) SMCA: This bit indicates support for Scalable MCA which expands
|
|
|
|
* the register space for each MCA bank and also increases number of
|
|
|
|
* banks. Also, to accommodate the new banks and registers, the MCA
|
|
|
|
* register space is moved to a new MSR range.
|
|
|
|
*/
|
|
|
|
smca : 1,
|
|
|
|
|
|
|
|
__reserved_0 : 61;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct mce_vendor_flags mce_flags;
|
|
|
|
|
|
|
|
struct mca_msr_regs {
|
|
|
|
u32 (*ctl) (int bank);
|
|
|
|
u32 (*status) (int bank);
|
|
|
|
u32 (*addr) (int bank);
|
|
|
|
u32 (*misc) (int bank);
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct mca_msr_regs msr_ops;
|
|
|
|
|
2017-10-02 09:28:36 +00:00
|
|
|
#endif /* __X86_MCE_INTERNAL_H__ */
|