Commit bbad3e50 authored by Cody P Schafer's avatar Cody P Schafer Committed by Benjamin Herrenschmidt

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: default avatarCody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 1ee9fcc1
...@@ -171,7 +171,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096, ...@@ -171,7 +171,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
} }
static unsigned long h_get_24x7_catalog_page(char page[], static unsigned long h_get_24x7_catalog_page(char page[],
u32 version, u32 index) u64 version, u32 index)
{ {
return h_get_24x7_catalog_page_(virt_to_phys(page), return h_get_24x7_catalog_page_(virt_to_phys(page),
version, index); version, index);
...@@ -185,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj, ...@@ -185,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
ssize_t ret = 0; ssize_t ret = 0;
size_t catalog_len = 0, catalog_page_len = 0, page_count = 0; size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
loff_t page_offset = 0; loff_t page_offset = 0;
uint32_t catalog_version_num = 0; uint64_t catalog_version_num = 0;
void *page = kmem_cache_alloc(hv_page_cache, GFP_USER); void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
struct hv_24x7_catalog_page_0 *page_0 = page; struct hv_24x7_catalog_page_0 *page_0 = page;
if (!page) if (!page)
...@@ -197,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj, ...@@ -197,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
goto e_free; goto e_free;
} }
catalog_version_num = be32_to_cpu(page_0->version); catalog_version_num = be64_to_cpu(page_0->version);
catalog_page_len = be32_to_cpu(page_0->length); catalog_page_len = be32_to_cpu(page_0->length);
catalog_len = catalog_page_len * 4096; catalog_len = catalog_page_len * 4096;
...@@ -220,7 +220,8 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj, ...@@ -220,7 +220,8 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
page, 4096, page_offset * 4096); page, 4096, page_offset * 4096);
e_free: e_free:
if (hret) if (hret)
pr_err("h_get_24x7_catalog_page(ver=%d, page=%lld) failed: rc=%ld\n", pr_err("h_get_24x7_catalog_page(ver=%lld, page=%lld) failed:"
" rc=%ld\n",
catalog_version_num, page_offset, hret); catalog_version_num, page_offset, hret);
kfree(page); kfree(page);
...@@ -255,7 +256,7 @@ e_free: \ ...@@ -255,7 +256,7 @@ e_free: \
static DEVICE_ATTR_RO(_name) static DEVICE_ATTR_RO(_name)
PAGE_0_ATTR(catalog_version, "%lld\n", PAGE_0_ATTR(catalog_version, "%lld\n",
(unsigned long long)be32_to_cpu(page_0->version)); (unsigned long long)be64_to_cpu(page_0->version));
PAGE_0_ATTR(catalog_len, "%lld\n", PAGE_0_ATTR(catalog_len, "%lld\n",
(unsigned long long)be32_to_cpu(page_0->length) * 4096); (unsigned long long)be32_to_cpu(page_0->length) * 4096);
static BIN_ATTR_RO(catalog, 0/* real length varies */); static BIN_ATTR_RO(catalog, 0/* real length varies */);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment