02 May, 2019

1 commit

  • Rework the dump_trace() stack unwinder interface to support different
    unwinding algorithms. The new interface looks like this:

    struct unwind_state state;
    unwind_for_each_frame(&state, task, regs, start_stack)
    do_something(state.sp, state.ip, state.reliable);

    The unwind_bc.c file contains the implementation for the classic
    back-chain unwinder.

    One positive side effect of the new code is it now handles ftraced
    functions gracefully. It prints the real name of the return function
    instead of 'return_to_handler'.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

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
     

17 Oct, 2016

1 commit

  • Before merging all different stack tracers the call traces printed had
    an indicator if an entry can be considered reliable or not.
    Unreliable entries were put in braces, reliable not. Currently all
    lines contain these extra braces.

    This patch restores the old behaviour by adding an extra "reliable"
    parameter to the callback functions. Only show_trace makes currently
    use of it.

    Before:
    [ 0.804751] Call Trace:
    [ 0.804753] ([] try_to_wake_up+0x318/0x5e0)
    [ 0.804756] ([] create_worker+0x174/0x1c0)

    After:
    [ 0.804751] Call Trace:
    [ 0.804753] ([] try_to_wake_up+0x318/0x5e0)
    [ 0.804756] [] create_worker+0x174/0x1c0

    Fixes: 758d39ebd3d5 ("s390/dumpstack: merge all four stack tracers")
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

28 Jun, 2016

1 commit

  • Remove hardware sampler support from oprofile module.

    The oprofile user space utilty has been switched to use the kernel
    perf interface, for which we also provide hardware sampling support.

    In addition the hardware sampling support is also slightly broken: it
    supports only 16 bits for the pid and therefore would generate wrong
    results on machines which have a pid >64k.

    Also the pt_regs structure which was passed to oprofile common code
    cannot necessarily be used to generate sane backtraces, since the
    task(s) in question may run while the samples are fed to oprofile.
    So the result would be more or less random.

    However given that the only user space tools switched to the perf
    interface already four years ago the hardware sampler code seems to be
    unused code, and therefore it should be reasonable to remove it.

    The timer based oprofile support continues to work.

    Signed-off-by: Heiko Carstens
    Acked-by: Andreas Arnez
    Acked-by: Andreas Krebbel
    Acked-by: Robert Richter
    Reviewed-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

24 Feb, 2016

1 commit


23 Feb, 2016

1 commit

  • We have four different stack tracers of which three had bugs. So it's
    time to merge them to a single stack tracer which allows to specify a
    call back function which will be called for each step.

    This patch changes behavior a bit:

    - the "nosched" and "in_sched_functions" check within
    save_stack_trace_tsk did work only for the last stack frame within a
    context. Now it considers the check for each stack frame like it
    should.

    - both the oprofile variant and the perf_events variant did save a
    return address twice if a zero back chain was detected, which
    indicates an interrupt frame. The new dump_trace function will call
    the oprofile and perf_events backends with the psw address that is
    contained within the corresponding pt_regs structure instead.

    - the original show_trace and save_context_stack functions did already
    use the psw address of the pt_regs structure if a zero back chain
    was detected. However now we ignore the psw address if it is a user
    space address. After all we trace the kernel stack and not the user
    space stack. This way we also get rid of the garbage user space
    address in case of warnings and / or panic call traces.

    So this should make life easier since now there is only one stack
    tracer left which we can break.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

10 Feb, 2016

