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
     

26 Sep, 2017

1 commit

  • Rename this function to better express that it's all about
    initializing the FPU state of a task which goes hand in hand
    with the fpu::initialized field.

    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: Eric Biggers
    Cc: Fenghua Yu
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Rik van Riel
    Cc: Thomas Gleixner
    Cc: Yu-cheng Yu
    Link: http://lkml.kernel.org/r/20170923130016.21448-33-mingo@kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

05 Sep, 2017

1 commit

  • Pull x86 apic updates from Thomas Gleixner:
    "This update provides:

    - Cleanup of the IDT management including the removal of the extra
    tracing IDT. A first step to cleanup the vector management code.

    - The removal of the paravirt op adjust_exception_frame. This is a
    XEN specific issue, but merged through this branch to avoid nasty
    merge collisions

    - Prevent dmesg spam about the TSC DEADLINE bug, when the CPU has
    disabled the TSC DEADLINE timer in CPUID.

    - Adjust a debug message in the ioapic code to print out the
    information correctly"

    * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (51 commits)
    x86/idt: Fix the X86_TRAP_BP gate
    x86/xen: Get rid of paravirt op adjust_exception_frame
    x86/eisa: Add missing include
    x86/idt: Remove superfluous ALIGNment
    x86/apic: Silence "FW_BUG TSC_DEADLINE disabled due to Errata" on CPUs without the feature
    x86/idt: Remove the tracing IDT leftovers
    x86/idt: Hide set_intr_gate()
    x86/idt: Simplify alloc_intr_gate()
    x86/idt: Deinline setup functions
    x86/idt: Remove unused functions/inlines
    x86/idt: Move interrupt gate initialization to IDT code
    x86/idt: Move APIC gate initialization to tables
    x86/idt: Move regular trap init to tables
    x86/idt: Move IST stack based traps to table init
    x86/idt: Move debug stack init to table based
    x86/idt: Switch early trap init to IDT tables
    x86/idt: Prepare for table based init
    x86/idt: Move early IDT setup out of 32-bit asm
    x86/idt: Move early IDT handler setup to IDT code
    x86/idt: Consolidate IDT invalidation
    ...

    Linus Torvalds
     

29 Aug, 2017

3 commits

  • Functions in math-emu are annotated as ENTRY() symbols, but their
    ends are not annotated at all. But these are standard functions
    called from C, with proper stack register update etc.

    Omitting the ends means:

    * the annotations are not paired and we cannot deal with such functions
    e.g. in objtool

    * the symbols are not marked as functions in the object file

    * there are no sizes of the functions in the object file

    So fix this by adding ENDPROC() to each such case in math-emu.

    Signed-off-by: Jiri Slaby
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20170824080624.7768-1-jslaby@suse.cz
    Signed-off-by: Ingo Molnar

    Jiri Slaby
     
  • The GDT entry related code uses two ways to access entries via
    union fields:

    - bitfields

    - macros which initialize the two 16-bit parts of the entry
    by magic shift and mask operations.

    Clean it up and only use the bitfields to initialize and access entries.

    ( The old access patterns were partly done due to GCC optimizing bitfield
    accesses in a horrible way - that's mostly fixed these days and clarity
    of code in such low level accessors is very important. )

    Signed-off-by: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20170828064958.197673367@linutronix.de
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • desc_struct is a union of u32 fields and bitfields. The access to the u32
    fields is done with magic macros.

    Convert it to use the bitfields and replace the macro magic with parseable
    inline functions.

    Signed-off-by: Thomas Gleixner
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20170828064958.042406718@linutronix.de
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

20 Jul, 2017

