11 Jun, 2020

1 commit

  • Redefine GZIP, BZIP2, LZOP variables as KGZIP, KBZIP2, KLZOP resp.
    GZIP, BZIP2, LZOP env variables are reserved by the tools. The original
    attempt to redefine them internally doesn't work in makefiles/scripts
    intercall scenarios, e.g., "make GZIP=gzip bindeb-pkg" and results in
    broken builds. There can be other broken build commands because of this,
    so the universal solution is to use non-reserved env variables for the
    compression tools.

    Fixes: 8dfb61dcbace ("kbuild: add variables for compression tools")
    Signed-off-by: Denis Efremov
    Tested-by: Guenter Roeck
    Signed-off-by: Masahiro Yamada

    Denis Efremov
     

07 Jun, 2020

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - fix warnings in 'make clean' for ARCH=um, hexagon, h8300, unicore32

    - ensure to rebuild all objects when the compiler is upgraded

    - exclude system headers from dependency tracking and fixdep processing

    - fix potential bit-size mismatch between the kernel and BPF user-mode
    helper

    - add the new syntax 'userprogs' to build user-space programs for the
    target architecture (the same arch as the kernel)

    - compile user-space sample code under samples/ for the target arch
    instead of the host arch

    - make headers_install fail if a CONFIG option is leaked to user-space

    - sanitize the output format of scripts/checkstack.pl

    - handle ARM 'push' instruction in scripts/checkstack.pl

    - error out before modpost if a module name conflict is found

    - error out when multiple directories are passed to M= because this
    feature is broken for a long time

    - add CONFIG_DEBUG_INFO_COMPRESSED to support compressed debug info

    - a lot of cleanups of modpost

    - dump vmlinux symbols out into vmlinux.symvers, and reuse it in the
    second pass of modpost

    - do not run the second pass of modpost if nothing in modules is
    updated

    - install modules.builtin(.modinfo) by 'make install' as well as by
    'make modules_install' because it is useful even when
    CONFIG_MODULES=n

    - add new command line variables, GZIP, BZIP2, LZOP, LZMA, LZ4, and XZ
    to allow users to use alternatives such as pigz, pbzip2, etc.

    * tag 'kbuild-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (96 commits)
    kbuild: add variables for compression tools
    Makefile: install modules.builtin even if CONFIG_MODULES=n
    mksysmap: Fix the mismatch of '.L' symbols in System.map
    kbuild: doc: rename LDFLAGS to KBUILD_LDFLAGS
    modpost: change elf_info->size to size_t
    modpost: remove is_vmlinux() helper
    modpost: strip .o from modname before calling new_module()
    modpost: set have_vmlinux in new_module()
    modpost: remove mod->skip struct member
    modpost: add mod->is_vmlinux struct member
    modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}()
    modpost: remove mod->is_dot_o struct member
    modpost: move -d option in scripts/Makefile.modpost
    modpost: remove -s option
    modpost: remove get_next_text() and make {grab,release_}file static
    modpost: use read_text_file() and get_line() for reading text files
    modpost: avoid false-positive file open error
    modpost: fix potential mmap'ed file overrun in get_src_version()
    modpost: add read_text_file() and get_line() helpers
    modpost: do not call get_modinfo() for vmlinux(.o)
    ...

    Linus Torvalds
     

06 Jun, 2020

1 commit

  • Allow user to use alternative implementations of compression tools,
    such as pigz, pbzip2, pxz. For example, multi-threaded tools to
    speed up the build:
    $ make GZIP=pigz BZIP2=pbzip2

    Variables _GZIP, _BZIP2, _LZOP are used internally because original env
    vars are reserved by the tools. The use of GZIP in gzip tool is obsolete
    since 2015. However, alternative implementations (e.g., pigz) still rely
    on it. BZIP2, BZIP, LZOP vars are not obsolescent.

    The credit goes to @grsecurity.

    As a sidenote, for multi-threaded lzma, xz compression one can use:
    $ export XZ_OPT="--threads=0"

    Signed-off-by: Denis Efremov
    Signed-off-by: Masahiro Yamada

    Denis Efremov
     

