From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
Linus Torvalds <torvalds@osdl.org>,
Steve Munroe <sjmunroe@us.ibm.com>
Subject: [PATCH] ppc32: Tell userland about lack of standard TB
Date: Wed, 12 Oct 2005 14:22:50 +1000 [thread overview]
Message-ID: <1129090971.17365.271.camel@gaston> (raw)
Glibc is about to get some new high precision timer stuff that relies on
the standard timebase of the PPC architecture. However, some (rare &
old) CPUs do not have such timebase and it is a bit annoying to have
your stuff just crash because you are running on the wrong CPU... This
exposes to userland a CPU feature bit that tells that the current
processor doesn't have a standard timebase. It's negative logic so that
glibc will still "just work" on older kernels (it will just be unhappy
on those old CPUs but that doesn't really matter as distro tend to
update glibc & kernel at the same time).
Might still be worth getting into 2.6.14 ...
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-work/arch/ppc/kernel/cputable.c
===================================================================
--- linux-work.orig/arch/ppc/kernel/cputable.c 2005-10-12 11:43:52.000000000 +1000
+++ linux-work/arch/ppc/kernel/cputable.c 2005-10-12 11:48:07.000000000 +1000
@@ -91,7 +91,7 @@
.cpu_features = CPU_FTR_COMMON | CPU_FTR_601 |
CPU_FTR_HPTE_TABLE,
.cpu_user_features = COMMON_PPC | PPC_FEATURE_601_INSTR |
- PPC_FEATURE_UNIFIED_CACHE,
+ PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
.icache_bsize = 32,
.dcache_bsize = 32,
.cpu_setup = __setup_cpu_601
@@ -759,7 +759,8 @@
.cpu_name = "403GCX",
.cpu_features = CPU_FTR_SPLIT_ID_CACHE |
CPU_FTR_USE_TB,
- .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+ .cpu_user_features = PPC_FEATURE_32 |
+ PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
.icache_bsize = 16,
.dcache_bsize = 16,
},
Index: linux-work/include/asm-ppc/cputable.h
===================================================================
--- linux-work.orig/include/asm-ppc/cputable.h 2005-09-22 14:07:27.000000000 +1000
+++ linux-work/include/asm-ppc/cputable.h 2005-10-12 11:47:06.000000000 +1000
@@ -24,6 +24,7 @@
#define PPC_FEATURE_HAS_SPE 0x00800000
#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
+#define PPC_FEATURE_NO_TB 0x00100000
#ifdef __KERNEL__
reply other threads:[~2005-10-12 4:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1129090971.17365.271.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=sjmunroe@us.ibm.com \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox