26 Oct, 2020

1 commit

  • Use a more generic form for __section that requires quotes to avoid
    complications with clang and gcc differences.

    Remove the quote operator # from compiler_attributes.h __section macro.

    Convert all unquoted __section(foo) uses to quoted __section("foo").
    Also convert __attribute__((section("foo"))) uses to __section("foo")
    even if the __attribute__ has multiple list entry forms.

    Conversion done using the script at:

    https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl

    Signed-off-by: Joe Perches
    Reviewed-by: Nick Desaulniers
    Reviewed-by: Miguel Ojeda
    Signed-off-by: Linus Torvalds

    Joe Perches
     

18 Apr, 2020

1 commit

  • As x86 was converted to use the modern SYM_ annotations for assembly,
    ifdefs were added to remove the generic definitions of the old style
    annotations on x86. Rather than collect a list of architectures in the
    ifdefs as more architectures are converted over, provide a Kconfig
    symbol for this and update x86 to use it.

    Signed-off-by: Mark Brown
    Signed-off-by: Borislav Petkov
    Acked-by: Jiri Slaby
    Link: https://lkml.kernel.org/r/20200416182402.6206-1-broonie@kernel.org

    Mark Brown
     

18 Oct, 2019

6 commits

  • Use the new SYM_INNER_LABEL_ALIGN for WEAK entries in the middle of x86
    assembly functions.

    And make sure WEAK is not defined for x86 anymore as these were the last
    users.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Borislav Petkov
    Cc: Andrey Ryabinin
    Cc: Boris Ostrovsky
    Cc: Herbert Xu
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Josh Poimboeuf
    Cc: linux-arch@vger.kernel.org
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: "Steven Rostedt (VMware)"
    Cc: Thomas Gleixner
    Cc: x86-ml
    Link: https://lkml.kernel.org/r/20191011115108.12392-29-jslaby@suse.cz

    Jiri Slaby
     
  • These are all functions which are invoked from elsewhere, so annotate
    them as global using the new SYM_FUNC_START and their ENDPROC's by
    SYM_FUNC_END.

    Now, ENTRY/ENDPROC can be forced to be undefined on X86, so do so.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Borislav Petkov
    Cc: Allison Randal
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Andy Shevchenko
    Cc: Ard Biesheuvel
    Cc: Bill Metzenthen
    Cc: Boris Ostrovsky
    Cc: Darren Hart
    Cc: "David S. Miller"
    Cc: Greg Kroah-Hartman
    Cc: Herbert Xu
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: linux-arch@vger.kernel.org
    Cc: linux-crypto@vger.kernel.org
    Cc: linux-efi
    Cc: linux-efi@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: Mark Rutland
    Cc: Matt Fleming
    Cc: Pavel Machek
    Cc: platform-driver-x86@vger.kernel.org
    Cc: "Rafael J. Wysocki"
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: x86-ml
    Link: https://lkml.kernel.org/r/20191011115108.12392-28-jslaby@suse.cz

    Jiri Slaby
     
  • Change all assembly code which is marked using END (and not ENDPROC) to
    appropriate new markings SYM_CODE_START and SYM_CODE_END.

    And since the last user of END on X86 is gone now, make sure that END is
    not defined there.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Borislav Petkov
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Boris Ostrovsky
    Cc: Herbert Xu
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Josh Poimboeuf
    Cc: linux-arch@vger.kernel.org
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc: "Steven Rostedt (VMware)"
    Cc: Thomas Gleixner
    Cc: x86-ml
    Link: https://lkml.kernel.org/r/20191011115108.12392-27-jslaby@suse.cz

    Jiri Slaby
     
  • These are all functions which are invoked from elsewhere, so annotate
    them as global using the new SYM_FUNC_START and their ENDPROC's by
    SYM_FUNC_END.

    Make sure ENTRY/ENDPROC is not defined on X86_64, given these were the
    last users.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Borislav Petkov
    Reviewed-by: Rafael J. Wysocki [hibernate]
    Reviewed-by: Boris Ostrovsky [xen bits]
    Acked-by: Herbert Xu [crypto]
    Cc: Allison Randal
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Andy Shevchenko
    Cc: Ard Biesheuvel
    Cc: Armijn Hemel
    Cc: Cao jin
    Cc: Darren Hart
    Cc: Dave Hansen
    Cc: "David S. Miller"
    Cc: Enrico Weigelt
    Cc: Greg Kroah-Hartman
    Cc: Herbert Xu
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Jim Mattson
    Cc: Joerg Roedel
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Kate Stewart
    Cc: "Kirill A. Shutemov"
    Cc: kvm ML
    Cc: Len Brown
    Cc: linux-arch@vger.kernel.org
    Cc: linux-crypto@vger.kernel.org
    Cc: linux-efi
    Cc: linux-efi@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: Mark Rutland
    Cc: Matt Fleming
    Cc: Paolo Bonzini
    Cc: Pavel Machek
    Cc: Peter Zijlstra
    Cc: platform-driver-x86@vger.kernel.org
    Cc: "Radim Krčmář"
    Cc: Sean Christopherson
    Cc: Stefano Stabellini
    Cc: "Steven Rostedt (VMware)"
    Cc: Thomas Gleixner
    Cc: Vitaly Kuznetsov
    Cc: Wanpeng Li
    Cc: Wei Huang
    Cc: x86-ml
    Cc: xen-devel@lists.xenproject.org
    Cc: Xiaoyao Li
    Link: https://lkml.kernel.org/r/20191011115108.12392-25-jslaby@suse.cz

    Jiri Slaby
     
  • Convert the remaining 32bit users and remove the GLOBAL macro finally.
    In particular, this means to use SYM_ENTRY for the singlestepping hack
    region.

    Exclude the global definition of GLOBAL from x86 too.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: linux-arch@vger.kernel.org
    Cc: Mark Rutland
    Cc: "Rafael J. Wysocki"
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: x86-ml
    Link: https://lkml.kernel.org/r/20191011115108.12392-20-jslaby@suse.cz

    Jiri Slaby
     
  • Introduce new C macros for annotations of functions and data in
    assembly. There is a long-standing mess in macros like ENTRY, END,
    ENDPROC and similar. They are used in different manners and sometimes
    incorrectly.

    So introduce macros with clear use to annotate assembly as follows:

    a) Support macros for the ones below
    SYM_T_FUNC -- type used by assembler to mark functions
    SYM_T_OBJECT -- type used by assembler to mark data
    SYM_T_NONE -- type used by assembler to mark entries of unknown type

    They are defined as STT_FUNC, STT_OBJECT, and STT_NOTYPE
    respectively. According to the gas manual, this is the most portable
    way. I am not sure about other assemblers, so this can be switched
    back to %function and %object if this turns into a problem.
    Architectures can also override them by something like ", @function"
    if they need.

    SYM_A_ALIGN, SYM_A_NONE -- align the symbol?
    SYM_L_GLOBAL, SYM_L_WEAK, SYM_L_LOCAL -- linkage of symbols

    b) Mostly internal annotations, used by the ones below
    SYM_ENTRY -- use only if you have to (for non-paired symbols)
    SYM_START -- use only if you have to (for paired symbols)
    SYM_END -- use only if you have to (for paired symbols)

    c) Annotations for code
    SYM_INNER_LABEL_ALIGN -- only for labels in the middle of code
    SYM_INNER_LABEL -- only for labels in the middle of code

    SYM_FUNC_START_LOCAL_ALIAS -- use where there are two local names for
    one function
    SYM_FUNC_START_ALIAS -- use where there are two global names for one
    function
    SYM_FUNC_END_ALIAS -- the end of LOCAL_ALIASed or ALIASed function

    SYM_FUNC_START -- use for global functions
    SYM_FUNC_START_NOALIGN -- use for global functions, w/o alignment
    SYM_FUNC_START_LOCAL -- use for local functions
    SYM_FUNC_START_LOCAL_NOALIGN -- use for local functions, w/o
    alignment
    SYM_FUNC_START_WEAK -- use for weak functions
    SYM_FUNC_START_WEAK_NOALIGN -- use for weak functions, w/o alignment
    SYM_FUNC_END -- the end of SYM_FUNC_START_LOCAL, SYM_FUNC_START,
    SYM_FUNC_START_WEAK, ...

    For functions with special (non-C) calling conventions:
    SYM_CODE_START -- use for non-C (special) functions
    SYM_CODE_START_NOALIGN -- use for non-C (special) functions, w/o
    alignment
    SYM_CODE_START_LOCAL -- use for local non-C (special) functions
    SYM_CODE_START_LOCAL_NOALIGN -- use for local non-C (special)
    functions, w/o alignment
    SYM_CODE_END -- the end of SYM_CODE_START_LOCAL or SYM_CODE_START

    d) For data
    SYM_DATA_START -- global data symbol
    SYM_DATA_START_LOCAL -- local data symbol
    SYM_DATA_END -- the end of the SYM_DATA_START symbol
    SYM_DATA_END_LABEL -- the labeled end of SYM_DATA_START symbol
    SYM_DATA -- start+end wrapper around simple global data
    SYM_DATA_LOCAL -- start+end wrapper around simple local data

    ==========

    The macros allow to pair starts and ends of functions and mark functions
    correctly in the output ELF objects.

    All users of the old macros in x86 are converted to use these in further
    patches.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Borislav Petkov
    Acked-by: Rafael J. Wysocki
    Cc: Andrew Morton
    Cc: Andrey Ryabinin
    Cc: Boris Ostrovsky
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Jonathan Corbet
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Len Brown
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pm@vger.kernel.org
    Cc: Mark Rutland
    Cc: Pavel Machek
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: x86-ml
    Cc: xen-devel@lists.xenproject.org
    Link: https://lkml.kernel.org/r/20191011115108.12392-2-jslaby@suse.cz

    Jiri Slaby
     