11 May, 2020

1 commit


27 Mar, 2020

1 commit


06 Nov, 2019

1 commit

  • When using patchable-function-entry, the compiler will record the
    callsites into a section named "__patchable_function_entries" rather
    than "__mcount_loc". Let's abstract this difference behind a new
    FTRACE_CALLSITE_SECTION, so that architectures don't have to handle this
    explicitly (e.g. with custom module linker scripts).

    As parisc currently handles this explicitly, it is fixed up accordingly,
    with its custom linker script removed. Since FTRACE_CALLSITE_SECTION is
    only defined when DYNAMIC_FTRACE is selected, the parisc module loading
    code is updated to only use the definition in that case. When
    DYNAMIC_FTRACE is not selected, modules shouldn't have this section, so
    this removes some redundant work in that case.

    To make sure that this is keep up-to-date for modules and the main
    kernel, a comment is added to vmlinux.lds.h, with the existing ifdeffery
    simplified for legibility.

    I built parisc generic-{32,64}bit_defconfig with DYNAMIC_FTRACE enabled,
    and verified that the section made it into the .ko files for modules.

    Signed-off-by: Mark Rutland
    Acked-by: Helge Deller
    Acked-by: Steven Rostedt (VMware)
    Reviewed-by: Ard Biesheuvel
    Reviewed-by: Torsten Duwe
    Tested-by: Amit Daniel Kachhap
    Tested-by: Sven Schnelle
    Tested-by: Torsten Duwe
    Cc: Ingo Molnar
    Cc: James E.J. Bottomley
    Cc: Jessica Yu
    Cc: linux-parisc@vger.kernel.org

    Mark Rutland
     

21 Aug, 2019

1 commit


01 Aug, 2019

1 commit

  • Apparently we don't have an archclean target in our
    arch/parisc/Makefile, so files in there never get cleaned out by make
    mrproper. This, in turn means that the sizes.h file in
    arch/parisc/boot/compressed never gets removed and worse, when you
    transition to an O=build/parisc[64] build model it overrides the
    generated file. The upshot being my bzImage was building with a SZ_end
    that was too small.

    I fixed it by making mrproper clean everything.

    Signed-off-by: James Bottomley
    Cc: stable@vger.kernel.org # v4.20+
    Signed-off-by: Helge Deller

    James Bottomley
     

31 Jul, 2019

1 commit


13 Jul, 2019

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - remove headers_{install,check}_all targets

    - remove unreasonable 'depends on !UML' from CONFIG_SAMPLES

    - re-implement 'make headers_install' more cleanly

    - add new header-test-y syntax to compile-test headers

    - compile-test exported headers to ensure they are compilable in
    user-space

    - compile-test headers under include/ to ensure they are self-contained

    - remove -Waggregate-return, -Wno-uninitialized, -Wno-unused-value
    flags

    - add -Werror=unknown-warning-option for Clang

    - add 128-bit built-in types support to genksyms

    - fix missed rebuild of modules.builtin

    - propagate 'No space left on device' error in fixdep to Make

    - allow Clang to use its integrated assembler

    - improve some coccinelle scripts

    - add a new flag KBUILD_ABS_SRCTREE to request Kbuild to use absolute
    path for $(srctree).

    - do not ignore errors when compression utility is missing

    - misc cleanups

    * tag 'kbuild-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (49 commits)
    kbuild: use -- separater intead of $(filter-out ...) for cc-cross-prefix
    kbuild: Inform user to pass ARCH= for make mrproper
    kbuild: fix compression errors getting ignored
    kbuild: add a flag to force absolute path for srctree
    kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree
    kbuild: remove src and obj from the top Makefile
    scripts/tags.sh: remove unused environment variables from comments
    scripts/tags.sh: drop SUBARCH support for ARM
    kbuild: compile-test kernel headers to ensure they are self-contained
    kheaders: include only headers into kheaders_data.tar.xz
    kheaders: remove meaningless -R option of 'ls'
    kbuild: support header-test-pattern-y
    kbuild: do not create wrappers for header-test-y
    kbuild: compile-test exported headers to ensure they are self-contained
    init/Kconfig: add CONFIG_CC_CAN_LINK
    kallsyms: exclude kasan local symbols on s390
    kbuild: add more hints about SUBDIRS replacement
    coccinelle: api/stream_open: treat all wait_.*() calls as blocking
    coccinelle: put_device: Add a cast to an expression for an assignment
    coccinelle: put_device: Adjust a message construction
    ...

    Linus Torvalds
     

10 Jul, 2019

1 commit


08 Jun, 2019

1 commit

  • This patch implements dynamic ftrace for PA-RISC. The required mcount
    call sequences can get pretty long, so instead of patching the
    whole call sequence out of the functions, we are using
    -fpatchable-function-entry from gcc. This puts a configurable amount of
    NOPS before/at the start of the function. Taking do_sys_open() as example,
    which would look like this when the call is patched out:

    1036b248: 08 00 02 40 nop
    1036b24c: 08 00 02 40 nop
    1036b250: 08 00 02 40 nop
    1036b254: 08 00 02 40 nop

    1036b258 :
    1036b258: 08 00 02 40 nop
    1036b25c: 08 03 02 41 copy r3,r1
    1036b260: 6b c2 3f d9 stw rp,-14(sp)
    1036b264: 08 1e 02 43 copy sp,r3
    1036b268: 6f c1 01 00 stw,ma r1,80(sp)

    When ftrace gets enabled for this function the kernel will patch these
    NOPs to:

    1036b248: 10 19 57 20


    1036b24c: 6f c1 00 80 stw,ma r1,40(sp)
    1036b250: 48 21 3f d1 ldw -18(r1),r1
    1036b254: e8 20 c0 02 bv,n r0(r1)

    1036b258 :
    1036b258: e8 3f 1f df b,l,n .-c,r1
    1036b25c: 08 03 02 41 copy r3,r1
    1036b260: 6b c2 3f d9 stw rp,-14(sp)
    1036b264: 08 1e 02 43 copy sp,r3
    1036b268: 6f c1 01 00 stw,ma r1,80(sp)

    So the first NOP in do_sys_open() will be patched to jump backwards into
    some minimal trampoline code which pushes a stackframe, saves r1 which
    holds the return address, loads the address of the real ftrace function,
    and branches to that location. For 64 Bit things are getting a bit more
    complicated (and longer) because we must make sure that the address of
    ftrace location is 8 byte aligned, and the offset passed to ldd for
    fetching the address is 8 byte aligned as well.

    Note that gcc has a bug which misplaces the function label, and needs a
    patch to make dynamic ftrace work. See
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90751 for details.

    Signed-off-by: Sven Schnelle
    Signed-off-by: Helge Deller

    Sven Schnelle
     

10 Dec, 2018

1 commit

  • System call table generation script must be run to gener-
    ate unistd_32/64.h and syscall_table_32/64/c32.h files.
    This patch will have changes which will invokes the script.

    This patch will generate unistd_32/64.h and syscall_table-
    _32/64/c32.h files by the syscall table generation script
    invoked by parisc/Makefile and the generated files against
    the removed files must be identical.

    The generated uapi header file will be included in uapi/-
    asm/unistd.h and generated system call table header file
    will be included by kernel/syscall.S file.

    Signed-off-by: Firoz Khan
    Acked-by: Helge Deller
    Signed-off-by: Helge Deller

    Firoz Khan
     

03 Dec, 2018

