ia32entry.S 13.2 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8
/*
 * Compatibility mode system call entry point for x86-64. 
 * 		
 * Copyright 2000-2002 Andi Kleen, SuSE Labs.
 */		 

#include <asm/dwarf2.h>
#include <asm/calling.h>
9
#include <asm/asm-offsets.h>
L
Linus Torvalds 已提交
10 11 12 13 14
#include <asm/current.h>
#include <asm/errno.h>
#include <asm/ia32_unistd.h>	
#include <asm/thread_info.h>	
#include <asm/segment.h>
15
#include <asm/irqflags.h>
16
#include <asm/asm.h>
L
Linus Torvalds 已提交
17
#include <linux/linkage.h>
18
#include <linux/err.h>
L
Linus Torvalds 已提交
19

20 21 22 23 24 25
/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
#include <linux/elf-em.h>
#define AUDIT_ARCH_I386		(EM_386|__AUDIT_ARCH_LE)
#define __AUDIT_ARCH_LE	   0x40000000

#ifndef CONFIG_AUDITSYSCALL
26 27
#define sysexit_audit ia32_ret_from_sys_call
#define sysretl_audit ia32_ret_from_sys_call
28 29
#endif

J
Jiri Olsa 已提交
30 31
	.section .entry.text, "ax"

L
Linus Torvalds 已提交
32 33 34 35 36 37 38 39 40 41 42 43
	.macro IA32_ARG_FIXUP noebp=0
	movl	%edi,%r8d
	.if \noebp
	.else
	movl	%ebp,%r9d
	.endif
	xchg	%ecx,%esi
	movl	%ebx,%edi
	movl	%edx,%edx	/* zero extension */
	.endm 

	/* clobbers %eax */	
44
	.macro  CLEAR_RREGS offset=0, _r9=rax
L
Linus Torvalds 已提交
45
	xorl 	%eax,%eax
46 47 48 49
	movq	%rax,\offset+R11(%rsp)
	movq	%rax,\offset+R10(%rsp)
	movq	%\_r9,\offset+R9(%rsp)
	movq	%rax,\offset+R8(%rsp)
L
Linus Torvalds 已提交
50 51
	.endm

52 53 54
	/*
	 * Reload arg registers from stack in case ptrace changed them.
	 * We don't reload %eax because syscall_trace_enter() returned
55 56 57 58 59 60
	 * the %rax value we should see.  Instead, we just truncate that
	 * value to 32 bits again as we did on entry from user mode.
	 * If it's a new value set by user_regset during entry tracing,
	 * this matches the normal truncation of the user-mode value.
	 * If it's -1 to make us punt the syscall, then (u32)-1 is still
	 * an appropriately invalid value.
61
	 */
62 63
	.macro LOAD_ARGS32 offset, _r9=0
	.if \_r9
64
	movl \offset+16(%rsp),%r9d
65
	.endif
66 67 68 69
	movl \offset+40(%rsp),%ecx
	movl \offset+48(%rsp),%edx
	movl \offset+56(%rsp),%esi
	movl \offset+64(%rsp),%edi
70
	movl %eax,%eax			/* zero extension */
71 72
	.endm
	
73 74 75 76 77 78 79 80 81 82 83 84
	.macro CFI_STARTPROC32 simple
	CFI_STARTPROC	\simple
	CFI_UNDEFINED	r8
	CFI_UNDEFINED	r9
	CFI_UNDEFINED	r10
	CFI_UNDEFINED	r11
	CFI_UNDEFINED	r12
	CFI_UNDEFINED	r13
	CFI_UNDEFINED	r14
	CFI_UNDEFINED	r15
	.endm

85 86 87 88 89 90 91 92 93 94 95 96 97
#ifdef CONFIG_PARAVIRT
ENTRY(native_usergs_sysret32)
	swapgs
	sysretl
ENDPROC(native_usergs_sysret32)

ENTRY(native_irq_enable_sysexit)
	swapgs
	sti
	sysexit
