Commit 1b2b23d8 authored by Tao Guo's avatar Tao Guo Committed by Ingo Molnar

x86_64: Work around old GAS bug

GAS in binutils(2.16.91) could not parse parentheses within
macro parameters unless fully parenthesized, and this is a
workaround to make old gas work without generating below errors:

 arch/x86/kernel/entry_64.S: Assembler messages:
 arch/x86/kernel/entry_64.S:387: Error: too many positional arguments
 arch/x86/kernel/entry_64.S:389: Error: too many positional arguments
 [...]
Signed-off-by: default avatarTao Guo <glorioustao@gmail.com>
Reluctantly-Acked-by: default avatarJan Beulich <jbeulich@novell.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1348648102-12653-1-git-send-email-glorioustao@gmail.com
[ Jan argues that these old GAS versions are fragile - which is so, but lets give them a chance. ]
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent e26a44a2
...@@ -49,38 +49,36 @@ For 32-bit we have the following conventions - kernel is built with ...@@ -49,38 +49,36 @@ For 32-bit we have the following conventions - kernel is built with
#include "dwarf2.h" #include "dwarf2.h"
/* /*
* 64-bit system call stack frame layout defines and helpers, for * 64-bit system call stack frame layout defines and helpers,
* assembly code (note that the seemingly unnecessary parentheses * for assembly code:
* are to prevent cpp from inserting spaces in expressions that get
* passed to macros):
*/ */
#define R15 (0) #define R15 0
#define R14 (8) #define R14 8
#define R13 (16) #define R13 16
#define R12 (24) #define R12 24
#define RBP (32) #define RBP 32
#define RBX (40) #define RBX 40
/* arguments: interrupts/non tracing syscalls only save up to here: */ /* arguments: interrupts/non tracing syscalls only save up to here: */
#define R11 (48) #define R11 48
#define R10 (56) #define R10 56
#define R9 (64) #define R9 64
#define R8 (72) #define R8 72
#define RAX (80) #define RAX 80
#define RCX (88) #define RCX 88
#define RDX (96) #define RDX 96
#define RSI (104) #define RSI 104
#define RDI (112) #define RDI 112
#define ORIG_RAX (120) /* + error_code */ #define ORIG_RAX 120 /* + error_code */
/* end of arguments */ /* end of arguments */
/* cpu exception frame or undefined in case of fast syscall: */ /* cpu exception frame or undefined in case of fast syscall: */
#define RIP (128) #define RIP 128
#define CS (136) #define CS 136
#define EFLAGS (144) #define EFLAGS 144
#define RSP (152) #define RSP 152
#define SS (160) #define SS 160
#define ARGOFFSET R11 #define ARGOFFSET R11
#define SWFRAME ORIG_RAX #define SWFRAME ORIG_RAX
......
...@@ -342,15 +342,15 @@ ENDPROC(native_usergs_sysret64) ...@@ -342,15 +342,15 @@ ENDPROC(native_usergs_sysret64)
.macro SAVE_ARGS_IRQ .macro SAVE_ARGS_IRQ
cld cld
/* start from rbp in pt_regs and jump over */ /* start from rbp in pt_regs and jump over */
movq_cfi rdi, RDI-RBP movq_cfi rdi, (RDI-RBP)
movq_cfi rsi, RSI-RBP movq_cfi rsi, (RSI-RBP)
movq_cfi rdx, RDX-RBP movq_cfi rdx, (RDX-RBP)
movq_cfi rcx, RCX-RBP movq_cfi rcx, (RCX-RBP)
movq_cfi rax, RAX-RBP movq_cfi rax, (RAX-RBP)
movq_cfi r8, R8-RBP movq_cfi r8, (R8-RBP)
movq_cfi r9, R9-RBP movq_cfi r9, (R9-RBP)
movq_cfi r10, R10-RBP movq_cfi r10, (R10-RBP)
movq_cfi r11, R11-RBP movq_cfi r11, (R11-RBP)
/* Save rbp so that we can unwind from get_irq_regs() */ /* Save rbp so that we can unwind from get_irq_regs() */
movq_cfi rbp, 0 movq_cfi rbp, 0
...@@ -384,7 +384,7 @@ ENDPROC(native_usergs_sysret64) ...@@ -384,7 +384,7 @@ ENDPROC(native_usergs_sysret64)
.endm .endm
ENTRY(save_rest) ENTRY(save_rest)
PARTIAL_FRAME 1 REST_SKIP+8 PARTIAL_FRAME 1 (REST_SKIP+8)
movq 5*8+16(%rsp), %r11 /* save return address */ movq 5*8+16(%rsp), %r11 /* save return address */
movq_cfi rbx, RBX+16 movq_cfi rbx, RBX+16
movq_cfi rbp, RBP+16 movq_cfi rbp, RBP+16
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment