Skip to contentSkip to conversation

parisc: check hardcoded value of SHMLBA against value reported by firmware

PATCH In review Helge Deller 3 participants 5 messages Oct 29, 2013 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: check hardcoded value of SHMLBA against value reported by firmware

Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions of the platform. The firmware function PDC_CACHE does return the machine dependend value of this aliasing requirement.
So, if there is a difference between those two - which we don't expect - let's report it at least.

arch/parisc/kernel/cache.c +9 -0
index c035673..3523e20 100644
@@ -142,6 +142,15 @@ parisc_cache_init(void)
 	if (pdc_cache_info(&cache_info) < 0)
 		panic("parisc_cache_init: pdc_cache_info failed");
 
+	/*
+	 * The alias field returned by PDC_CACHE specifies the aliasing
+	 * boundaries for virtual addresses.  So, let's verify if our hardcoded
+	 * value of SHMLBA (4 MB) is correct for this machine.
+	 */
+	if ((4096UL << (cache_info.dc_conf.cc_alias-1)) != SHMLBA)
+		pr_warn("WARNING: PDC_CACHE returns aliasing of %lu kB.\n",
+			(4UL << (cache_info.dc_conf.cc_alias-1)));
+
 #if 0
 	printk("ic_size %lx dc_size %lx it_size %lx\n",
 		cache_info.ic_size,
#1 lore raw

I seem to recall the aliasing boundary value returned by my rp3440 is "unknown".

Quoted 34 lines · Helge Deller

Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions of the platform. The firmware function PDC_CACHE does return the machine dependend value of this aliasing requirement.
So, if there is a difference between those two - which we don't expect - let's report it at least.

arch/parisc/kernel/cache.c +9 -1
index c035673..3523e20 100644
@@ -142,6 +142,15 @@ parisc_cache_init(void)
  	if (pdc_cache_info(&cache_info) < 0)
  		panic("parisc_cache_init: pdc_cache_info failed");
 
+	/*
+	 * The alias field returned by PDC_CACHE specifies the aliasing
+	 * boundaries for virtual addresses.  So, let's verify if our hardcoded
+	 * value of SHMLBA (4 MB) is correct for this machine.
+	 */
+	if ((4096UL << (cache_info.dc_conf.cc_alias-1)) != SHMLBA)
+		pr_warn("WARNING: PDC_CACHE returns aliasing of %lu kB.\n",
+			(4UL << (cache_info.dc_conf.cc_alias-1)));
+
  #if 0
  	printk("ic_size %lx dc_size %lx it_size %lx\n",
  		cache_info.ic_size,
--

To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
John David Anglin    [email protected]
author maintainer
#2 lore raw
Quoted 1 line · John David Anglin

I seem to recall the aliasing boundary value returned by my rp3440 is "unknown".

Even better, then it would be interesting to see what this patch reports on your machine....

Quoted 37 lines · Helge Deller
Quoted 33 lines

Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions of the platform. The firmware function PDC_CACHE does return the machine dependend value of this aliasing requirement.
So, if there is a difference between those two - which we don't expect - let's report it at least.

arch/parisc/kernel/cache.c +8 -0
index c035673..3523e20 100644
@@ -142,6 +142,15 @@ parisc_cache_init(void)
      if (pdc_cache_info(&cache_info) < 0)
          panic("parisc_cache_init: pdc_cache_info failed");
  +    /*
+     * The alias field returned by PDC_CACHE specifies the aliasing
+     * boundaries for virtual addresses.  So, let's verify if our hardcoded
+     * value of SHMLBA (4 MB) is correct for this machine.
+     */
+    if ((4096UL << (cache_info.dc_conf.cc_alias-1)) != SHMLBA)
+        pr_warn("WARNING: PDC_CACHE returns aliasing of %lu kB.\n",
+            (4UL << (cache_info.dc_conf.cc_alias-1)));
+
  #if 0
      printk("ic_size %lx dc_size %lx it_size %lx\n",
          cache_info.ic_size,
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#3 lore raw
In reply to Helge Deller
Quoted 5 lines · Helge Deller

Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions of the platform. The firmware function PDC_CACHE does return the machine dependend value of this aliasing requirement.
So, if there is a difference between those two - which we don't expect - let's report it at least.

We know that architecturally it's defined to be 16MB. However, we also know from the chip architects that the greatest stride ever done or planned was 4MB, which is why we use it. HPUX does the same, so there's not much point issuing a warning, because it's likely that IODC isn't setting up the values correctly and there's nothing a warning will achieve except worrying the users if they bother to read it.

James

author maintainer
#4 lore raw
Quoted 7 lines · James Bottomley
Quoted 5 lines · Helge Deller

Our value of SHMLBA is hardcoded to 4MB on parisc due to aliasing restrictions of the platform. The firmware function PDC_CACHE does return the machine dependend value of this aliasing requirement.
So, if there is a difference between those two - which we don't expect - let's report it at least.

Quoted 6 lines

We know that architecturally it's defined to be 16MB. However, we also know from the chip architects that the greatest stride ever done or planned was 4MB, which is why we use it. HPUX does the same, so there's not much point issuing a warning, because it's likely that IODC isn't setting up the values correctly and there's nothing a warning will achieve except worrying the users if they bother to read it.

Ok, thanks for this info.
I'll drop that patch.

Helge