02 Nov, 2017

3 commits

  • Many user space API headers have licensing information, which is either
    incomplete, badly formatted or just a shorthand for referring to the
    license under which the file is supposed to be. This makes it hard for
    compliance tools to determine the correct license.

    Update these files with an SPDX license identifier. The identifier was
    chosen based on the license information in the file.

    GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
    identifier with the added 'WITH Linux-syscall-note' exception, which is
    the officially assigned exception identifier for the kernel syscall
    exception:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    This exception makes it possible to include GPL headers into non GPL
    code, without confusing license compliance tools.

    Headers which have either explicit dual licensing or are just licensed
    under a non GPL license are updated with the corresponding SPDX
    identifier and the GPLv2 with syscall exception identifier. The format
    is:
    ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)

    SPDX license identifiers are a legally binding shorthand, which can be
    used instead of the full boiler plate text. The update does not remove
    existing license information as this has to be done on a case by case
    basis and the copyright holders might have to be consulted. This will
    happen in a separate step.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many user space API headers are missing licensing information, which
    makes it hard for compliance tools to determine the correct license.

    By default are files without license information under the default
    license of the kernel, which is GPLV2. Marking them GPLV2 would exclude
    them from being included in non GPLV2 code, which is obviously not
    intended. The user space API headers fall under the syscall exception
    which is in the kernels COPYING file:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    otherwise syscall usage would not be possible.

    Update the files which contain no license information with an SPDX
    license identifier. The chosen identifier is 'GPL-2.0 WITH
    Linux-syscall-note' which is the officially assigned identifier for the
    Linux syscall exception. SPDX license identifiers are 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. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • 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
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

19 Sep, 2016

