All of lore.kernel.org
 help / color / mirror / Atom feed
* Can anyone explain "movl %eax %eax"?
@ 2011-02-09 22:24 Jidong Xiao
  2011-02-09 22:32 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Jidong Xiao @ 2011-02-09 22:24 UTC (permalink / raw)
  To: linux-kernel

Hi,

In the kernel source, I see in a couple of places, there is "movl %eax
%eax". Is this used for alignment purpose?

For example, in the following piece of code we can see "movl %eax,%eax".

407 ENTRY(ia32_syscall)
408         CFI_STARTPROC32 simple
409         CFI_SIGNAL_FRAME
410         CFI_DEF_CFA     rsp,SS+8-RIP
411         /*CFI_REL_OFFSET        ss,SS-RIP*/
412         CFI_REL_OFFSET  rsp,RSP-RIP
413         /*CFI_REL_OFFSET        rflags,EFLAGS-RIP*/
414         /*CFI_REL_OFFSET        cs,CS-RIP*/
415         CFI_REL_OFFSET  rip,RIP-RIP
416         PARAVIRT_ADJUST_EXCEPTION_FRAME
417         SWAPGS
418         /*
419          * No need to follow this irqs on/off section: the syscall
420          * disabled irqs and here we enable it straight after entry:
421          */
422         ENABLE_INTERRUPTS(CLBR_NONE)
423         movl %eax,%eax
424         pushq %rax
425         CFI_ADJUST_CFA_OFFSET 8
426         cld
427         /* note the registers are not zero extended to the sf.
428            this could be a problem. */
429         SAVE_ARGS 0,0,1
430         GET_THREAD_INFO(%r10)
431         orl   $TS_COMPAT,TI_status(%r10)
432         testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
433         jnz ia32_tracesys
434         cmpq $(IA32_NR_syscalls-1),%rax
435         ja ia32_badsys
436 ia32_do_call:
437         IA32_ARG_FIXUP
438         call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
439 ia32_sysret:
440         movq %rax,RAX-ARGOFFSET(%rsp)
441 ia32_ret_from_sys_call:
442         CLEAR_RREGS -ARGOFFSET
443         jmp int_ret_from_sys_call


Regards
Jidong

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-10  1:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09 22:24 Can anyone explain "movl %eax %eax"? Jidong Xiao
2011-02-09 22:32 ` H. Peter Anvin
2011-02-09 23:02   ` Jidong Xiao
2011-02-09 23:05     ` David Miller
2011-02-10  1:32       ` Jidong Xiao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.