1 commit

  • git commit dc7ee00d4771 ("s390: lowcore stack pointer offsets")
    introduced a regression in regard to s390_backtrace(). The stack
    pointer for the asynchronous stack in the lowcore now has an
    additional offset applied. This offset needs to be taken into account
    in the calculation for the low and high address for the stack.

    This bug was already partially fixed with commit 9cc5c206d9b4
    ("s390/dumpstack: fix address ranges for asynchronous and panic
    stack"). This patch fixes it also for the oprofile code.

    Fixes: dc7ee00d4771 ("s390: lowcore stack pointer offsets")
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

19 Jan, 2016

1 commit

  • Yet another leftover from the 31 bit era. The usual operation
    "y = x & PSW_ADDR_INSN" with the PSW_ADDR_INSN mask is a nop for
    CONFIG_64BIT.

    Therefore remove all usages and hope the code is a bit less confusing.

    Signed-off-by: Heiko Carstens
    Reviewed-by: David Hildenbrand

    Heiko Carstens
     

01 Jul, 2015

1 commit

  • Fix these errors when compiling with CONFIG_OPROFILE=y and
    CONFIG_PERF_EVENTS=n:
    arch/s390/oprofile/init.c: In function ‘oprofile_hwsampler_start’:
    arch/s390/oprofile/init.c:93:2: error: implicit declaration of function 'perf_reserve_sampling' [-Werror=implicit-function-declaration]
    retval = perf_reserve_sampling();
    ^
    arch/s390/oprofile/init.c:99:3: error: implicit declaration of function 'perf_release_sampling' [-Werror=implicit-function-declaration]
    perf_release_sampling();
    ^

    Signed-off-by: Sebastian Ott
    Signed-off-by: Martin Schwidefsky

    Sebastian Ott
     

25 Mar, 2015

1 commit

  • Remove the 31 bit support in order to reduce maintenance cost and
    effectively remove dead code. Since a couple of years there is no
    distribution left that comes with a 31 bit kernel.

    The 31 bit kernel also has been broken since more than a year before
    anybody noticed. In addition I added a removal warning to the kernel
    shown at ipl for 5 minutes: a960062e5826 ("s390: add 31 bit warning
    message") which let everybody know about the plan to remove 31 bit
    code. We didn't get any response.

    Given that the last 31 bit only machine was introduced in 1999 let's
    remove the code.
    Anybody with 31 bit user space code can still use the compat mode.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

27 Aug, 2014

1 commit

  • __get_cpu_var() is used for multiple purposes in the kernel source. One of
    them is address calculation via the form &__get_cpu_var(x). This calculates
    the address for the instance of the percpu variable of the current processor
    based on an offset.

    Other use cases are for storing and retrieving data from the current
    processors percpu area. __get_cpu_var() can be used as an lvalue when
    writing data or on the right side of an assignment.

    __get_cpu_var() is defined as :

    #define __get_cpu_var(var) (*this_cpu_ptr(&(var)))

    __get_cpu_var() always only does an address determination. However, store
    and retrieve operations could use a segment prefix (or global register on
    other platforms) to avoid the address calculation.

    this_cpu_write() and this_cpu_read() can directly take an offset into a
    percpu area and use optimized assembly code to read and write per cpu
    variables.

    This patch converts __get_cpu_var into either an explicit address
    calculation using this_cpu_ptr() or into a use of this_cpu operations that
    use the offset. Thereby address calculations are avoided and less registers
    are used when code is generated.

    At the end of the patch set all uses of __get_cpu_var have been removed so
    the macro is removed too.

    The patch set includes passes over all arches as well. Once these operations
    are used throughout then specialized macros can be defined in non -x86
    arches as well in order to optimize per cpu access by f.e. using a global
    register that may be set to the per cpu base.

    Transformations done to __get_cpu_var()

    1. Determine the address of the percpu instance of the current processor.

    DEFINE_PER_CPU(int, y);
    int *x = &__get_cpu_var(y);

    Converts to

    int *x = this_cpu_ptr(&y);

    2. Same as #1 but this time an array structure is involved.

    DEFINE_PER_CPU(int, y[20]);
    int *x = __get_cpu_var(y);

    Converts to

    int *x = this_cpu_ptr(y);

    3. Retrieve the content of the current processors instance of a per cpu
    variable.

    DEFINE_PER_CPU(int, y);
    int x = __get_cpu_var(y)

    Converts to

    int x = __this_cpu_read(y);

    4. Retrieve the content of a percpu struct

    DEFINE_PER_CPU(struct mystruct, y);
    struct mystruct x = __get_cpu_var(y);

    Converts to

    memcpy(&x, this_cpu_ptr(&y), sizeof(x));

    5. Assignment to a per cpu variable

    DEFINE_PER_CPU(int, y)
    __get_cpu_var(y) = x;

    Converts to

    this_cpu_write(y, x);

    6. Increment/Decrement etc of a per cpu variable

    DEFINE_PER_CPU(int, y);
    __get_cpu_var(y)++

    Converts to

    this_cpu_inc(y)

    Cc: Martin Schwidefsky
    CC: linux390@de.ibm.com
    Acked-by: Heiko Carstens
    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo

    Christoph Lameter
     

27 May, 2014

1 commit

  • Delete unnecessary local variable whose value is always 0 and that hides
    the fact that the result is always 0.

    A simplified version of the semantic patch that fixes this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r exists@
    local idexpression ret;
    expression e;
    position p;
    @@

    -ret = 0;
    ... when != ret = e
    return
    - ret
    + 0
    ;
    //

    [heiko.carstens: turn prepare_cpu_buffers into a void returning function]
    Signed-off-by: Julia Lawall
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Julia Lawall
     

03 Apr, 2014

1 commit

  • Use the new defines for external interruption codes to get rid
    of "magic" numbers in the s390 source code. And while we're at it,
    also rename the (un-)register_external_interrupt function to
    something shorter so that this patch does not exceed the 80
    columns all over the place.

    Signed-off-by: Thomas Huth
    Signed-off-by: Martin Schwidefsky

    Thomas Huth
     

16 Dec, 2013

3 commits

  • Also support the diagnostic-sampling function in addition to the basic-sampling
    function. Diagnostic-sampling data entries contain hardware model specific
    sampling data and additional programs are required to analyze the data.

    To deliver diagnostic-sampling, as well, as basis-sampling data entries to user
    space, introduce support for sampling "raw data". If this particular perf
    sampling type (PERF_SAMPLE_RAW) is used, sampling data entries are copied
    to user space. External programs can then analyze these data.

    Signed-off-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Hendrik Brueckner
     
  • Introduce reserve/release functions to share the sampling facility
    between perf and oprofile.
    Also improve error handling for the sampling facility support in perf.

    Signed-off-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Hendrik Brueckner
     
  • Extract and move the oprofile hwsampler data structures and interfaces to
    the cpu_mf.h header file which contains common interface definitions
    for the various CPU-measurement facilities. This change is necessary for
    a new perf PMU.

    Few interface names have been revised to fit to the latest CPU-measurement
    facilities documentation. Also declare the data structures as __packed and
    correct checkpatch findings.

    Signed-off-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Hendrik Brueckner
     

11 Sep, 2013

1 commit

  • Pull more s390 updates from Heiko Carstens:
    "This includes one bpf/jit bug fix where the jit compiler could
    sometimes write generated code out of bounds of the allocated memory
    area.

    The rest of the patches are only cleanups and minor improvements"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/irq: reduce size of external interrupt handler hash array
    s390/compat,uid16: use current_cred()
    s390/ap_bus: use and-mask instead of a cast
    s390/ftrace: avoid pointer arithmetics with function pointers
    s390: make various functions static, add declarations to header files
    s390/compat signal: add couple of __force annotations
    s390/mm: add __releases()/__acquires() annotations to gmap_alloc_table()
    s390: keep Kconfig sorted
    s390/irq: rework irq subclass handling
    s390/irq: use hlists for external interrupt handler array
    s390/dumpstack: convert print_symbol to %pSR
    s390/perf: Remove print_hex_dump_bytes() debug output
    s390: update defconfig
    s390/bpf,jit: fix address randomization

    Linus Torvalds
     

04 Sep, 2013

4 commits


26 Jul, 2013

1 commit


01 Jul, 2013

1 commit


06 Apr, 2013

1 commit


08 Jan, 2013

1 commit

  • Now that irq sum accounting for /proc/stat's "intr" line works again we
    have the oddity that the sum field (first field) contains only the sum
    of the second (external irqs) and third field (I/O interrupts).
    The reason for that is that these two fields are already sums of all other
    fields. So if we would sum up everything we would count every interrupt
    twice.
    This is broken since the split interrupt accounting was merged two years
    ago: 052ff461c8427629aee887ccc27478fc7373237c "[S390] irq: have detailed
    statistics for interrupt types".
    To fix this remove the split interrupt fields from /proc/stat's "intr"
    line again and only have them in /proc/interrupts.

    This restores the old behaviour, seems to be the only sane fix and mimics
    a behaviour from other architectures where /proc/interrupts also contains
    more than /proc/stat's "intr" line does.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

27 Aug, 2012

1 commit


30 Jul, 2012

1 commit


20 Jul, 2012

1 commit

  • Remove the file name from the comment at top of many files. In most
    cases the file name was wrong anyway, so it's rather pointless.

    Also unify the IBM copyright statement. We did have a lot of sightly
    different statements and wanted to change them one after another
    whenever a file gets touched. However that never happened. Instead
    people start to take the old/"wrong" statements to use as a template
    for new files.
    So unify all of them in one go.

    Signed-off-by: Heiko Carstens

    Heiko Carstens
     

23 May, 2012

1 commit


29 Mar, 2012

2 commits

  • …m/linux/kernel/git/dhowells/linux-asm_system

    Pull "Disintegrate and delete asm/system.h" from David Howells:
    "Here are a bunch of patches to disintegrate asm/system.h into a set of
    separate bits to relieve the problem of circular inclusion
    dependencies.

    I've built all the working defconfigs from all the arches that I can
    and made sure that they don't break.

    The reason for these patches is that I recently encountered a circular
    dependency problem that came about when I produced some patches to
    optimise get_order() by rewriting it to use ilog2().

    This uses bitops - and on the SH arch asm/bitops.h drags in
    asm-generic/get_order.h by a circuituous route involving asm/system.h.

    The main difficulty seems to be asm/system.h. It holds a number of
    low level bits with no/few dependencies that are commonly used (eg.
    memory barriers) and a number of bits with more dependencies that
    aren't used in many places (eg. switch_to()).

    These patches break asm/system.h up into the following core pieces:

    (1) asm/barrier.h

    Move memory barriers here. This already done for MIPS and Alpha.

    (2) asm/switch_to.h

    Move switch_to() and related stuff here.

    (3) asm/exec.h

    Move arch_align_stack() here. Other process execution related bits
    could perhaps go here from asm/processor.h.

    (4) asm/cmpxchg.h

    Move xchg() and cmpxchg() here as they're full word atomic ops and
    frequently used by atomic_xchg() and atomic_cmpxchg().

    (5) asm/bug.h

    Move die() and related bits.

    (6) asm/auxvec.h

    Move AT_VECTOR_SIZE_ARCH here.

    Other arch headers are created as needed on a per-arch basis."

    Fixed up some conflicts from other header file cleanups and moving code
    around that has happened in the meantime, so David's testing is somewhat
    weakened by that. We'll find out anything that got broken and fix it..

    * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits)
    Delete all instances of asm/system.h
    Remove all #inclusions of asm/system.h
    Add #includes needed to permit the removal of asm/system.h
    Move all declarations of free_initmem() to linux/mm.h
    Disintegrate asm/system.h for OpenRISC
    Split arch_align_stack() out from asm-generic/system.h
    Split the switch_to() wrapper out of asm-generic/system.h
    Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
    Create asm-generic/barrier.h
    Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h
    Disintegrate asm/system.h for Xtensa
    Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]
    Disintegrate asm/system.h for Tile
    Disintegrate asm/system.h for Sparc
    Disintegrate asm/system.h for SH
    Disintegrate asm/system.h for Score
    Disintegrate asm/system.h for S390
    Disintegrate asm/system.h for PowerPC
    Disintegrate asm/system.h for PA-RISC
    Disintegrate asm/system.h for MN10300
    ...

    Linus Torvalds
     
  • Disintegrate asm/system.h for S390.

    Signed-off-by: David Howells
    cc: linux-s390@vger.kernel.org

    David Howells
     

