All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Selecting the TSC
@ 2009-04-08 23:08 Martin Shepherd
  2009-04-09  0:11 ` Martin Shepherd
  0 siblings, 1 reply; 28+ messages in thread
From: Martin Shepherd @ 2009-04-08 23:08 UTC (permalink / raw)
  To: xenomai

It appears that whereas Xenomai uses the definition of the obsolete
kernel CONFIG_X86_TSC configuration option to determine whether the
kernel uses the TSC, everything else in the 2.6.28.7 kernel now uses
either the macro cpu_has_tsc, or the macro, cpu_has(c,X86_FEATURE_TSC)
to do this.  Both of these macros eventually expand to

  test_bit(X86_FEATURE_TSC, c->x86_capability)

where c is the pointer to the cpu-data of a specified CPU. For x86
CPUs this accesses the TSC capability bit that is read from the
specified CPU at boot time (in arch/x86/kernel/cpu/common.c). This bit
is not affected at all by the setting of the CONFIG_X86_TSC option
macro.

The reason that I investigated this, is because I couldn't find any
way to get Xenomai to use the TSC on the ancient AMD Athlon that I am
currently using to try out Xenomai. Whereas the feature flags shown by
/proc/cpuinfo indicate that the kernel is using this CPU's TSC,
Xenomai's trivial_periodic example program complains that it
isn't. The reason is that for any processor type other than the
various Pentium CPUs, "make menuconfig" doesn't define CONFIG_X86_TSC
in the .config file at all, and if one manually adds this option to
the .config file, then the kernel make procedure removes it before
proceeding to build the kernel.

Is this a known issue, and if so, how are other people working around
it?

Assuming that the issue is known, has any work been done towards
moving Xenomai over to using the run-time cpu_has_tsc macro, instead
of the obsolete compile-time feature macro? Given that this is my
first experience with Xenomai, I don't know how problematic this might
be.

FYI, note that I have checked that, apart from the areas patched by
the xenomai prepare_kernel.sh script, there are only 3 places in the
2.6.28.7 kernel where the old CONFIG_X86_TSC macro is still used, and
none of these are involved in actually determining whether the TSC is
used or not.  Specifically, in
linux-2.6.28.7/arch/x86/include/asm/tsc.h, if CONFIG_X86_TSC is
undefined, then cpu_has_tsc is consulted instead, to check whether to
use the TSC anyway, and in linux-2.6.28.7/arch/x86/kernel/tsc.c, if
CONFIG_X86_TSC is defined, then the notsc boot-line option results in
an error message saying that the TSC can't be disabled.

Martin Shepherd  (mcs @ astro.caltech.edu)


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

end of thread, other threads:[~2009-04-19  5:15 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 23:08 [Xenomai-help] Selecting the TSC Martin Shepherd
2009-04-09  0:11 ` Martin Shepherd
2009-04-09  2:49   ` Steven Seeger
2009-04-10 22:15   ` [Xenomai-help] Xeno-test bug Martin Shepherd
2009-04-11  0:20     ` [Xenomai-help] Running xeno-test Martin Shepherd
2009-04-11  0:24       ` Steven Seeger
2009-04-11  0:35         ` Martin Shepherd
2009-04-11 12:39           ` Gilles Chanteperdrix
2009-04-11 20:00             ` Martin Shepherd
2009-04-11 20:07               ` Gilles Chanteperdrix
2009-04-12  2:02                 ` Martin Shepherd
2009-04-12  9:11                   ` Gilles Chanteperdrix
2009-04-12 17:40                     ` Gilles Chanteperdrix
2009-04-12 19:10                     ` Martin Shepherd
2009-04-12 19:23                       ` Gilles Chanteperdrix
2009-04-16  3:20                         ` Martin Shepherd
     [not found]                           ` <4F0B1E98-862D-4031-B22E-D7DAEA554EEB@comcast.net>
     [not found]                             ` <Pine.LNX.4.64.0904161059220.24221@domain.hid>
2009-04-16 18:43                               ` Steven Seeger
2009-04-16 22:18                                 ` Martin Shepherd
2009-04-17  2:50                                 ` Martin Shepherd
     [not found]                           ` <1239872431.5845.25.camel@domain.hid>
     [not found]                             ` <Pine.LNX.4.64.0904161537400.26955@domain.hid>
2009-04-17  8:01                               ` Vikesh Rambaran
2009-04-17 12:57                           ` Gilles Chanteperdrix
2009-04-17 23:34                             ` Martin Shepherd
2009-04-19  5:15                             ` Martin Shepherd
2009-04-12 10:31     ` [Xenomai-help] Xeno-test bug Gilles Chanteperdrix
2009-04-12 10:36     ` Gilles Chanteperdrix
2009-04-12 18:52       ` Martin Shepherd
2009-04-12 19:25         ` Gilles Chanteperdrix
2009-04-13  0:42           ` Martin Shepherd

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.