2 commits

  • gcc-7.1.1 produces this warning:

    arch/x86/math-emu/reg_add_sub.c: In function 'FPU_add':
    arch/x86/math-emu/reg_add_sub.c:80:48: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context]

    This appears to be a bug in gcc-7.1.1, and I have reported it as
    PR81484. The compiler suggests that code written as

    if (a & b ? c : d)

    is usually incorrect and should have been

    if (a & (b ? c : d))

    However, in this case, we correctly write

    if ((a & b) ? c : d)

    and should not get a warning for it.

    This adds a dirty workaround for the problem, adding a comparison with
    zero inside of the macro. The warning is currently disabled in the kernel,
    so we may decide not to apply the patch, and instead wait for future gcc
    releases to fix the problem. On the other hand, it seems to be the
    only instance of this particular problem.

    Signed-off-by: Arnd Bergmann
    Cc: Bill Metzenthen
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20170719125310.2487451-4-arnd@arndb.de
    Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81484
    Signed-off-by: Ingo Molnar

    Arnd Bergmann
     
  • When building the kernel with "make EXTRA_CFLAGS=...", this overrides
    the "PARANOID" preprocessor macro defined in arch/x86/math-emu/Makefile,
    and we run into a build warning:

    arch/x86/math-emu/reg_compare.c: In function ‘compare_i_st_st’:
    arch/x86/math-emu/reg_compare.c:254:6: error: ‘f’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

    This fixes the implementation to work correctly even without the PARANOID
    flag, and also fixes the Makefile to not use the EXTRA_CFLAGS variable
    but instead use the ccflags-y variable in the Makefile that is meant
    for this purpose.

    Signed-off-by: Arnd Bergmann
    Cc: Bill Metzenthen
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20170719125310.2487451-3-arnd@arndb.de
    Signed-off-by: Ingo Molnar

    Arnd Bergmann
     

08 Jun, 2017

1 commit

  • ... because this is exactly what it is: the number of entries in the
    LDT. Calling it "size" is simply confusing and it is actually begging
    to be called "nr_entries" or somesuch, especially if you see constructs
    like:

    alloc_size = size * LDT_ENTRY_SIZE;

    since LDT_ENTRY_SIZE is the size of a single entry.

    There should be no functionality change resulting from this patch, as
    the before/after output from tools/testing/selftests/x86/ldt_gdt.c
    shows.

    Signed-off-by: Borislav Petkov
    Acked-by: Andy Lutomirski
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20170606173116.13977-1-bp@alien8.de
    [ Renamed 'n_entries' to 'nr_entries' ]
    Signed-off-by: Ingo Molnar

    Borislav Petkov
     

25 Dec, 2016

1 commit


04 Nov, 2015

1 commit

  • Pull x86 sigcontext header cleanups from Ingo Molnar:
    "This series reorganizes and cleans up various aspects of the main
    sigcontext UAPI headers, such as unifying the data structures and
    updating/adding lots of comments to explain all the ABI details and
    quirks. The headers can now also be built in user-space standalone"

    * 'x86-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/headers: Clean up too long lines
    x86/headers: Remove references on the kernel side
    x86/headers: Remove direct sigcontext32.h uses
    x86/headers: Convert sigcontext_ia32 uses to sigcontext_32
    x86/headers: Unify 'struct sigcontext_ia32' and 'struct sigcontext_32'
    x86/headers: Make sigcontext pointers bit independent
    x86/headers: Move the 'struct sigcontext' definitions into the UAPI header
    x86/headers: Clean up the kernel's struct sigcontext types to be ABI-clean
    x86/headers: Convert uses of _fpstate_ia32 to _fpstate_32
    x86/headers: Unify 'struct _fpstate_ia32' and i386 struct _fpstate
    x86/headers: Unify register type definitions between 32-bit compat and i386
    x86/headers: Use ABI types consistently in sigcontext*.h
    x86/headers: Separate out legacy user-space structure definitions
    x86/headers: Clean up and better document uapi/asm/sigcontext.h
    x86/headers: Clean up uapi/asm/sigcontext32.h
    x86/headers: Fix (old) header file dependency bug in uapi/asm/sigcontext32.h

    Linus Torvalds
     

20 Sep, 2015