23 Mar, 2012

1 commit

  • Prepare the measurement facility which is currently only used by oprofile
    for multiple users. To achieve that the measurement alert interrupt control
    bit needs to be protected. The measurement alert definitions are moved
    to a header file and an interrupt mask is added so that users can discard
    interrupts if they are for a different measurement subsystem.

    Reviewed-by: Hendrik Brueckner
    Signed-off-by: Jan Glauber
    Signed-off-by: Martin Schwidefsky

    Jan Glauber
     

11 Mar, 2012

1 commit

  • The external interrupt handlers have a parameter called ext_int_code.
    Besides the name this paramter does not only contain the ext_int_code
    but in addition also the "cpu address" (POP) which caused the external
    interrupt.
    To make the code a bit more obvious pass a struct instead so the called
    function can easily distinguish between external interrupt code and
    cpu address. The cpu address field however is named "subcode" since
    some external interrupt sources do not pass a cpu address but a
    different parameter (or none at all).

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

07 Jan, 2012

1 commit

  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (106 commits)
    perf kvm: Fix copy & paste error in description
    perf script: Kill script_spec__delete
    perf top: Fix a memory leak
    perf stat: Introduce get_ratio_color() helper
    perf session: Remove impossible condition check
    perf tools: Fix feature-bits rework fallout, remove unused variable
    perf script: Add generic perl handler to process events
    perf tools: Use for_each_set_bit() to iterate over feature flags
    perf tools: Unify handling of features when writing feature section
    perf report: Accept fifos as input file
    perf tools: Moving code in some files
    perf tools: Fix out-of-bound access to struct perf_session
    perf tools: Continue processing header on unknown features
    perf tools: Improve macros for struct feature_ops
    perf: builtin-record: Document and check that mmap_pages must be a power of two.
    perf: builtin-record: Provide advice if mmap'ing fails with EPERM.
    perf tools: Fix truncated annotation
    perf script: look up thread using tid instead of pid
    perf tools: Look up thread names for system wide profiling
    perf tools: Fix comm for processes with named threads
    ...

    Linus Torvalds
     