30 Nov, 2018

1 commit

  • Declaring a global symbol in assembly is tedious, error-prone, and
    painful to read. While ENTRY() exists, this is supposed to be used for
    function entry points, and this affects alignment in a potentially
    undesireable manner.

    Instead, let's add a generic GLOBAL() macro for this, as x86 added
    locally in commit:

    95695547a7db44b8 ("x86: asm linkage - introduce GLOBAL macro")

    ... thus allowing us to use this more freely in the kernel.

    Signed-off-by: Mark Rutland
    Cc: AKASHI Takahiro
    Cc: Ard Biesheuvel
    Cc: Catalin Marinas
    Cc: Torsten Duwe
    Cc: Will Deacon
    Signed-off-by: Will Deacon

    Mark Rutland
     

27 Oct, 2018

1 commit

  • Since WEAK() supposed to be used instead of ENTRY() to define weak
    symbols, but unlike ENTRY() it doesn't have ALIGN directive. It seems
    there is no actual reason to not have, so let's add ALIGN to WEAK() too.

    Link: http://lkml.kernel.org/r/20180920135631.23833-1-aryabinin@virtuozzo.com
    Signed-off-by: Andrey Ryabinin
    Will Deacon , Catalin Marinas
    Cc: Kyeongdon Kim
    Cc: Ard Biesheuvel
    Cc: Alexander Potapenko
    Cc: Dmitry Vyukov
    Cc: Mark Rutland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Ryabinin
     

