Skip to content

Commit e5a2e7f

Browse files
Kyle McMartinKyle McMartin
authored andcommitted
[PARISC] Match show_cache_info with reality
show_cache_info and struct pdc_cache_cf were out of sync with published documentation. Fix the reporting of cache associativity and update the pdc_cache_cf bitfields to match documentation. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
1 parent 667baef commit e5a2e7f

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎arch/parisc/kernel/cache.c‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,17 @@ update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
9797
void
9898
show_cache_info(struct seq_file *m)
9999
{
100+
char buf[32];
101+
100102
seq_printf(m, "I-cache\t\t: %ld KB\n",
101103
cache_info.ic_size/1024 );
102-
seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %d-way associative)\n",
104+
if (cache_info.dc_loop == 1)
105+
snprintf(buf, 32, "%lu-way associative", cache_info.dc_loop);
106+
seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %s)\n",
103107
cache_info.dc_size/1024,
104108
(cache_info.dc_conf.cc_wt ? "WT":"WB"),
105109
(cache_info.dc_conf.cc_sh ? ", shared I/D":""),
106-
(cache_info.dc_conf.cc_assoc)
107-
);
108-
110+
((cache_info.dc_loop == 1) ? "direct mapped" : buf));
109111
seq_printf(m, "ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n",
110112
cache_info.it_size,
111113
cache_info.dt_size,
@@ -158,11 +160,11 @@ parisc_cache_init(void)
158160
cache_info.dc_conf.cc_block,
159161
cache_info.dc_conf.cc_line,
160162
cache_info.dc_conf.cc_shift);
161-
printk(" wt %d sh %d cst %d assoc %d\n",
163+
printk(" wt %d sh %d cst %d hv %d\n",
162164
cache_info.dc_conf.cc_wt,
163165
cache_info.dc_conf.cc_sh,
164166
cache_info.dc_conf.cc_cst,
165-
cache_info.dc_conf.cc_assoc);
167+
cache_info.dc_conf.cc_hv);
166168

167169
printk("IC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
168170
cache_info.ic_base,
@@ -176,11 +178,11 @@ parisc_cache_init(void)
176178
cache_info.ic_conf.cc_block,
177179
cache_info.ic_conf.cc_line,
178180
cache_info.ic_conf.cc_shift);
179-
printk(" wt %d sh %d cst %d assoc %d\n",
181+
printk(" wt %d sh %d cst %d hv %d\n",
180182
cache_info.ic_conf.cc_wt,
181183
cache_info.ic_conf.cc_sh,
182184
cache_info.ic_conf.cc_cst,
183-
cache_info.ic_conf.cc_assoc);
185+
cache_info.ic_conf.cc_hv);
184186

185187
printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
186188
cache_info.dt_conf.tc_sh,

‎include/asm-parisc/pdc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
352352
cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */
353353
cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */
354354
cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */
355-
cc_pad1 : 5, /* reserved */
356-
cc_assoc: 8; /* associativity of I/D-cache */
355+
cc_pad1 : 10, /* reserved */
356+
cc_hv : 3; /* hversion dependent */
357357
};
358358

359359
struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */

0 commit comments

Comments
 (0)