linux-stable/arch/x86/platform
Linus Torvalds 683ad8092c x86/efi: Fix 7-parameter efi_call()s
Alex Thorlton reported that the SGI/UV code crashes in the efi_call()
code when invoked with 7 parameters, due to:

        mov (%rsp), %rax
        mov 8(%rax), %rax
        ...
        mov %rax, 40(%rsp)

Offset 8 is only true if CONFIG_FRAME_POINTERS is disabled,
with frame pointers enabled it should be 16.

Furthermore, the SAVE_XMM code saves the old stack pointer, but
that's just crazy. It saves the stack pointer *AFTER* we've done
the:

        FRAME_BEGIN

... which will have *changed* the stack pointer, depending on whether
stack frames are enabled or not.

So when the code then does:

        mov (%rsp), %rax

... we now move that old stack pointer into %rax, but the offset off that
stack pointer will depend on whether that FRAME_BEGIN saved off %rbp
or not.

So that whole 8-vs-16 offset confusion depends on the frame pointer!
If frame pointers were enabled, it will be 16. If they weren't, it
will be 8.

The right fix is to just get rid of that silly conditional frame
pointer thing, and always use frame pointers in this stub function.
And then we don't need that (odd) load to get the old stack
pointer into %rax - we can just use the frame pointer.

Reported-by: Alex Thorlton <athorlton@sgi.com>
Tested-by: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/CA%2B55aFzBS2v%3DWnEH83cUDg7XkOremFqJ30BJwF40dCYjReBkUQ@mail.gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-05-17 08:25:06 +02:00
..
atom x86/platform/iosf_mbi: Remove duplicate definitions 2015-12-09 01:18:34 +01:00
ce4100 x86: ce4100, irq: Do not set legacy_pic to null_legacy_pic 2014-06-21 23:05:42 +02:00
efi x86/efi: Fix 7-parameter efi_call()s 2016-05-17 08:25:06 +02:00
geode x86/platform: Make platform/geode/net5501.c explicitly non-modular 2016-02-16 09:11:09 +01:00
goldfish goldfish: platform device for x86 2013-01-21 12:09:19 -08:00
intel x86/platform/iosf_mbi: Add Intel Tangier PCI id 2015-07-16 17:48:48 +02:00
intel-mid Merge branch 'x86/cleanups' into x86/urgent 2016-03-17 09:44:57 +01:00
intel-quark x86/platform/intel/quark: Drop IMR lock bit support 2016-02-23 07:37:23 +01:00
iris x86: platform: iris: drop owner assignment from platform_drivers 2014-10-20 16:20:15 +02:00
olpc x86/olpc/xo15/sci: Use newly added power_supply_put API 2015-03-13 23:15:53 +01:00
scx200 X86: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
sfi x86: Cleanup irq_domain ops 2015-04-24 15:36:55 +02:00
ts5500 x86/platform/ts5500: Add support for TS-5400 boards 2014-07-16 21:17:42 +02:00
uv x86/platform/uv: Include clocksource.h for clocksource_touch_watchdog() 2015-12-11 09:04:04 +01:00
Makefile x86/platform/iosf_mbi: Move to dedicated folder 2015-07-16 17:48:47 +02:00