12 Jun, 2018

1 commit


07 Nov, 2017

1 commit


02 Nov, 2017

1 commit

  • 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
     

24 Oct, 2017

1 commit

  • linux/compiler.h is included indirectly by linux/types.h via
    uapi/linux/types.h -> uapi/linux/posix_types.h -> linux/stddef.h
    -> uapi/linux/stddef.h and is needed to provide a proper definition of
    offsetof.

    Unfortunately, compiler.h requires a definition of
    smp_read_barrier_depends() for defining lockless_dereference() and soon
    for defining READ_ONCE(), which means that all
    users of READ_ONCE() will need to include asm/barrier.h to avoid splats
    such as:

    In file included from include/uapi/linux/stddef.h:1:0,
    from include/linux/stddef.h:4,
    from arch/h8300/kernel/asm-offsets.c:11:
    include/linux/list.h: In function 'list_empty':
    >> include/linux/compiler.h:343:2: error: implicit declaration of function 'smp_read_barrier_depends' [-Werror=implicit-function-declaration]
    smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
    ^

    A better alternative is to include asm/barrier.h in linux/compiler.h,
    but this requires a type definition for "bool" on some architectures
    (e.g. x86), which is defined later by linux/types.h. Type "bool" is also
    used directly in linux/compiler.h, so the whole thing is pretty fragile.

    This patch splits compiler.h in two: compiler_types.h contains type
    annotations, definitions and the compiler-specific parts, whereas
    compiler.h #includes compiler-types.h and additionally defines macros
    such as {READ,WRITE.ACCESS}_ONCE().

    uapi/linux/stddef.h and linux/linkage.h are then moved over to include
    linux/compiler_types.h, which fixes the build for h8 and blackfin.

    Signed-off-by: Will Deacon
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1508840570-22169-2-git-send-email-will.deacon@arm.com
    Signed-off-by: Ingo Molnar

    Will Deacon
     

06 May, 2014