4 commits

  • These FPU instructions were added in SSE3-enabled CPUs.

    Run-tested by booting with "no387 nofxsr" and running test
    program:

    [RUN] Testing fisttp instructions
    [OK] fisttp

    Signed-off-by: Denys Vlasenko
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: H. Peter Anvin
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Link: http://lkml.kernel.org/r/1442600614-28428-1-git-send-email-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     
  • Run-tested by booting with "no387 nofxsr" and running test
    program:

    [RUN] Testing fcmovCC instructions
    [OK] fcmovCC

    Signed-off-by: Denys Vlasenko
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: H. Peter Anvin
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Link: http://lkml.kernel.org/r/1442588010-20055-3-git-send-email-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     
  • Run-tested by booting with "no387 nofxsr" and running test
    program:

    [RUN] Testing f[u]comi[p] instructions

    [OK] f[u]comi[p]

    Signed-off-by: Denys Vlasenko
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: H. Peter Anvin
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Link: http://lkml.kernel.org/r/1442588010-20055-2-git-send-email-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     
  • No code changes.

    Signed-off-by: Denys Vlasenko
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: H. Peter Anvin
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Link: http://lkml.kernel.org/r/1442588010-20055-1-git-send-email-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     

15 Sep, 2015

1 commit

  • We always want to support all FPU opcodes, including
    undocumented ones. That define was fully justified ~20 years ago
    but not today. Let's not complicate the code with it.

    Signed-off-by: Denys Vlasenko
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: H. Peter Anvin
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1440699330-1305-1-git-send-email-dvlasenk@redhat.com
    Signed-off-by: Ingo Molnar

    Denys Vlasenko
     

08 Sep, 2015

1 commit

  • Now that all type definitions are in the UAPI header, include it
    directly, instead of through .

    [ We still keep asm/sigcontext.h, so that uapi/asm/sigcontext32.h
    can include . ]

    Acked-by: Mikko Rapeli
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Link: http://lkml.kernel.org/r/1441438363-9999-16-git-send-email-mingo@kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

18 Aug, 2015

1 commit


17 Aug, 2015

1 commit

  • The previous fix confused a selector with a segment prefix. Fix it.

    Compile-tested only.

    Cc: stable@vger.kernel.org
    Cc: Juergen Gross
    Reported-by: Linus Torvalds
    Fixes: 4809146b86c3 ("x86/ldt: Correct FPU emulation access to LDT")
    Signed-off-by: Andy Lutomirski
    Signed-off-by: Linus Torvalds

    Andy Lutomirski
     

08 Aug, 2015

1 commit

  • Commit 37868fe113ff ("x86/ldt: Make modify_ldt synchronous")
    introduced a new struct ldt_struct anchored at mm->context.ldt.

    Adapt the x86 fpu emulation code to use that new structure.

    Signed-off-by: Juergen Gross
    Reviewed-by: Andy Lutomirski
    Cc: # On top of: 37868fe113ff: x86/ldt: Make modify_ldt synchronous
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: billm@melbpc.org.au
    Link: http://lkml.kernel.org/r/1438883674-1240-1-git-send-email-jgross@suse.com
    Signed-off-by: Ingo Molnar

    Juergen Gross
     

31 Jul, 2015

1 commit

  • vm86.h was being implicitly included in alot of places via
    processor.h, which in turn got it from math_emu.h. Break that
    chain and explicitly include vm86.h in all files that need it.
    Also remove unused vm86 field from math_emu_info.

    Signed-off-by: Brian Gerst
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1438148483-11932-7-git-send-email-brgerst@gmail.com
    [ Fixed build failure. ]
    Signed-off-by: Ingo Molnar

    Brian Gerst
     

19 May, 2015

