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 */
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifndef _PARISC_PAGE_H
|
|
|
|
#define _PARISC_PAGE_H
|
|
|
|
|
2007-10-18 14:04:34 +07:00
|
|
|
#include <linux/const.h>
|
|
|
|
|
2006-04-21 03:40:23 +07:00
|
|
|
#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
|
2006-09-19 10:12:27 +07:00
|
|
|
# define PAGE_SHIFT 12
|
2006-04-21 03:40:23 +07:00
|
|
|
#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)
|
2006-09-19 10:12:27 +07:00
|
|
|
# define PAGE_SHIFT 14
|
2006-04-21 03:40:23 +07:00
|
|
|
#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)
|
2006-09-19 10:12:27 +07:00
|
|
|
# define PAGE_SHIFT 16
|
2006-04-21 03:40:23 +07:00
|
|
|
#else
|
|
|
|
# error "unknown default kernel page size"
|
|
|
|
#endif
|
2007-10-18 14:04:34 +07:00
|
|
|
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
|
2006-04-21 03:40:23 +07:00
|
|
|
#define PAGE_MASK (~(PAGE_SIZE-1))
|
|
|
|
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
#include <asm/types.h>
|
|
|
|
#include <asm/cache.h>
|
|
|
|
|
2013-02-04 05:59:09 +07:00
|
|
|
#define clear_page(page) clear_page_asm((void *)(page))
|
|
|
|
#define copy_page(to, from) copy_page_asm((void *)(to), (void *)(from))
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
struct page;
|
|
|
|
|
2013-02-04 05:59:09 +07:00
|
|
|
void clear_page_asm(void *page);
|
|
|
|
void copy_page_asm(void *to, void *from);
|
2014-01-06 09:25:00 +07:00
|
|
|
#define clear_user_page(vto, vaddr, page) clear_page_asm(vto)
|
2014-02-01 03:33:17 +07:00
|
|
|
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
|
|
|
|
struct page *pg);
|
2013-02-04 05:59:09 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* These are used to make use of C type-checking..
|
|
|
|
*/
|
2006-03-24 05:48:15 +07:00
|
|
|
#define STRICT_MM_TYPECHECKS
|
|
|
|
#ifdef STRICT_MM_TYPECHECKS
|
parisc: fix usage of 32bit PTE page table entries on 32bit kernels
This patch fixes a long outstanding bug on 32bit parisc linux kernels
which prevented us from using 32bit PTE table entries (instead of 64bit
entries of which 32bit were unused).
The problem was caused by this assembler statement in the L2_ptep
macro in arch/parisc/kernel/entry.S:447:
EXTR \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
which expanded to
extrw,u r8,9,11,r1
and which has undefined behavior since the length value (11) extends
beyond the leftmost bit (11-1 > 9).
Interestingly PA2.0 processors seem to don't care and just zero-extend
the value, while PA1.1 processors don't.
Fix this problem by detecting an address space overflow with ASM_BITS_PER_PGD
and adjusting it accordingly. To prevent such problems in the future,
some compile time sanity checks in arch/parisc/mm/init.c were added.
Since the page table now only consumes half of it's old size, we can
use the freed memory to harmonize 32- and 64bit kernels and let both
map 16MB for the initial page table.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-01-19 01:16:16 +07:00
|
|
|
typedef struct { unsigned long pte; } pte_t; /* either 32 or 64bit */
|
2006-03-24 05:48:15 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/* NOTE: even on 64 bits, these entries are __u32 because we allocate
|
|
|
|
* the pmd and pgd in ZONE_DMA (i.e. under 4GB) */
|
|
|
|
typedef struct { __u32 pmd; } pmd_t;
|
|
|
|
typedef struct { __u32 pgd; } pgd_t;
|
|
|
|
typedef struct { unsigned long pgprot; } pgprot_t;
|
|
|
|
|
|
|
|
#define pte_val(x) ((x).pte)
|
|
|
|
/* These do not work lvalues, so make sure we don't use them as such. */
|
|
|
|
#define pmd_val(x) ((x).pmd + 0)
|
|
|
|
#define pgd_val(x) ((x).pgd + 0)
|
|
|
|
#define pgprot_val(x) ((x).pgprot)
|
|
|
|
|
|
|
|
#define __pte(x) ((pte_t) { (x) } )
|
|
|
|
#define __pmd(x) ((pmd_t) { (x) } )
|
|
|
|
#define __pgd(x) ((pgd_t) { (x) } )
|
|
|
|
#define __pgprot(x) ((pgprot_t) { (x) } )
|
|
|
|
|
2006-03-24 05:48:15 +07:00
|
|
|
#define __pmd_val_set(x,n) (x).pmd = (n)
|
|
|
|
#define __pgd_val_set(x,n) (x).pgd = (n)
|
|
|
|
|
|
|
|
#else
|
|
|
|
/*
|
|
|
|
* .. while these make it easier on the compiler
|
|
|
|
*/
|
|
|
|
typedef unsigned long pte_t;
|
|
|
|
typedef __u32 pmd_t;
|
|
|
|
typedef __u32 pgd_t;
|
|
|
|
typedef unsigned long pgprot_t;
|
|
|
|
|
|
|
|
#define pte_val(x) (x)
|
|
|
|
#define pmd_val(x) (x)
|
|
|
|
#define pgd_val(x) (x)
|
|
|
|
#define pgprot_val(x) (x)
|
|
|
|
|
|
|
|
#define __pte(x) (x)
|
|
|
|
#define __pmd(x) (x)
|
|
|
|
#define __pgd(x) (x)
|
|
|
|
#define __pgprot(x) (x)
|
|
|
|
|
|
|
|
#define __pmd_val_set(x,n) (x) = (n)
|
|
|
|
#define __pgd_val_set(x,n) (x) = (n)
|
|
|
|
|
|
|
|
#endif /* STRICT_MM_TYPECHECKS */
|
|
|
|
|
2008-02-08 19:22:04 +07:00
|
|
|
typedef struct page *pgtable_t;
|
2006-03-24 05:48:15 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
typedef struct __physmem_range {
|
|
|
|
unsigned long start_pfn;
|
|
|
|
unsigned long pages; /* PAGE_SIZE pages */
|
|
|
|
} physmem_range_t;
|
|
|
|
|
|
|
|
extern physmem_range_t pmem_ranges[];
|
|
|
|
extern int npmem_ranges;
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
|
|
|
|
/* WARNING: The definitions below must match exactly to sizeof(pte_t)
|
|
|
|
* etc
|
|
|
|
*/
|
2007-01-28 21:09:20 +07:00
|
|
|
#ifdef CONFIG_64BIT
|
2005-04-17 05:20:36 +07:00
|
|
|
#define BITS_PER_PTE_ENTRY 3
|
|
|
|
#define BITS_PER_PMD_ENTRY 2
|
|
|
|
#define BITS_PER_PGD_ENTRY 2
|
|
|
|
#else
|
parisc: fix usage of 32bit PTE page table entries on 32bit kernels
This patch fixes a long outstanding bug on 32bit parisc linux kernels
which prevented us from using 32bit PTE table entries (instead of 64bit
entries of which 32bit were unused).
The problem was caused by this assembler statement in the L2_ptep
macro in arch/parisc/kernel/entry.S:447:
EXTR \va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
which expanded to
extrw,u r8,9,11,r1
and which has undefined behavior since the length value (11) extends
beyond the leftmost bit (11-1 > 9).
Interestingly PA2.0 processors seem to don't care and just zero-extend
the value, while PA1.1 processors don't.
Fix this problem by detecting an address space overflow with ASM_BITS_PER_PGD
and adjusting it accordingly. To prevent such problems in the future,
some compile time sanity checks in arch/parisc/mm/init.c were added.
Since the page table now only consumes half of it's old size, we can
use the freed memory to harmonize 32- and 64bit kernels and let both
map 16MB for the initial page table.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
2009-01-19 01:16:16 +07:00
|
|
|
#define BITS_PER_PTE_ENTRY 2
|
2005-04-17 05:20:36 +07:00
|
|
|
#define BITS_PER_PMD_ENTRY 2
|
|
|
|
#define BITS_PER_PGD_ENTRY BITS_PER_PMD_ENTRY
|
|
|
|
#endif
|
|
|
|
#define PGD_ENTRY_SIZE (1UL << BITS_PER_PGD_ENTRY)
|
|
|
|
#define PMD_ENTRY_SIZE (1UL << BITS_PER_PMD_ENTRY)
|
|
|
|
#define PTE_ENTRY_SIZE (1UL << BITS_PER_PTE_ENTRY)
|
|
|
|
|
|
|
|
#define LINUX_GATEWAY_SPACE 0
|
|
|
|
|
|
|
|
/* This governs the relationship between virtual and physical addresses.
|
|
|
|
* If you alter it, make sure to take care of our various fixed mapping
|
|
|
|
* segments in fixmap.h */
|
2006-10-16 11:29:47 +07:00
|
|
|
#ifdef CONFIG_64BIT
|
2018-10-16 03:14:01 +07:00
|
|
|
#define __PAGE_OFFSET_DEFAULT (0x40000000) /* 1GB */
|
2006-10-16 11:29:47 +07:00
|
|
|
#else
|
2018-10-16 03:14:01 +07:00
|
|
|
#define __PAGE_OFFSET_DEFAULT (0x10000000) /* 256MB */
|
2006-10-16 11:29:47 +07:00
|
|
|
#endif
|
2018-10-16 03:14:01 +07:00
|
|
|
|
|
|
|
#if defined(BOOTLOADER)
|
|
|
|
#define __PAGE_OFFSET (0) /* bootloader uses physical addresses */
|
|
|
|
#else
|
|
|
|
#define __PAGE_OFFSET __PAGE_OFFSET_DEFAULT
|
2017-08-20 15:52:22 +07:00
|
|
|
#endif /* BOOTLOADER */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
|
|
|
|
|
|
|
|
/* The size of the gateway page (we leave lots of room for expansion) */
|
|
|
|
#define GATEWAY_PAGE_SIZE 0x4000
|
|
|
|
|
|
|
|
/* The start of the actual kernel binary---used in vmlinux.lds.S
|
|
|
|
* Leave some space after __PAGE_OFFSET for detecting kernel null
|
|
|
|
* ptr derefs */
|
|
|
|
#define KERNEL_BINARY_TEXT_START (__PAGE_OFFSET + 0x100000)
|
|
|
|
|
|
|
|
/* These macros don't work for 64-bit C code -- don't allow in C at all */
|
|
|
|
#ifdef __ASSEMBLY__
|
|
|
|
# define PA(x) ((x)-__PAGE_OFFSET)
|
|
|
|
# define VA(x) ((x)+__PAGE_OFFSET)
|
|
|
|
#endif
|
|
|
|
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
|
|
|
|
#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
|
|
|
|
|
|
|
|
#ifndef CONFIG_DISCONTIGMEM
|
|
|
|
#define pfn_valid(pfn) ((pfn) < max_mapnr)
|
|
|
|
#endif /* CONFIG_DISCONTIGMEM */
|
|
|
|
|
2006-01-11 08:47:55 +07:00
|
|
|
#ifdef CONFIG_HUGETLB_PAGE
|
2015-11-20 21:46:52 +07:00
|
|
|
#define HPAGE_SHIFT PMD_SHIFT /* fixed for transparent huge pages */
|
2006-01-11 08:47:55 +07:00
|
|
|
#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
|
|
|
|
#define HPAGE_MASK (~(HPAGE_SIZE - 1))
|
|
|
|
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
|
2015-11-20 21:46:52 +07:00
|
|
|
|
|
|
|
#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
|
|
|
|
# define REAL_HPAGE_SHIFT 20 /* 20 = 1MB */
|
|
|
|
# define _HUGE_PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_1M
|
|
|
|
#elif !defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
|
|
|
|
# define REAL_HPAGE_SHIFT 22 /* 22 = 4MB */
|
|
|
|
# define _HUGE_PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4M
|
|
|
|
#else
|
|
|
|
# define REAL_HPAGE_SHIFT 24 /* 24 = 16MB */
|
|
|
|
# define _HUGE_PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16M
|
2006-01-11 08:47:55 +07:00
|
|
|
#endif
|
2015-11-20 21:46:52 +07:00
|
|
|
#endif /* CONFIG_HUGETLB_PAGE */
|
2006-01-11 08:47:55 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
|
|
|
|
|
|
|
|
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
|
|
|
|
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
|
|
|
|
|
|
|
|
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
|
|
|
|
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
|
|
|
|
|
2006-03-27 16:15:43 +07:00
|
|
|
#include <asm-generic/memory_model.h>
|
2009-05-14 05:56:30 +07:00
|
|
|
#include <asm-generic/getorder.h>
|
parisc: move definition of PAGE0 to asm/page.h
This was defined in asm/pdc.h which needs to include asm/page.h for
__PAGE_OFFSET. This leads to an include loop so that page.h eventually will
include pdc.h again. While this is no problem because of header guards, it is
a problem because some symbols may be undefined. Such an error is this:
In file included from include/linux/bitops.h:35:0,
from include/asm-generic/getorder.h:7,
from arch/parisc/include/asm/page.h:162,
from arch/parisc/include/asm/pdc.h:346,
from arch/parisc/include/asm/processor.h:16,
from arch/parisc/include/asm/spinlock.h:6,
from arch/parisc/include/asm/atomic.h:20,
from include/linux/atomic.h:4,
from include/linux/sysfs.h:20,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/eisa.h:5,
from arch/parisc/kernel/pci.c:11:
arch/parisc/include/asm/bitops.h: In function ‘set_bit’:
arch/parisc/include/asm/bitops.h:82:2: error: implicit declaration of function ‘_atomic_spin_lock_irqsave’ [-Werror=implicit-function-declaration]
arch/parisc/include/asm/bitops.h:84:2: error: implicit declaration of function ‘_atomic_spin_unlock_irqrestore’ [-Werror=implicit-function-declaration]
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-11 04:08:17 +07:00
|
|
|
#include <asm/pdc.h>
|
|
|
|
|
|
|
|
#define PAGE0 ((struct zeropage *)__PAGE_OFFSET)
|
|
|
|
|
|
|
|
/* DEFINITION OF THE ZERO-PAGE (PAG0) */
|
|
|
|
/* based on work by Jason Eckhardt (jason@equator.com) */
|
2005-09-04 05:54:30 +07:00
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#endif /* _PARISC_PAGE_H */
|