1 commit

  • As requested by Linus, revert adding __visible to asmlinkage.
    Instead we add __visible explicitely to all the symbols
    that need it.

    This reverts commit 128ea04a9885af9629059e631ddf0cab4815b589.

    Link: http://lkml.kernel.org/r/1398984278-29319-2-git-send-email-andi@firstfloor.org
    Signed-off-by: H. Peter Anvin

    Andi Kleen
     

14 Feb, 2014

1 commit


28 Jan, 2014

1 commit


06 May, 2013

1 commit

  • Pull mudule updates from Rusty Russell:
    "We get rid of the general module prefix confusion with a binary config
    option, fix a remove/insert race which Never Happens, and (my
    favorite) handle the case when we have too many modules for a single
    commandline. Seriously, the kernel is full, please go away!"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    modpost: fix unwanted VMLINUX_SYMBOL_STR expansion
    X.509: Support parse long form of length octets in Authority Key Identifier
    module: don't unlink the module until we've removed all exposure.
    kernel: kallsyms: memory override issue, need check destination buffer length
    MODSIGN: do not send garbage to stderr when enabling modules signature
    modpost: handle huge numbers of modules.
    modpost: add -T option to read module names from file/stdin.
    modpost: minor cleanup.
    genksyms: pass symbol-prefix instead of arch
    module: fix symbol versioning with symbol prefixes
    CONFIG_SYMBOL_PREFIX: cleanup.

    Linus Torvalds
     

02 May, 2013

1 commit

  • Al's commit e1b5bb6d1236 ("consolidate cond_syscall and SYSCALL_ALIAS
    declarations") broke the build on blackfin and metag due to the
    following code:

    #ifndef SYMBOL_NAME
    #ifdef CONFIG_SYMBOL_PREFIX
    #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x
    #else
    #define SYMBOL_NAME(x) x
    #endif
    #endif
    #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x))

    __stringify literally stringifies CONFIG_SYMBOL_PREFIX ##x, so you get
    lines like this in kernel/sys_ni.s:

    .weak CONFIG_SYMBOL_PREFIXsys_quotactl
    .set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscall

    The patches in Rusty's modules-next tree such as "CONFIG_SYMBOL_PREFIX:
    cleanup." cleans up the whole mess around symbol prefixes, so this patch
    just attempts to fix the build in the meantime.

    The intermediate definition of SYMBOL_NAME above isn't used and is
    incorrect when CONFIG_SYMBOL_PREFIX is defined as CONFIG_SYMBOL_PREFIX
    is a quoted string literal, so define __SYMBOL_NAME directly depending
    on CONFIG_SYMBOL_PREFIX.

    Signed-off-by: James Hogan
    Mea-culpa-by: Al Viro
    Cc: Rusty Russell
    Cc: Mike Frysinger
    Cc: uclinux-dist-devel@blackfin.uclinux.org
    Signed-off-by: Linus Torvalds

    James Hogan
     

04 Mar, 2013

1 commit


13 Jan, 2012

3 commits


24 May, 2011

1 commit

  • As UML does no longer need asmregparm we can remove it.

    Signed-off-by: Richard Weinberger
    Cc: namhyung@gmail.com
    Cc: davem@davemloft.net
    Cc: fweisbec@gmail.com
    Cc: dhowells@redhat.com
    Link: http://lkml.kernel.org/r/%3C1306189085-29896-1-git-send-email-richard%40nod.at%3E
    Signed-off-by: Thomas Gleixner

    Richard Weinberger
     

03 Mar, 2010

2 commits


21 Sep, 2009

1 commit

  • Adding a reference to to x86's causes
    the x86 linker script to have syntax errors, because the ALIGN and
    ENTRY keywords get redefined to the assembly implementations of those.
    One could fix this by adjusting the include structure, but I think any
    solution based on that approach would be fragile.

    Currently, it is impossible when writing a header to do something
    different for assembly files and linker scripts, even though there are
    clearly cases where one wants them to define macros differently for
    the two (ENTRY being an excellent example).
    So I think the right solution here is to introduce a new preprocessor
    definition, called LINKER_SCRIPT that is set along with __ASSEMBLY__
    for linker scripts, and to use that to not define ALIGN and ENTRY in
    linker scripts.
    I suspect we'll find other uses for this mechanism in
    the future.

    Signed-off-by: Tim Abbott
    Signed-off-by: Sam Ravnborg

    Tim Abbott
     

27 Jun, 2009

1 commit

  • This patch is preparation for replacing most uses of
    ".bss.page_aligned" and ".data.page_aligned" in the kernel with
    macros, so that the section name can later be changed without having
    to touch a lot of the kernel.

    The long-term goal here is to be able to change the kernel's magic
    section names to those that are compatible with -ffunction-sections
    -fdata-sections. This requires renaming all magic sections with names
    of the form ".data.foo".

    Signed-off-by: Tim Abbott
    Acked-by: David Howells
    Signed-off-by: Sam Ravnborg

    Tim Abbott
     

27 Nov, 2008

1 commit

  • entry_32.S is now the only user of KPROBE_ENTRY / KPROBE_END,
    treewide. This patch reorders entry_64.S and explicitly generates
    a separate section for functions that need the protection. The
    generated code before and after the patch is equal.

    The KPROBE_ENTRY and KPROBE_END macro's are removed too.

    Signed-off-by: Alexander van Heukelum
    Signed-off-by: Ingo Molnar

    Alexander van Heukelum
     

14 Oct, 2008

1 commit


14 Jul, 2008

1 commit


08 Jul, 2008

1 commit

  • Making a variable page-aligned by using
    __attribute__((section(".data.page_aligned"))) is fragile because if
    sizeof(variable) is not also a multiple of page size, it leaves
    variables in the remainder of the section unaligned.

    This patch introduces two new qualifiers, __page_aligned_data and
    __page_aligned_bss to set the section *and* the alignment of
    variables. This makes page-aligned variables more robust because the
    linker will make sure they're aligned properly. Unfortunately it
    requires *all* page-aligned data to use these macros...

    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     

24 May, 2008

1 commit

  • notrace signals that a function should not be traced. Most of the
    time this is used by tracers to annotate code that cannot be
    traced - it's in a volatile state (such as in user vdso context
    or NMI context) or it's in the tracer internals.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Ingo Molnar
     

11 Apr, 2008

3 commits

  • git commit 54a015104136974262afa4b8ddd943ea70dec8a2 ("asmlinkage_protect
    replaces prevent_tail_call") causes this build failure on s390:

    AS arch/s390/kernel/entry64.o
    In file included from arch/s390/kernel/entry64.S:14:
    include/linux/linkage.h:34: error: syntax error in macro parameter list
    make[1]: *** [arch/s390/kernel/entry64.o] Error 1
    make: *** [arch/s390/kernel] Error 2

    and some other architectures. The reason is that some architectures add
    the "-traditional" flag to the invocation of $(AS), which disables
    variadic macro argument support.

    So just surround the new define with an #ifndef __ASSEMBLY__ to prevent
    any side effects on asm code.

    Cc: Roland McGrath
    Cc: Martin Schwidefsky
    Signed-off-by: Heiko Carstens
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • It's really a pretty ugly thing to need, and some day it will hopefully
    be obviated by teaching gcc about the magic calling conventions for the
    low-level system call code, but in the meantime we can at least add big
    honking comments about why we need these insane and strange macros.

    I took my comments from my version of the macro, but I ended up deciding
    to just pick Roland's version of the actual code instead (with his
    prettier syntax that uses vararg macros). Thus the previous two commits
    that actually implement it.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • The prevent_tail_call() macro works around the problem of the compiler
    clobbering argument words on the stack, which for asmlinkage functions
    is the caller's (user's) struct pt_regs. The tail/sibling-call
    optimization is not the only way that the compiler can decide to use
    stack argument words as scratch space, which we have to prevent.
    Other optimizations can do it too.

    Until we have new compiler support to make "asmlinkage" binding on the
    compiler's own use of the stack argument frame, we have work around all
    the manifestations of this issue that crop up.

    More cases seem to be prevented by also keeping the incoming argument
    variables live at the end of the function. This makes their original
    stack slots attractive places to leave those variables, so the compiler
    tends not clobber them for something else. It's still no guarantee, but
    it handles some observed cases that prevent_tail_call() did not.

    Signed-off-by: Roland McGrath
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

14 Feb, 2008

1 commit


30 Jan, 2008

2 commits

  • The ENDPROCs() were not used everywhere. Some code used just END() instead,
    while other code used nothing. um/sys-i386/checksum.S didn't #include
    . I also got confused because gcc puts the
    .type near the ENTRY, while ENDPROC puts it on the opposite end.

    Signed off by: John Reiser
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    John Reiser
     
  • introduce the "asmregparm" calling convention: for functions
    implemented in assembly with a fixed regparm input parameters
    calling convention.

    mark the semaphore and rwsem slowpath functions with that.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Miklos Szeredi
    Signed-off-by: Thomas Gleixner

    Ingo Molnar
     

22 Oct, 2007

1 commit