1 commit

  • Frank Schreiner reported, that since kernel 4.18 he faces sysfs-warnings
    when loading modules on a 32-bit kernel. Here is one such example:

    sysfs: cannot create duplicate filename '/module/nfs/sections/.text'
    CPU: 0 PID: 98 Comm: modprobe Not tainted 4.18.0-2-parisc #1 Debian 4.18.10-2
    Backtrace:
    [] show_stack+0x3c/0x50
    [] dump_stack+0x28/0x38
    [] sysfs_warn_dup+0x88/0xac
    [] sysfs_add_file_mode_ns+0x164/0x1d0
    [] internal_create_group+0x11c/0x304
    [] sysfs_create_group+0x48/0x60
    [] load_module.constprop.35+0x1f9c/0x23b8
    [] sys_finit_module+0xd0/0x11c
    [] syscall_exit+0x0/0x14

    This warning gets triggered by the fact, that due to commit 24b6c22504a2
    ("parisc: Build kernel without -ffunction-sections") we now get multiple .text
    sections in the kernel modules for which sysfs_create_group() can't create
    multiple virtual files.

    This patch works around the problem by re-enabling the -ffunction-sections
    compiler option for modules, while keeping it disabled for the non-module
    kernel code.

    Reported-by: Frank Scheiner
    Fixes: 24b6c22504a2 ("parisc: Build kernel without -ffunction-sections")
    Cc: # v4.18+
    Signed-off-by: Helge Deller

    Helge Deller
     

17 Oct, 2018

1 commit


29 Jun, 2018

1 commit


01 Jun, 2018

1 commit

  • By default, sparse assumes a 64bit machine when compiled on x86-64
    and 32bit when compiled on anything else.

    This can of course create all sort of problems for the other archs, like
    issuing false warnings ('shift too big (32) for type unsigned long'), or
    worse, failing to emit legitimate warnings.

    Fix this by adding the -m32/-m64 flag, depending on CONFIG_64BIT,
    to CHECKFLAGS in the main Makefile (and so for all archs).
    Also, remove the now unneeded -m32/-m64 in arch specific Makefiles.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Masahiro Yamada

    Luc Van Oostenryck
     

29 May, 2018

1 commit

  • The kernel depends on macros like __BYTE_ORDER__,
    __BIG_ENDIAN__ or __LITTLE_ENDIAN__.

    OTOH, sparse doesn't know about the endianness of the kernel and
    by default uses the same as the machine on which sparse was built.

    Ensure that sparse can predefine the macros corresponding to
    how the kernel was configured by adding -m{big,little}-endian
    to CHECKFLAGS in the main Makefile (and so for all archs).
    Also, remove the equivalent done in arch specific Makefiles.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Masahiro Yamada

    Luc Van Oostenryck
     

18 Apr, 2018

1 commit


17 Nov, 2017

1 commit

  • parisc is big-endian only but sparse assumes the same endianness as the
    building machine.
    This is problematic for code which expect __BYTE_ORDER__ being correctly
    predefined by the compiler which sparse can then pre-process differently
    from what gcc would.

    Fix this by letting sparse know about the architecture endianness.

    To: James Bottomley
    To: Helge Deller
    CC: linux-parisc@vger.kernel.org
    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Helge Deller

    Luc Van Oostenryck
     

23 Sep, 2017

1 commit

  • By adding the feature to build the kernel as self-extracting
    executeable, the possibility to simply compress the kernel with gzip was
    lost.

    This patch now reintroduces this possibilty again and leaves it up to
    the user to decide how the kernel should be built.

    The palo bootloader is able to natively load both formats.

    Signed-off-by: Helge Deller

    Helge Deller
     

22 Aug, 2017

1 commit


14 Apr, 2016

1 commit

  • Fix the FTRACE function tracer for 32- and 64-bit kernel.
    The former code was horribly broken.

    Reimplement most coding in assembly and utilize optimizations, e.g. put
    mcount() and ftrace_stub() into one L1 cacheline.

    Signed-off-by: Helge Deller

    Helge Deller
     