12 commits

  • Use these consistent names:

    struct fregs_state # was: i387_fsave_struct
    struct fxregs_state # was: i387_fxsave_struct
    struct swregs_state # was: i387_soft_struct
    struct xregs_state # was: xsave_struct
    union fpregs_state # was: thread_xstate

    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Harmonize the inconsistent naming of these related functions:

    fpstate_init()
    finit_soft_fpu() => fpstate_init_fsoft()
    fx_finit() => fpstate_init_fxstate()
    fx_finit() => fpstate_init_fstate() # split out

    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Now that fpstate_init_curr() is not doing implicit allocations
    anymore, almost all uses of it involve a very simple pattern:

    if (!fpu->fpstate_active)
    fpstate_init_curr(fpu);

    which is basically activating the FPU fpstate if it was not active
    before.

    So propagate the check into the function itself, and rename the
    function according to its new purpose:

    fpu__activate_curr(fpu);

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Now that there are no FPU context allocations, rename fpstate_alloc_init()
    to fpstate_init_curr(), to signal that it initializes the fpstate and
    marks it active, for the current task.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Remove the failure code and propagate this down to callers.

    Note that this function still has an 'init' aspect, which must be
    called.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • So 6 years ago we made the FPU fpstate dynamically allocated:

    aa283f49276e ("x86, fpu: lazy allocation of FPU area - v5")
    61c4628b5386 ("x86, fpu: split FPU state from task struct - v5")

    In hindsight this was a mistake:

    - it complicated context allocation failure handling, such as:

    /* kthread execs. TODO: cleanup this horror. */
    if (WARN_ON(fpstate_alloc_init(fpu)))
    force_sig(SIGKILL, tsk);

    - it caused us to enable irqs in fpu__restore():

    local_irq_enable();
    /*
    * does a slab alloc which can sleep
    */
    if (fpstate_alloc_init(fpu)) {
    /*
    * ran out of memory!
    */
    do_group_exit(SIGKILL);
    return;
    }
    local_irq_disable();

    - it (slightly) slowed down task creation/destruction by adding
    slab allocation/free pattens.

    - it made access to context contents (slightly) slower by adding
    one more pointer dereference.

    The motivation for the dynamic allocation was two-fold:

    - reduce memory consumption by non-FPU tasks

    - allocate and handle only the necessary amount of context for
    various XSAVE processors that have varying hardware frame
    sizes.

    These days, with glibc using SSE memcpy by default and GCC optimizing
    for SSE/AVX by default, the scope of FPU using apps on an x86 system is
    much larger than it was 6 years ago.

    For example on a freshly installed Fedora 21 desktop system, with a
    recent kernel, all non-kthread tasks have used the FPU shortly after
    bootup.

    Also, even modern embedded x86 CPUs try to support the latest vector
    instruction set - so they'll too often use the larger xstate frame
    sizes.

    So remove the dynamic allocation complication by embedding the FPU
    fpstate in task_struct again. This should make the FPU a lot more
    accessible to all sorts of atomic contexts.

    We could still optimize for the xstate frame size in the future,
    by moving the state structure to the last element of task_struct,
    and allocating only a part of that.

    This change is kept minimal by still keeping the ctx_alloc()/free()
    routines (that now do nothing substantial) - we'll remove them in
    the following patches.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • There are a number of FPU internal function prototypes and an inline function
    in fpu/api.h, mostly placed so historically as the code grew over the years.

    Move them over into fpu/internal.h where they belong. (Add sched.h include
    to stackprotector.h which incorrectly relied on getting it from fpu/api.h.)

    fpu/api.h is now a pure file that only contains FPU APIs intended for driver
    use.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • We already have fpu/types.h, move i387.h to fpu/api.h.

    The file name has become a misnomer anyway: it offers generic FPU APIs,
    but is not limited to i387 functionality.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Migrate this function to pure 'struct fpu' usage.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Introduce a simple fpu->fpstate_active flag in the fpu context data structure
    and use that instead of PF_USED_MATH in task->flags.

    Testing for this flag byte should be slightly more efficient than
    testing a bit in a bitmask, but the main advantage is that most
    FPU functions can now be performed on a 'struct fpu' alone, they
    don't need access to 'struct task_struct' anymore.

    There's a slight linecount increase, mostly due to the 'fpu' local
    variables and due to extra comments. The local variables will go away
    once we move most of the FPU methods to pure 'struct fpu' parameters.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • PF_USED_MATH is used directly, but also in a handful of helper inlines.

    To ease the elimination of PF_USED_MATH, convert all inline helpers
    to open-coded PF_USED_MATH usage.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Most init_fpu() users don't want the register-saving aspect of the
    function, they are calling it for 'current' and when FPU registers
    are not allocated and initialized yet.

    Split out a simplified API that does just that (and add debug-checks
    for these conditions): fpstate_alloc_init().

    Use it where appropriate.

    Reviewed-by: Borislav Petkov
    Cc: Andy Lutomirski
    Cc: Dave Hansen
    Cc: Fenghua Yu
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

