[PATCH] powerpc: Set cache info defaults

Olof Johansson olof at lixom.net
Fri Dec 9 12:40:17 EST 2005


Hi,

I would like to see this in 2.6.15, please apply.


---

Cache info is setup by walking the device tree in initialize_cache_info().
However, icache_flush_range might be called before that, in
slb_initialize()->patch_slb_encoding, which modifies the load immediate
instructions used with SLB fault code.

Not only that, but depending on memory layout, we might take SLB faults
during unflatten_device_tree. So that fault will load an SLB entry that
might not contain the right LLP flags for the segment.

Either we can walk the flattened device tree to setup cache info, or
we can pick the known defaults that are known to work. Doing it in the
flattened device tree is hairier since we need to know the machine type
to know what property to look for, etc, etc.

For now, it's just easier to go with the defaults. Worst thing that
happens from it is that we might waste a few cycles doing too small
dcbst/icbi increments.


Signed-off-by: Olof Johansson <olof at lixom.net>

Index: 2.6/arch/powerpc/kernel/setup_64.c
===================================================================
--- 2.6.orig/arch/powerpc/kernel/setup_64.c	2005-12-08 17:17:59.000000000 -0600
+++ 2.6/arch/powerpc/kernel/setup_64.c	2005-12-08 19:35:15.000000000 -0600
@@ -106,7 +106,15 @@ int boot_cpuid_phys = 0;
 dev_t boot_dev;
 u64 ppc64_pft_size;
 
-struct ppc64_caches ppc64_caches;
+/* Pick defaults since we might want to patch instructions
+ * before we've read this from the device tree.
+ */
+struct ppc64_caches ppc64_caches = {
+	.dline_size = 0x80,
+	.log_dline_size = 7,
+	.iline_size = 0x80,
+	.log_iline_size = 7
+};
 EXPORT_SYMBOL_GPL(ppc64_caches);
 
 /*



More information about the Linuxppc64-dev mailing list