ENDPROC(native_irq_enable_sysexit)
#endif

L
Linus Torvalds 已提交
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
/*
 * 32bit SYSENTER instruction entry.
 *
 * Arguments:
 * %eax	System call number.
 * %ebx Arg1
 * %ecx Arg2
 * %edx Arg3
 * %esi Arg4
 * %edi Arg5
 * %ebp user stack
 * 0(%ebp) Arg6	
 * 	
 * Interrupts off.
 *	
 * This is purely a fast path. For anything complicated we use the int 0x80
 * path below.	Set up a complete hardware stack frame to share code
 * with the int 0x80 path.
 */ 	
ENTRY(ia32_sysenter_target)
118
	CFI_STARTPROC32	simple
119
	CFI_SIGNAL_FRAME
120 121
	CFI_DEF_CFA	rsp,0
	CFI_REGISTER	rsp,rbp
122
	SWAPGS_UNSAFE_STACK
123 124
	movq	PER_CPU_VAR(kernel_stack), %rsp
	addq	$(KERNEL_STACK_OFFSET),%rsp
125 126 127 128
	/*
	 * No need to follow this irqs on/off section: the syscall
	 * disabled irqs, here we enable it straight after entry:
	 */
129
	ENABLE_INTERRUPTS(CLBR_NONE)
L
Linus Torvalds 已提交
130
 	movl	%ebp,%ebp		/* zero extension */
131
	pushq_cfi $__USER32_DS
132
	/*CFI_REL_OFFSET ss,0*/
133
	pushq_cfi %rbp
134
	CFI_REL_OFFSET rsp,0
135
	pushfq_cfi
136
	/*CFI_REL_OFFSET rflags,0*/
137
	movl	TI_sysenter_return+THREAD_INFO(%rsp,3*8-KERNEL_STACK_OFFSET),%r10d
138
	CFI_REGISTER rip,r10
139
	pushq_cfi $__USER32_CS
140
	/*CFI_REL_OFFSET cs,0*/
L
Linus Torvalds 已提交
141
	movl	%eax, %eax
142
	pushq_cfi %r10
143
	CFI_REL_OFFSET rip,0
144
	pushq_cfi %rax
L
Linus Torvalds 已提交
145
	cld
146
	SAVE_ARGS 0,1,0
L
Linus Torvalds 已提交
147 148
 	/* no need to do an access_ok check here because rbp has been
 	   32bit zero extended */ 
149
1:	movl	(%rbp),%ebp
150
	_ASM_EXTABLE(1b,ia32_badarg)
151 152
	orl     $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
	testl   $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
153
	CFI_REMEMBER_STATE
L
Linus Torvalds 已提交
154
	jnz  sysenter_tracesys
155
	cmpq	$(IA32_NR_syscalls-1),%rax
156
	ja	ia32_badsys
157
sysenter_do_call:
158
	IA32_ARG_FIXUP
159
sysenter_dispatch:
L
Linus Torvalds 已提交
160 161
	call	*ia32_sys_call_table(,%rax,8)
	movq	%rax,RAX-ARGOFFSET(%rsp)
162
	DISABLE_INTERRUPTS(CLBR_NONE)
163
	TRACE_IRQS_OFF
164
	testl	$_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
165 166
	jnz	sysexit_audit
sysexit_from_sys_call:
167
	andl    $~TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
L
Linus Torvalds 已提交
168 169
	/* clear IF, that popfq doesn't enable interrupts early */
	andl  $~0x200,EFLAGS-R11(%rsp) 
R
Roland McGrath 已提交
170 171
	movl	RIP-R11(%rsp),%edx		/* User %eip */
	CFI_REGISTER rip,rdx
172
	RESTORE_ARGS 0,24,0,0,0,0
173 174 175 176
	xorq	%r8,%r8
	xorq	%r9,%r9
	xorq	%r10,%r10
	xorq	%r11,%r11
177
	popfq_cfi
178
	/*CFI_RESTORE rflags*/