06 May, 2014

1 commit


28 Jan, 2014

1 commit

  • The kernel already has this information, so other bits of kernel code
    shouldn't duplicate that. This also eliminates the use of __DATE__,
    which makes the build non-deterministic.

    This message was already disabled at build time, with PRINT_MESSAGES
    undef'd at the top of the file.

    Signed-off-by: Josh Triplett
    Signed-off-by: Michal Marek

    Josh Triplett
     

13 Mar, 2012

1 commit

  • There are precedences of trap number being referred to as
    trap_nr. However thread struct refers trap number as trap_no.
    Change it to trap_nr.

    Also use enum instead of left-over literals for trap values.

    This is pure cleanup, no functional change intended.

    Suggested-by: Ingo Molnar
    Signed-off-by: Srikar Dronamraju
    Cc: Linus Torvalds
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Linux-mm
    Cc: Oleg Nesterov
    Cc: Andi Kleen
    Cc: Christoph Hellwig
    Cc: Steven Rostedt
    Cc: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20120312092555.5379.942.sendpatchset@srdronam.in.ibm.com
    [ Fixed the math-emu build ]
    Signed-off-by: Ingo Molnar

    Srikar Dronamraju
     

11 May, 2010

2 commits

  • Unbreak FPU emulation, broken by checkin
    86603283326c9e95e5ad4e9fdddeec93cac5d9ad:
    x86: Introduce 'struct fpu' and related API

    Signed-off-by: H. Peter Anvin
    Cc: Avi Kivity
    Cc: Suresh Siddha
    LKML-Reference:

    H. Peter Anvin
     
  • Currently all fpu state access is through tsk->thread.xstate. Since we wish
    to generalize fpu access to non-task contexts, wrap the state in a new
    'struct fpu' and convert existing access to use an fpu API.

    Signal frame handlers are not converted to the API since they will remain
    task context only things.

    Signed-off-by: Avi Kivity
    Acked-by: Suresh Siddha
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Avi Kivity
     

28 Mar, 2009

1 commit


05 Mar, 2009

1 commit

  • Impact: fix math-emu related crash while using GDB/ptrace

    init_fpu() calls finit to initialize a task's xstate, while finit always
    works on the current task. If we use PTRACE_GETFPREGS on another
    process and both processes did not already use floating point, we get
    a null pointer exception in finit.

    This patch creates a new function finit_task that takes a task_struct
    parameter. finit becomes a wrapper that simply calls finit_task with
    current. On the plus side this avoids many calls to get_current which
    would each resolve to an inline assembler mov instruction.

    An empty finit_task has been added to i387.h to avoid linker errors in
    case the compiler still emits the call in init_fpu when
    CONFIG_MATH_EMULATION is not defined.

    The declaration of finit in i387.h has been removed as the remaining
    code using this function gets its prototype from fpu_proto.h.

    Signed-off-by: Daniel Glöckner
    Cc: Suresh Siddha
    Cc: "Pallipadi Venkatesh"
    Cc: Arjan van de Ven
    Cc: Bill Metzenthen
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Daniel Glöckner