20 Feb, 2015

1 commit

  • Pull kbuild updates from Michal Marek:

    - several cleanups in kbuild

    - serialize multiple *config targets so that 'make defconfig kvmconfig'
    works

    - The cc-ifversion macro got support for an else-branch

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild,gcov: simplify kernel/gcov/Makefile more
    kbuild: allow cc-ifversion to have the argument for false condition
    kbuild,gcov: simplify kernel/gcov/Makefile
    kbuild,gcov: remove unnecessary workaround
    kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion
    kbuild: fix cc-ifversion macro
    kbuild: drop $(version_h) from MRPROPER_FILES
    kbuild: use mixed-targets when two or more config targets are given
    kbuild: remove redundant line from bounds.h/asm-offsets.h
    kbuild: merge bounds.h and asm-offsets.h rules
    kbuild: Drop support for clean-rule

    Linus Torvalds
     

17 Feb, 2015

1 commit


10 Jan, 2015

1 commit


24 Sep, 2014

1 commit

  • In spite of what the GCC manual says, the -mfast-indirect-calls has
    never been supported in the 64-bit parisc compiler. Indirect calls have
    always been done using function descriptors irrespective of the
    -mfast-indirect-calls option.

    Recently, it was noticed that a function descriptor was always requested
    when the -mfast-indirect-calls option was specified. This caused
    problems when the option was used in application code and doesn't make
    any sense because the whole point of the option is to avoid using a
    function descriptor for indirect calls.

    Fixing this broke 64-bit kernel builds.

    I will fix GCC but for now we need the attached change. This results in
    the same kernel code as before.

    Signed-off-by: John David Anglin
    Cc: stable@vger.kernel.org # v3.0+
    Signed-off-by: Helge Deller

    John David Anglin
     

08 Nov, 2013

1 commit

  • Install targets (install, zinstall, uinstall) on parisc have a
    dependency to vmlinux. This may cause parts of the kernel to be rebuilt
    during installation. We must avoid this since this may run as root.
    Install targets "ABSOLUTELY MUST NOT MODIFY THE SOURCE TREE." as Linus
    emphasized this in:

    http://lkml.org/lkml/2013/7/10/600

    So on parisc and maybe other archs we need the same as for x86:

    1648e4f8 x86, kbuild: make "make install" not depend on vmlinux

    This parisc patch was inspired by:

    19514fc6 arm, kbuild: make "make install" not depend on vmlinux

    Signed-off-by: Helge Deller

    Helge Deller
     

10 Jul, 2013

1 commit

  • The latest PA-RISC Boot Loader (palo) allows loading of gzip compressed
    vmlinuz kernels. So let's now switch to build a vmlinuz file when we
    build a palo boot image.

    PALO version 1.9 (or higher) is required for this which is available at
    git://git.kernel.org/pub/scm/linux/kernel/git/deller/palo.git

    Signed-off-by: Helge Deller
    Cc: # 3.10

    Helge Deller
     

01 Jun, 2013

1 commit

  • There's a Makefile line setting cflags for CONFIG_PA7100. But that
    Kconfig macro doesn't exist. There is a Kconfig symbol PA7000, which
    covers both PA7000 and PA7100 processors. So let's use the corresponding
    Kconfig macro.

    Signed-off-by: Paul Bolle
    Signed-off-by: Helge Deller

    Paul Bolle
     

14 May, 2013