1 commit

  • Some macros required by tools/perf/trace/beauty/mmap.c is not support
    for all architectures. For example, MAP_32BIT is defined on x86 only,
    alpha doesn't define MADV_HWPOISON and MADV_SOFT_OFFLINE.

    This patch regenerates mman.h for each arch, defines these missing
    macros for perf. For missing MADV_*, fall back to asm-generic/mman-common
    because they are in a 'case ...' statement. For flags, define it to 0.

    Following is the script to generate this patch:

    macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
    rm `find ./tools/arch/ -name mman.h`
    for arch in `ls tools/arch`
    do
    [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
    src=arch/$arch/include/uapi/asm/mman.h
    target=tools/arch/$arch/include/uapi/asm/mman.h.tmp
    real_target=tools/arch/$arch/include/uapi/asm/mman.h
    guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
    rm -f $target

    [ -f $src ] &&
    for m in $macros
    do
    if grep '#define[ \t]*'$m $src > /dev/null 2>&1
    then
    grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
    fi
    done

    if [ -f $src ]
    then
    grep '#include > $real_target
    rm $target
    echo "$real_target"
    done

    exit 0
    # Following macros are extracted from:
    # tools/perf/trace/beauty/mmap.c
    #
    # start macro list
    MADV_DODUMP
    MADV_DOFORK
    MADV_DONTDUMP
    MADV_DONTFORK
    MADV_DONTNEED
    MADV_FREE
    MADV_HUGEPAGE
    MADV_HWPOISON
    MADV_MERGEABLE
    MADV_NOHUGEPAGE
    MADV_NORMAL
    MADV_RANDOM
    MADV_REMOVE
    MADV_SEQUENTIAL
    MADV_SOFT_OFFLINE
    MADV_UNMERGEABLE
    MADV_WILLNEED
    MAP_32BIT
    MAP_ANONYMOUS
    MAP_DENYWRITE
    MAP_EXECUTABLE
    MAP_FILE
    MAP_FIXED
    MAP_GROWSDOWN
    MAP_HUGETLB
    MAP_LOCKED
    MAP_NONBLOCK
    MAP_NORESERVE
    MAP_POPULATE
    MAP_PRIVATE
    MAP_SHARED
    MAP_STACK
    MAP_UNINITIALIZED
    MREMAP_FIXED
    MREMAP_MAYMOVE
    PROT_EXEC
    PROT_GROWSDOWN
    PROT_GROWSUP
    PROT_NONE
    PROT_READ
    PROT_SEM
    PROT_WRITE

    Signed-off-by: Wang Nan
    Tested-by: Kim Phillips
    Tested-by: Naveen N. Rao
    Cc: Ravi Bangoria
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Fixes: 277cf08f3feb ("perf trace beauty mmap: Fix defines for non !x86_64")
    Link: http://lkml.kernel.org/r/1473850649-83389-3-git-send-email-wangnan0@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

14 Sep, 2016

1 commit

  • Some mmap related macros have different values for different
    architectures. This patch introduces uapi mman.h for each
    architectures.

    Three headers are cloned from kernel include to tools/include:

    tools/include/uapi/asm-generic/mman-common.h
    tools/include/uapi/asm-generic/mman.h
    tools/include/uapi/linux/mman.h

    The main part of this patch is generated by following script:

    macros=`cat $0 | awk 'V==1 {print}; /^# start macro list/ {V=1}'`
    for arch in `ls tools/arch`
    do
    [ -d tools/arch/$arch/include/uapi/asm ] || mkdir -p tools/arch/$arch/include/uapi/asm
    src=arch/$arch/include/uapi/asm/mman.h
    target=tools/arch/$arch/include/uapi/asm/mman.h
    guard="TOOLS_ARCH_"`echo $arch | awk '{print toupper($0)}'`_UAPI_ASM_MMAN_FIX_H
    echo '#ifndef '$guard > $target
    echo '#define '$guard >> $target

    [ -f $src ] &&
    for m in $macros
    do
    if grep '#define[ \t]*'$m $src > /dev/null 2>&1
    then
    grep -h '#define[ \t]*'$m $src | sed 's/[ \t]*\/\*.*$//g' >> $target
    fi
    done

    if [ -f $src ]
    then
    grep '#include > $target
    echo "$target"
    done

    exit 0
    # Following macros are extracted from:
    # tools/perf/trace/beauty/mmap.c
    #
    # start macro list
    MADV_DODUMP
    MADV_DOFORK
    MADV_DONTDUMP
    MADV_DONTFORK
    MADV_DONTNEED
    MADV_HUGEPAGE
    MADV_HWPOISON
    MADV_MERGEABLE
    MADV_NOHUGEPAGE
    MADV_NORMAL
    MADV_RANDOM
    MADV_REMOVE
    MADV_SEQUENTIAL
    MADV_SOFT_OFFLINE
    MADV_UNMERGEABLE
    MADV_WILLNEED
    MAP_32BIT
    MAP_ANONYMOUS
    MAP_DENYWRITE
    MAP_EXECUTABLE
    MAP_FILE
    MAP_FIXED
    MAP_GROWSDOWN
    MAP_HUGETLB
    MAP_LOCKED
    MAP_NONBLOCK
    MAP_NORESERVE
    MAP_POPULATE
    MAP_PRIVATE
    MAP_SHARED
    MAP_STACK
    MAP_UNINITIALIZED
    MREMAP_FIXED
    MREMAP_MAYMOVE
    PROT_EXEC
    PROT_GROWSDOWN
    PROT_GROWSUP
    PROT_NONE
    PROT_READ
    PROT_SEM
    PROT_WRITE

    Signed-off-by: Wang Nan
    Cc: Zefan Li
    Cc: pi3orama@163.com
    Link: http://lkml.kernel.org/r/1473684871-209320-2-git-send-email-wangnan0@huawei.com
    [ Added new files to tools/perf/MANIFEST to fix the detached tarball build, add mman.h for ARC ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Wang Nan
     

13 Jul, 2016

1 commit

  • We use it in bitops/__ffs.h and bitops/atomic.h, that we also got from
    the kernel, but were getting it from either newer systems that carry it
    in /usr/include, or from the kernel sources, that we decided not to
    touch from tools/ code. Fix it.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-lwqvgbuitjmrdpjmjp6zqnyx@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

09 May, 2015

1 commit