aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
authorCody P Schafer <cody@linux.vnet.ibm.com>2014-04-15 13:10:55 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-28 02:31:50 -0400
commitbbad3e50e8ed2d48294c141e687d411430cacbcf (patch)
tree56a4dfe805a83231a0064491687ebf601656f3e6 /arch/powerpc/perf
parent1ee9fcc1a021e54454a23b107a47d10fb603508c (diff)
powerpc/perf/hv-24x7: Catalog version number is be64, not be32
The catalog version number was changed from a be32 (with proceeding 32bits of padding) to a be64, update the code to treat it as a be64 Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r--arch/powerpc/perf/hv-24x7.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 95a67f81f22a..e0766b82e165 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -171,7 +171,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
171} 171}
172 172
173static unsigned long h_get_24x7_catalog_page(char page[], 173static unsigned long h_get_24x7_catalog_page(char page[],
174 u32 version, u32 index) 174 u64 version, u32 index)
175{ 175{
176 return h_get_24x7_catalog_page_(virt_to_phys(page), 176 return h_get_24x7_catalog_page_(virt_to_phys(page),
177 version, index); 177 version, index);
@@ -185,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
185 ssize_t ret = 0; 185 ssize_t ret = 0;
186 size_t catalog_len = 0, catalog_page_len = 0, page_count = 0; 186 size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
187 loff_t page_offset = 0; 187 loff_t page_offset = 0;
188 uint32_t catalog_version_num = 0; 188 uint64_t catalog_version_num = 0;
189 void *page = kmem_cache_alloc(hv_page_cache, GFP_USER); 189 void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
190 struct hv_24x7_catalog_page_0 *page_0 = page; 190 struct hv_24x7_catalog_page_0 *page_0 = page;
191 if (!page) 191 if (!page)
@@ -197,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
197 goto e_free; 197 goto e_free;
198 } 198 }
199 199
200 catalog_version_num = be32_to_cpu(page_0->version); 200 catalog_version_num = be64_to_cpu(page_0->version);
201 catalog_page_len = be32_to_cpu(page_0->length); 201 catalog_page_len = be32_to_cpu(page_0->length);
202 catalog_len = catalog_page_len * 4096; 202 catalog_len = catalog_page_len * 4096;
203 203
@@ -220,8 +220,9 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
220 page, 4096, page_offset * 4096); 220 page, 4096, page_offset * 4096);
221e_free: 221e_free:
222 if (hret) 222 if (hret)
223 pr_err("h_get_24x7_catalog_page(ver=%d, page=%lld) failed: rc=%ld\n", 223 pr_err("h_get_24x7_catalog_page(ver=%lld, page=%lld) failed:"
224 catalog_version_num, page_offset, hret); 224 " rc=%ld\n",
225 catalog_version_num, page_offset, hret);
225 kfree(page); 226 kfree(page);
226 227
227 pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n", 228 pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n",
@@ -255,7 +256,7 @@ e_free: \
255static DEVICE_ATTR_RO(_name) 256static DEVICE_ATTR_RO(_name)
256 257
257PAGE_0_ATTR(catalog_version, "%lld\n", 258PAGE_0_ATTR(catalog_version, "%lld\n",
258 (unsigned long long)be32_to_cpu(page_0->version)); 259 (unsigned long long)be64_to_cpu(page_0->version));
259PAGE_0_ATTR(catalog_len, "%lld\n", 260PAGE_0_ATTR(catalog_len, "%lld\n",
260 (unsigned long long)be32_to_cpu(page_0->length) * 4096); 261 (unsigned long long)be32_to_cpu(page_0->length) * 4096);
261static BIN_ATTR_RO(catalog, 0/* real length varies */); 262static BIN_ATTR_RO(catalog, 0/* real length varies */);