mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
b24413180f
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>
463 lines
11 KiB
C
463 lines
11 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_KVM_H
|
|
|
|
#include <linux/tracepoint.h>
|
|
#include <asm/sie.h>
|
|
#include <asm/debug.h>
|
|
#include <asm/dis.h>
|
|
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM kvm
|
|
#define TRACE_INCLUDE_PATH .
|
|
#undef TRACE_INCLUDE_FILE
|
|
#define TRACE_INCLUDE_FILE trace
|
|
|
|
/*
|
|
* Helpers for vcpu-specific tracepoints containing the same information
|
|
* as s390dbf VCPU_EVENTs.
|
|
*/
|
|
#define VCPU_PROTO_COMMON struct kvm_vcpu *vcpu
|
|
#define VCPU_ARGS_COMMON vcpu
|
|
#define VCPU_FIELD_COMMON __field(int, id) \
|
|
__field(unsigned long, pswmask) \
|
|
__field(unsigned long, pswaddr)
|
|
#define VCPU_ASSIGN_COMMON do { \
|
|
__entry->id = vcpu->vcpu_id; \
|
|
__entry->pswmask = vcpu->arch.sie_block->gpsw.mask; \
|
|
__entry->pswaddr = vcpu->arch.sie_block->gpsw.addr; \
|
|
} while (0);
|
|
#define VCPU_TP_PRINTK(p_str, p_args...) \
|
|
TP_printk("%02d[%016lx-%016lx]: " p_str, __entry->id, \
|
|
__entry->pswmask, __entry->pswaddr, p_args)
|
|
|
|
TRACE_EVENT(kvm_s390_skey_related_inst,
|
|
TP_PROTO(VCPU_PROTO_COMMON),
|
|
TP_ARGS(VCPU_ARGS_COMMON),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
),
|
|
VCPU_TP_PRINTK("%s", "storage key related instruction")
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_major_guest_pfault,
|
|
TP_PROTO(VCPU_PROTO_COMMON),
|
|
TP_ARGS(VCPU_ARGS_COMMON),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
),
|
|
VCPU_TP_PRINTK("%s", "major fault, maybe applicable for pfault")
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_pfault_init,
|
|
TP_PROTO(VCPU_PROTO_COMMON, long pfault_token),
|
|
TP_ARGS(VCPU_ARGS_COMMON, pfault_token),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(long, pfault_token)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->pfault_token = pfault_token;
|
|
),
|
|
VCPU_TP_PRINTK("init pfault token %ld", __entry->pfault_token)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_pfault_done,
|
|
TP_PROTO(VCPU_PROTO_COMMON, long pfault_token),
|
|
TP_ARGS(VCPU_ARGS_COMMON, pfault_token),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(long, pfault_token)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->pfault_token = pfault_token;
|
|
),
|
|
VCPU_TP_PRINTK("done pfault token %ld", __entry->pfault_token)
|
|
);
|
|
|
|
/*
|
|
* Tracepoints for SIE entry and exit.
|
|
*/
|
|
TRACE_EVENT(kvm_s390_sie_enter,
|
|
TP_PROTO(VCPU_PROTO_COMMON, int cpuflags),
|
|
TP_ARGS(VCPU_ARGS_COMMON, cpuflags),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(int, cpuflags)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->cpuflags = cpuflags;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("entering sie flags %x", __entry->cpuflags)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_sie_fault,
|
|
TP_PROTO(VCPU_PROTO_COMMON),
|
|
TP_ARGS(VCPU_ARGS_COMMON),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
),
|
|
|
|
VCPU_TP_PRINTK("%s", "fault in sie instruction")
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_sie_exit,
|
|
TP_PROTO(VCPU_PROTO_COMMON, u8 icptcode),
|
|
TP_ARGS(VCPU_ARGS_COMMON, icptcode),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(u8, icptcode)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->icptcode = icptcode;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("exit sie icptcode %d (%s)", __entry->icptcode,
|
|
__print_symbolic(__entry->icptcode,
|
|
sie_intercept_code))
|
|
);
|
|
|
|
/*
|
|
* Trace point for intercepted instructions.
|
|
*/
|
|
TRACE_EVENT(kvm_s390_intercept_instruction,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u16 ipa, __u32 ipb),
|
|
TP_ARGS(VCPU_ARGS_COMMON, ipa, ipb),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u64, instruction)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->instruction = ((__u64)ipa << 48) |
|
|
((__u64)ipb << 16);
|
|
),
|
|
|
|
VCPU_TP_PRINTK("intercepted instruction %016llx (%s)",
|
|
__entry->instruction,
|
|
__print_symbolic(icpt_insn_decoder(__entry->instruction),
|
|
icpt_insn_codes))
|
|
);
|
|
|
|
/*
|
|
* Trace point for intercepted program interruptions.
|
|
*/
|
|
TRACE_EVENT(kvm_s390_intercept_prog,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u16 code),
|
|
TP_ARGS(VCPU_ARGS_COMMON, code),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u16, code)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->code = code;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("intercepted program interruption %04x (%s)",
|
|
__entry->code,
|
|
__print_symbolic(__entry->code,
|
|
icpt_prog_codes))
|
|
);
|
|
|
|
/*
|
|
* Trace point for validity intercepts.
|
|
*/
|
|
TRACE_EVENT(kvm_s390_intercept_validity,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u16 viwhy),
|
|
TP_ARGS(VCPU_ARGS_COMMON, viwhy),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u16, viwhy)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->viwhy = viwhy;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("got validity intercept %04x", __entry->viwhy)
|
|
);
|
|
|
|
/*
|
|
* Trace points for instructions that are of special interest.
|
|
*/
|
|
|
|
TRACE_EVENT(kvm_s390_handle_sigp,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u8 order_code, __u16 cpu_addr, \
|
|
__u32 parameter),
|
|
TP_ARGS(VCPU_ARGS_COMMON, order_code, cpu_addr, parameter),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u8, order_code)
|
|
__field(__u16, cpu_addr)
|
|
__field(__u32, parameter)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->order_code = order_code;
|
|
__entry->cpu_addr = cpu_addr;
|
|
__entry->parameter = parameter;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("handle sigp order %02x (%s), cpu address %04x, " \
|
|
"parameter %08x", __entry->order_code,
|
|
__print_symbolic(__entry->order_code,
|
|
sigp_order_codes),
|
|
__entry->cpu_addr, __entry->parameter)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_sigp_pei,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u8 order_code, __u16 cpu_addr),
|
|
TP_ARGS(VCPU_ARGS_COMMON, order_code, cpu_addr),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u8, order_code)
|
|
__field(__u16, cpu_addr)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->order_code = order_code;
|
|
__entry->cpu_addr = cpu_addr;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("handle sigp pei order %02x (%s), cpu address %04x",
|
|
__entry->order_code,
|
|
__print_symbolic(__entry->order_code,
|
|
sigp_order_codes),
|
|
__entry->cpu_addr)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_diag,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u16 code),
|
|
TP_ARGS(VCPU_ARGS_COMMON, code),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u16, code)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->code = code;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("handle diagnose call %04x (%s)", __entry->code,
|
|
__print_symbolic(__entry->code, diagnose_codes))
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_lctl,
|
|
TP_PROTO(VCPU_PROTO_COMMON, int g, int reg1, int reg3, u64 addr),
|
|
TP_ARGS(VCPU_ARGS_COMMON, g, reg1, reg3, addr),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(int, g)
|
|
__field(int, reg1)
|
|
__field(int, reg3)
|
|
__field(u64, addr)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->g = g;
|
|
__entry->reg1 = reg1;
|
|
__entry->reg3 = reg3;
|
|
__entry->addr = addr;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("%s: loading cr %x-%x from %016llx",
|
|
__entry->g ? "lctlg" : "lctl",
|
|
__entry->reg1, __entry->reg3, __entry->addr)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_stctl,
|
|
TP_PROTO(VCPU_PROTO_COMMON, int g, int reg1, int reg3, u64 addr),
|
|
TP_ARGS(VCPU_ARGS_COMMON, g, reg1, reg3, addr),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(int, g)
|
|
__field(int, reg1)
|
|
__field(int, reg3)
|
|
__field(u64, addr)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->g = g;
|
|
__entry->reg1 = reg1;
|
|
__entry->reg3 = reg3;
|
|
__entry->addr = addr;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("%s: storing cr %x-%x to %016llx",
|
|
__entry->g ? "stctg" : "stctl",
|
|
__entry->reg1, __entry->reg3, __entry->addr)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_prefix,
|
|
TP_PROTO(VCPU_PROTO_COMMON, int set, u32 address),
|
|
TP_ARGS(VCPU_ARGS_COMMON, set, address),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(int, set)
|
|
__field(u32, address)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->set = set;
|
|
__entry->address = address;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("%s prefix to %08x",
|
|
__entry->set ? "setting" : "storing",
|
|
__entry->address)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_stap,
|
|
TP_PROTO(VCPU_PROTO_COMMON, u64 address),
|
|
TP_ARGS(VCPU_ARGS_COMMON, address),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(u64, address)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->address = address;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("storing cpu address to %016llx",
|
|
__entry->address)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_stfl,
|
|
TP_PROTO(VCPU_PROTO_COMMON, unsigned int facility_list),
|
|
TP_ARGS(VCPU_ARGS_COMMON, facility_list),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(unsigned int, facility_list)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->facility_list = facility_list;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("store facility list value %08x",
|
|
__entry->facility_list)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_stsi,
|
|
TP_PROTO(VCPU_PROTO_COMMON, int fc, int sel1, int sel2, u64 addr),
|
|
TP_ARGS(VCPU_ARGS_COMMON, fc, sel1, sel2, addr),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(int, fc)
|
|
__field(int, sel1)
|
|
__field(int, sel2)
|
|
__field(u64, addr)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->fc = fc;
|
|
__entry->sel1 = sel1;
|
|
__entry->sel2 = sel2;
|
|
__entry->addr = addr;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("STSI %d.%d.%d information stored to %016llx",
|
|
__entry->fc, __entry->sel1, __entry->sel2,
|
|
__entry->addr)
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_operexc,
|
|
TP_PROTO(VCPU_PROTO_COMMON, __u16 ipa, __u32 ipb),
|
|
TP_ARGS(VCPU_ARGS_COMMON, ipa, ipb),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(__u64, instruction)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->instruction = ((__u64)ipa << 48) |
|
|
((__u64)ipb << 16);
|
|
),
|
|
|
|
VCPU_TP_PRINTK("operation exception on instruction %016llx (%s)",
|
|
__entry->instruction,
|
|
__print_symbolic(icpt_insn_decoder(__entry->instruction),
|
|
icpt_insn_codes))
|
|
);
|
|
|
|
TRACE_EVENT(kvm_s390_handle_sthyi,
|
|
TP_PROTO(VCPU_PROTO_COMMON, u64 code, u64 addr),
|
|
TP_ARGS(VCPU_ARGS_COMMON, code, addr),
|
|
|
|
TP_STRUCT__entry(
|
|
VCPU_FIELD_COMMON
|
|
__field(u64, code)
|
|
__field(u64, addr)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
VCPU_ASSIGN_COMMON
|
|
__entry->code = code;
|
|
__entry->addr = addr;
|
|
),
|
|
|
|
VCPU_TP_PRINTK("STHYI fc: %llu addr: %016llx",
|
|
__entry->code, __entry->addr)
|
|
);
|
|
|
|
#endif /* _TRACE_KVM_H */
|
|
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|