diff options
author | Anton Blanchard <anton@samba.org> | 2007-01-08 10:43:02 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-01-09 01:03:03 -0500 |
commit | dc40127ca5c6e1da48d2b5f9d0c65b5795faac12 (patch) | |
tree | 7d57b9a53adc8f4416380b126108d1e458a8e20c /arch/powerpc/platforms/pseries/hvCall_inst.c | |
parent | ab87e8dc88a7cae341c403547cea6b022f5ac023 (diff) |
[POWERPC] Fix bugs in the hypervisor call stats code
There were a few issues with the HCALL_STATS code:
- PURR cpu feature checks were backwards
- We iterated one entry off the end of the hcall_stats array
- Remove dead update_hcall_stats() function prototype
I noticed one thing while debugging, and that is we call H_ENTER (to set
up the MMU hashtable in early init) before we have done the cpu fixups.
This means we will execute the PURR SPR reads even on a CPU that isnt
capable of it. I wonder if we can move the CPU feature fixups earlier.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/hvCall_inst.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/hvCall_inst.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index 80181c4c49eb..3ddc04925d50 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
@@ -34,7 +34,7 @@ DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats); | |||
34 | */ | 34 | */ |
35 | static void *hc_start(struct seq_file *m, loff_t *pos) | 35 | static void *hc_start(struct seq_file *m, loff_t *pos) |
36 | { | 36 | { |
37 | if ((int)*pos < HCALL_STAT_ARRAY_SIZE) | 37 | if ((int)*pos < (HCALL_STAT_ARRAY_SIZE-1)) |
38 | return (void *)(unsigned long)(*pos + 1); | 38 | return (void *)(unsigned long)(*pos + 1); |
39 | 39 | ||
40 | return NULL; | 40 | return NULL; |
@@ -57,7 +57,7 @@ static int hc_show(struct seq_file *m, void *p) | |||
57 | struct hcall_stats *hs = (struct hcall_stats *)m->private; | 57 | struct hcall_stats *hs = (struct hcall_stats *)m->private; |
58 | 58 | ||
59 | if (hs[h_num].num_calls) { | 59 | if (hs[h_num].num_calls) { |
60 | if (!cpu_has_feature(CPU_FTR_PURR)) | 60 | if (cpu_has_feature(CPU_FTR_PURR)) |
61 | seq_printf(m, "%lu %lu %lu %lu\n", h_num<<2, | 61 | seq_printf(m, "%lu %lu %lu %lu\n", h_num<<2, |
62 | hs[h_num].num_calls, | 62 | hs[h_num].num_calls, |
63 | hs[h_num].tb_total, | 63 | hs[h_num].tb_total, |