All of lore.kernel.org
 help / color / mirror / Atom feed
* [Q x86-64] on kernel_eflags
@ 2011-07-05 10:47 Cyrill Gorcunov
  2011-07-05 11:00 ` Ian Campbell
  2011-07-05 17:47 ` [Q x86-64] on kernel_eflags H. Peter Anvin
  0 siblings, 2 replies; 19+ messages in thread
From: Cyrill Gorcunov @ 2011-07-05 10:47 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Brian Gerst,
	Jan Beulich, Peter Zijlstra, Frederic Weisbecker

While were looking into ret_from_fork code I somehow wondered
about the global kernel_eflags variable here.

arch/x86/cpu/common.c
---------------------
unsigned long kernel_eflags;

void __cpuinit cpu_init(void)
{
	...
	raw_local_save_flags(kernel_eflags);
}

arch/x86/kernel/entry_64.S
--------------------------
ENTRY(ret_from_fork)
	DEFAULT_FRAME
	LOCK ; btr $TIF_FORK,TI_flags(%r8)
	pushq_cfi kernel_eflags(%rip)
	popfq_cfi                               # reset kernel eflags

Every call to cpu_init renew global kernel_eflags
and every task switching does use this variable in a
sake of cleaning carry bit of flags register as far as
I can tell.

Should not every cpu has own copy of kernel_eflags? Just
to be consistent in style? Or this would be space waisting
and an optimization is done here?

	Cyrill

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

end of thread, other threads:[~2011-07-07  0:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 10:47 [Q x86-64] on kernel_eflags Cyrill Gorcunov
2011-07-05 11:00 ` Ian Campbell
2011-07-05 11:15   ` Cyrill Gorcunov
2011-07-05 13:00     ` [PATCH 1/3] x86: drop unnecessary kernel_eflags variable from 64 bit Ian Campbell
2011-07-05 13:28       ` Cyrill Gorcunov
2011-07-06  9:25         ` Ian Campbell
2011-07-06  9:46           ` Cyrill Gorcunov
2011-07-06  9:57             ` Ian Campbell
2011-07-06 10:12               ` Cyrill Gorcunov
2011-07-06  9:39       ` Pekka Enberg
2011-07-06 23:17         ` Andi Kleen
2011-07-07  0:00           ` H. Peter Anvin
2011-07-05 13:00     ` [PATCH 2/3] x86: make 64 bit ret_from_fork a little more similar to 32 bit Ian Campbell
2011-07-06  9:41       ` Pekka Enberg
2011-07-05 13:00     ` [PATCH 3/3] x86: ret_from_fork: use symbolic contants for bits in EFLAGS Ian Campbell
2011-07-06  9:36       ` Pekka Enberg
2011-07-05 17:47 ` [Q x86-64] on kernel_eflags H. Peter Anvin
2011-07-05 17:56   ` Cyrill Gorcunov
2011-07-06  9:25   ` Ian Campbell

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.