20 Dec, 2011

2 commits


07 Dec, 2011

2 commits

  • With this patch the OProfile Basic Mode Sampling support for System z
    is enhanced with a counter file system. That way hardware sampling
    can be configured using the user space tools with only little
    modifications.

    With the patch by default new cpu_types (s390/z10, s390/z196) are
    returned in order to indicate that we are running a CPU which provides
    the hardware sampling facility. Existing user space tools will
    complain about an unknown cpu type. In order to be compatible with
    existing user space tools the `cpu_type' module parameter has been
    added. Setting the parameter to `timer' will force the module to
    return `timer' as cpu_type. The module will still try to use hardware
    sampling if available and the hwsampling virtual filesystem will be
    also be available for configuration. So this has a different effect
    than using the generic oprofile module parameter `timer=1'.

    If the basic mode sampling is enabled on the machine and the
    cpu_type=timer parameter is not used the kernel module will provide
    the following virtual filesystem:

    /dev/oprofile/0/enabled
    /dev/oprofile/0/event
    /dev/oprofile/0/count
    /dev/oprofile/0/unit_mask
    /dev/oprofile/0/kernel
    /dev/oprofile/0/user

    In the counter file system only the values of 'enabled', 'count',
    'kernel', and 'user' are evaluated by the kernel module. Everything
    else must contain fixed values.

    The 'event' value only supports a single event - HWSAMPLING with value
    0.

    The 'count' value specifies the hardware sampling rate as it is passed
    to the CPU measurement facility.

    The 'kernel' and 'user' flags can now be used to filter for samples
    when using hardware sampling.

    Additionally also the following file will be created:
    /dev/oprofile/timer/enabled

    This will always be the inverted value of /dev/oprofile/0/enabled. 0
    is not accepted without hardware sampling.

    Signed-off-by: Andreas Krebbel
    Signed-off-by: Robert Richter

    Andreas Krebbel
     
  • Removing remainings of oprofile_timer_exit() completly.

    Signed-off-by: Robert Richter

    Robert Richter
     

30 Oct, 2011

1 commit


11 Jul, 2011

1 commit