1 commit

  • People/distros vary how they prefix the toolchain name for 64bit builds.
    Rather than enforce one convention over another, add a for loop which
    does a search for all the general prefixes.

    For 64bit builds, we now search for (in order):
    hppa64-unknown-linux-gnu
    hppa64-linux-gnu
    hppa64-linux

    For 32bit builds, we look for:
    hppa-unknown-linux-gnu
    hppa-linux-gnu
    hppa-linux
    hppa2.0-unknown-linux-gnu
    hppa2.0-linux-gnu
    hppa2.0-linux
    hppa1.1-unknown-linux-gnu
    hppa1.1-linux-gnu
    hppa1.1-linux

    This patch was initiated by Mike Frysinger, with feedback from Jeroen
    Roovers, John David Anglin and Helge Deller.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Jeroen Roovers
    Signed-off-by: John David Anglin
    Signed-off-by: Helge Deller

    Helge Deller
     

07 May, 2013

1 commit

  • The ifeq operator does not accept globs, so this little bit of code will
    never match (unless uname literally prints out "parsic*"). Rewrite to
    use a pattern matching operator so that NATIVE is set to 1 on parisc.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Helge Deller

    Mike Frysinger
     

26 Apr, 2013

1 commit

  • CONFIG_MLONGCALLS was introduced in commit
    ec758f98328da3eb933a25dc7a2eed01ef44d849 to overcome linker issues when linking
    huge linux kernels, e.g. with many modules linked in.

    But in the kernel module loader there is no support yet for the new relocation
    types, which is why modules built with -mlong-calls can't be loaded.
    Furthermore, for modules long calls are not really necessary, since we already
    use stub sections which resolve long distance calls.

    So, let's just disable this compiler option when compiling kernel modules.

    Signed-off-by: Helge Deller

    Helge Deller
     

03 Mar, 2013

1 commit


21 Feb, 2013

2 commits


05 Jun, 2012

1 commit

  • Sam broke this with

    commit 1f2bfbd00e466ff3489b2ca5cc75b1cccd14c123
    Author: Sam Ravnborg
    Date: Sat May 5 10:18:41 2012 +0200

    kbuild: link of vmlinux moved to a script

    But we should be deriving the location of libgcc in the same way as all
    the other archs, so fix by adding a LIBGCC variable which is evaluated
    in the makefile

    Signed-off-by: James Bottomley

    James Bottomley
     

07 May, 2012

1 commit


28 Feb, 2012

1 commit


20 Sep, 2009

1 commit

  • Replace the use of CROSS_COMPILE to select a customized
    installkernel script with the possibility to set INSTALLKERNEL
    to select a custom installkernel script when running make:

    make INSTALLKERNEL=arm-installkernel install

    With this patch we are now more consistent across
    different architectures - they did not all support use
    of CROSS_COMPILE.

    The use of CROSS_COMPILE was a hack as this really belongs
    to gcc/binutils and the installkernel script does not change
    just because we change toolchain.

    The use of CROSS_COMPILE caused troubles with an upcoming patch
    that saves CROSS_COMPILE when a kernel is built - it would no
    longer be installable.
    [Thanks to Peter Z. for this hint]

    This patch undos what Ian did in commit:

    0f8e2d62fa04441cd12c08ce521e84e5bd3f8a46
    ("use ${CROSS_COMPILE}installkernel in arch/*/boot/install.sh")

    The patch has been lightly tested on x86 only - but all changes
    looks obvious.

    Acked-by: Peter Zijlstra
    Acked-by: Mike Frysinger [blackfin]
    Acked-by: Russell King [arm]
    Acked-by: Paul Mundt [sh]
    Acked-by: "H. Peter Anvin" [x86]
    Cc: Ian Campbell
    Cc: Tony Luck [ia64]
    Cc: Fenghua Yu [ia64]
    Cc: Hirokazu Takata [m32r]
    Cc: Geert Uytterhoeven [m68k]
    Cc: Kyle McMartin [parisc]
    Cc: Benjamin Herrenschmidt [powerpc]
    Cc: Martin Schwidefsky [s390]
    Cc: Thomas Gleixner [x86]
    Cc: Ingo Molnar [x86]
    Signed-off-by: Sam Ravnborg

    Sam Ravnborg