179
	popq_cfi %rcx				/* User %esp */
180
	CFI_REGISTER rsp,rcx
181
	TRACE_IRQS_ON
182
	ENABLE_INTERRUPTS_SYSEXIT32
L
Linus Torvalds 已提交
183

184 185 186 187 188 189 190 191
#ifdef CONFIG_AUDITSYSCALL
	.macro auditsys_entry_common
	movl %esi,%r9d			/* 6th arg: 4th syscall arg */
	movl %edx,%r8d			/* 5th arg: 3rd syscall arg */
	/* (already in %ecx)		   4th arg: 2nd syscall arg */
	movl %ebx,%edx			/* 3rd arg: 1st syscall arg */
	movl %eax,%esi			/* 2nd arg: syscall number */
	movl $AUDIT_ARCH_I386,%edi	/* 1st arg: audit arch */
192
	call __audit_syscall_entry
193
	movl RAX-ARGOFFSET(%rsp),%eax	/* reload syscall number */
194
	cmpq $(IA32_NR_syscalls-1),%rax
195 196 197 198 199 200 201 202
	ja ia32_badsys
	movl %ebx,%edi			/* reload 1st syscall arg */
	movl RCX-ARGOFFSET(%rsp),%esi	/* reload 2nd syscall arg */
	movl RDX-ARGOFFSET(%rsp),%edx	/* reload 3rd syscall arg */
	movl RSI-ARGOFFSET(%rsp),%ecx	/* reload 4th syscall arg */
	movl RDI-ARGOFFSET(%rsp),%r8d	/* reload 5th syscall arg */
	.endm

203
	.macro auditsys_exit exit
204
	testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
205
	jnz ia32_ret_from_sys_call
206 207 208
	TRACE_IRQS_ON
	sti
	movl %eax,%esi		/* second arg, syscall return value */
209
	cmpl $-MAX_ERRNO,%eax	/* is it an error ? */
210 211 212
	jbe 1f
	movslq %eax, %rsi	/* if error sign extend to 64 bits */
1:	setbe %al		/* 1 if error, 0 if not */
213
	movzbl %al,%edi		/* zero-extend that into %edi */
214 215
	call __audit_syscall_exit
	movq RAX-ARGOFFSET(%rsp),%rax	/* reload syscall return value */
216 217 218
	movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi
	cli
	TRACE_IRQS_OFF
219
	testl %edi,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
220 221 222
	jz \exit
	CLEAR_RREGS -ARGOFFSET
	jmp int_with_check
223 224 225
	.endm

sysenter_auditsys:
226
	CFI_RESTORE_STATE
227 228 229 230 231 232 233 234 235 236
	auditsys_entry_common
	movl %ebp,%r9d			/* reload 6th syscall arg */
	jmp sysenter_dispatch

sysexit_audit:
	auditsys_exit sysexit_from_sys_call
#endif

sysenter_tracesys:
#ifdef CONFIG_AUDITSYSCALL
237
	testl	$(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
238 239
	jz	sysenter_auditsys
#endif
L
Linus Torvalds 已提交
240 241
	SAVE_REST
	CLEAR_RREGS
242
	movq	$-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
L
Linus Torvalds 已提交
243 244
	movq	%rsp,%rdi        /* &pt_regs -> arg1 */
	call	syscall_trace_enter
245
	LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
L
Linus Torvalds 已提交
246
	RESTORE_REST
247
	cmpq	$(IA32_NR_syscalls-1),%rax
248
	ja	int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
L
Linus Torvalds 已提交
249 250
	jmp	sysenter_do_call
	CFI_ENDPROC
251
ENDPROC(ia32_sysenter_target)
L
Linus Torvalds 已提交
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273

/*
 * 32bit SYSCALL instruction entry.
 *
 * Arguments:
 * %eax	System call number.
 * %ebx Arg1
 * %ecx return EIP 
 * %edx Arg3
 * %esi Arg4
 * %edi Arg5
 * %ebp Arg2    [note: not saved in the stack frame, should not be touched]
 * %esp user stack 
 * 0(%esp) Arg6
 * 	
 * Interrupts off.
 *	
 * This is purely a fast path. For anything complicated we use the int 0x80
 * path below.	Set up a complete hardware stack frame to share code
 * with the int 0x80 path.	
 */ 	
ENTRY(ia32_cstar_target)
274
	CFI_STARTPROC32	simple
275
	CFI_SIGNAL_FRAME
276
	CFI_DEF_CFA	rsp,KERNEL_STACK_OFFSET
277 278
	CFI_REGISTER	rip,rcx
	/*CFI_REGISTER	rflags,r11*/
279
	SWAPGS_UNSAFE_STACK
L
Linus Torvalds 已提交
280
	movl	%esp,%r8d
281
	CFI_REGISTER	rsp,r8
282
	movq	PER_CPU_VAR(kernel_stack),%rsp
283 284 285 286
	/*
	 * No need to follow this irqs on/off section: the syscall
	 * disabled irqs and here we enable it straight after entry:
	 */
287
	ENABLE_INTERRUPTS(CLBR_NONE)
288
	SAVE_ARGS 8,0,0
L
Linus Torvalds 已提交
289 290 291
	movl 	%eax,%eax	/* zero extension */
	movq	%rax,ORIG_RAX-ARGOFFSET(%rsp)
	movq	%rcx,RIP-ARGOFFSET(%rsp)
292
	CFI_REL_OFFSET rip,RIP-ARGOFFSET
L
Linus Torvalds 已提交
293 294 295 296 297
	movq	%rbp,RCX-ARGOFFSET(%rsp) /* this lies slightly to ptrace */
	movl	%ebp,%ecx
	movq	$__USER32_CS,CS-ARGOFFSET(%rsp)
	movq	$__USER32_DS,SS-ARGOFFSET(%rsp)
	movq	%r11,EFLAGS-ARGOFFSET(%rsp)
298
	/*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/
L
Linus Torvalds 已提交
299
	movq	%r8,RSP-ARGOFFSET(%rsp)	
300
	CFI_REL_OFFSET rsp,RSP-ARGOFFSET
L
Linus Torvalds 已提交
301 302 303 304
	/* no need to do an access_ok check here because r8 has been
	   32bit zero extended */ 
	/* hardware stack frame is complete now */	
1:	movl	(%r8),%r9d
305
	_ASM_EXTABLE(1b,ia32_badarg)
306 307
	orl     $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
	testl   $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
308
	CFI_REMEMBER_STATE
L
Linus Torvalds 已提交
309
	jnz   cstar_tracesys
310
	cmpq $IA32_NR_syscalls-1,%rax
311
	ja  ia32_badsys
312
cstar_do_call:
L
Linus Torvalds 已提交
313
	IA32_ARG_FIXUP 1
314
cstar_dispatch:
L
Linus Torvalds 已提交
315 316
	call *ia32_sys_call_table(,%rax,8)
	movq %rax,RAX-ARGOFFSET(%rsp)
317
	DISABLE_INTERRUPTS(CLBR_NONE)
318
	TRACE_IRQS_OFF
319
	testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
320 321
	jnz sysretl_audit
sysretl_from_sys_call:
322
	andl $~TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
323
	RESTORE_ARGS 0,-ARG_SKIP,0,0,0
L
Linus Torvalds 已提交
324
	movl RIP-ARGOFFSET(%rsp),%ecx
325
	CFI_REGISTER rip,rcx
L
Linus Torvalds 已提交
326
	movl EFLAGS-ARGOFFSET(%rsp),%r11d	
327
	/*CFI_REGISTER rflags,r11*/
328 329 330
	xorq	%r10,%r10
	xorq	%r9,%r9
	xorq	%r8,%r8
331
	TRACE_IRQS_ON
L
Linus Torvalds 已提交
332
	movl RSP-ARGOFFSET(%rsp),%esp
333
	CFI_RESTORE rsp
334
	USERGS_SYSRET32
L
Linus Torvalds 已提交
335
	
336 337
#ifdef CONFIG_AUDITSYSCALL
cstar_auditsys:
338
	CFI_RESTORE_STATE
339 340 341 342 343 344
	movl %r9d,R9-ARGOFFSET(%rsp)	/* register to be clobbered by call */
	auditsys_entry_common
	movl R9-ARGOFFSET(%rsp),%r9d	/* reload 6th syscall arg */
	jmp cstar_dispatch

sysretl_audit:
345
	auditsys_exit sysretl_from_sys_call
346 347 348 349
#endif

cstar_tracesys:
#ifdef CONFIG_AUDITSYSCALL
350
	testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
351 352
	jz cstar_auditsys
#endif
353
	xchgl %r9d,%ebp
L
Linus Torvalds 已提交
354
	SAVE_REST
355
	CLEAR_RREGS 0, r9
356
	movq $-ENOSYS,RAX(%rsp)	/* ptrace can change this for a bad syscall */
L
Linus Torvalds 已提交
357 358
	movq %rsp,%rdi        /* &pt_regs -> arg1 */
	call syscall_trace_enter
359
	LOAD_ARGS32 ARGOFFSET, 1  /* reload args from stack in case ptrace changed it */
L
Linus Torvalds 已提交
360
	RESTORE_REST
361
	xchgl %ebp,%r9d
362
	cmpq $(IA32_NR_syscalls-1),%rax
363
	ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
L
Linus Torvalds 已提交
364
	jmp cstar_do_call
365
END(ia32_cstar_target)
L
Linus Torvalds 已提交
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
				
ia32_badarg:
	movq $-EFAULT,%rax
	jmp ia32_sysret
	CFI_ENDPROC

/* 
 * Emulated IA32 system calls via int 0x80. 
 *
 * Arguments:	 
 * %eax	System call number.
 * %ebx Arg1
 * %ecx Arg2
 * %edx Arg3
 * %esi Arg4
 * %edi Arg5
 * %ebp Arg6    [note: not saved in the stack frame, should not be touched]
 *
 * Notes:
 * Uses the same stack frame as the x86-64 version.	
 * All registers except %eax must be saved (but ptrace may violate that)
 * Arguments are zero extended. For system calls that want sign extension and
 * take long arguments a wrapper is needed. Most calls can just be called
 * directly.
 * Assumes it is only called from user space and entered with interrupts off.	
 */ 				

ENTRY(ia32_syscall)
J
Jan Beulich 已提交
394
	CFI_STARTPROC32	simple
395
	CFI_SIGNAL_FRAME
396 397 398 399 400 401
	CFI_DEF_CFA	rsp,SS+8-RIP
	/*CFI_REL_OFFSET	ss,SS-RIP*/
	CFI_REL_OFFSET	rsp,RSP-RIP
	/*CFI_REL_OFFSET	rflags,EFLAGS-RIP*/
	/*CFI_REL_OFFSET	cs,CS-RIP*/
	CFI_REL_OFFSET	rip,RIP-RIP
402
	PARAVIRT_ADJUST_EXCEPTION_FRAME
403
	SWAPGS
404 405 406 407
	/*
	 * No need to follow this irqs on/off section: the syscall
	 * disabled irqs and here we enable it straight after entry:
	 */
408
	ENABLE_INTERRUPTS(CLBR_NONE)
L
Linus Torvalds 已提交
409
	movl %eax,%eax
410
	pushq_cfi %rax
L
Linus Torvalds 已提交
411 412 413
	cld
	/* note the registers are not zero extended to the sf.
	   this could be a problem. */
414
	SAVE_ARGS 0,1,0
415 416
	orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
	testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
L
Linus Torvalds 已提交
417
	jnz ia32_tracesys
418
	cmpq $(IA32_NR_syscalls-1),%rax
419 420
	ja ia32_badsys
ia32_do_call:
L
Linus Torvalds 已提交
421 422 423 424
	IA32_ARG_FIXUP
	call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
ia32_sysret:
	movq %rax,RAX-ARGOFFSET(%rsp)
425 426
ia32_ret_from_sys_call:
	CLEAR_RREGS -ARGOFFSET
L
Linus Torvalds 已提交
427 428 429 430
	jmp int_ret_from_sys_call 

ia32_tracesys:			 
	SAVE_REST
J
Jan Beulich 已提交
431
	CLEAR_RREGS
R
Roland McGrath 已提交
432
	movq $-ENOSYS,RAX(%rsp)	/* ptrace can change this for a bad syscall */
L
Linus Torvalds 已提交
433 434
	movq %rsp,%rdi        /* &pt_regs -> arg1 */
	call syscall_trace_enter
435
	LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
L
Linus Torvalds 已提交
436
	RESTORE_REST
437
	cmpq $(IA32_NR_syscalls-1),%rax
438 439
	ja  int_ret_from_sys_call	/* ia32_tracesys has set RAX(%rsp) */
	jmp ia32_do_call
440
END(ia32_syscall)
L
Linus Torvalds 已提交
441 442 443

ia32_badsys:
	movq $0,ORIG_RAX-ARGOFFSET(%rsp)
444 445
	movq $-ENOSYS,%rax
	jmp ia32_sysret
L
Linus Torvalds 已提交
446 447 448 449

	CFI_ENDPROC
	
	.macro PTREGSCALL label, func, arg
450 451
	ALIGN
GLOBAL(\label)
L
Linus Torvalds 已提交
452 453 454 455 456
	leaq \func(%rip),%rax
	leaq -ARGOFFSET+8(%rsp),\arg	/* 8 for return address */
	jmp  ia32_ptregs_common	
	.endm

457
	CFI_STARTPROC32
458

L
Linus Torvalds 已提交
459 460 461 462 463 464 465 466 467
	PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn, %rdi
	PTREGSCALL stub32_sigreturn, sys32_sigreturn, %rdi
	PTREGSCALL stub32_sigaltstack, sys32_sigaltstack, %rdx
	PTREGSCALL stub32_execve, sys32_execve, %rcx
	PTREGSCALL stub32_fork, sys_fork, %rdi
	PTREGSCALL stub32_clone, sys32_clone, %rdx
	PTREGSCALL stub32_vfork, sys_vfork, %rdi
	PTREGSCALL stub32_iopl, sys_iopl, %rsi

468 469
	ALIGN
ia32_ptregs_common:
L
Linus Torvalds 已提交
470
	popq %r11
471 472
	CFI_ENDPROC
	CFI_STARTPROC32	simple
473
	CFI_SIGNAL_FRAME
474 475 476 477 478 479 480 481 482 483 484
	CFI_DEF_CFA	rsp,SS+8-ARGOFFSET
	CFI_REL_OFFSET	rax,RAX-ARGOFFSET
	CFI_REL_OFFSET	rcx,RCX-ARGOFFSET
	CFI_REL_OFFSET	rdx,RDX-ARGOFFSET
	CFI_REL_OFFSET	rsi,RSI-ARGOFFSET
	CFI_REL_OFFSET	rdi,RDI-ARGOFFSET
	CFI_REL_OFFSET	rip,RIP-ARGOFFSET
/*	CFI_REL_OFFSET	cs,CS-ARGOFFSET*/
/*	CFI_REL_OFFSET	rflags,EFLAGS-ARGOFFSET*/
	CFI_REL_OFFSET	rsp,RSP-ARGOFFSET
/*	CFI_REL_OFFSET	ss,SS-ARGOFFSET*/
L
Linus Torvalds 已提交
485 486 487 488 489
	SAVE_REST
	call *%rax
	RESTORE_REST
	jmp  ia32_sysret	/* misbalances the return cache */
	CFI_ENDPROC
490
END(ia32_ptregs_common)