[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081216091509.GA29872@elte.hu>
Date: Tue, 16 Dec 2008 10:15:09 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Ken Chen <kenchen@...gle.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jeremy Fitzhardinge <jeremy@...p.org>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch] x86: convert rdtscll() to use __native_read_tsc
* Ken Chen <kenchen@...gle.com> wrote:
> Is there any reason why x86 rdtscll have to use the out of line function
> instead of inline __native_read_tsc()? native_read_tsc and
> __native_read_tsc is essentially the same functions.
Your patch is correct.
The reason for the __native_read_tsc() / native_read_tsc() distinction is
and obscure problem with paravirt function pointers. Such constructs:
./xen/enlighten.c: .read_tsc = native_read_tsc,
do not always work fine with all versions of gcc, if native_read_tsc() is
a simple static inline (as it should be) - the build would fail with
certain gcc flags. (and i remember runtime problems too) The C semantics
of taking the address of an inline function seem pretty clear: the inlined
function should be instantiated in that .o and a pointer should be
generated out of that local instantiation.
Perhaps the real fix is to do this rename as well:
native_read_tsc => native_read_tsc_paravirt
__native_read_tsc => native_read_tsc
as this makes the native_read_tsc_paravirt() a pure technical variant, to
be used in paravirt_ops function pointer assignments. People would thus
just use the obvious native_read_tsc() inline function most of the time
and could forget about native_read_tsc_paravirt().
Jeremy?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists