[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20131125090040.188406259@dhcp-16-126.nay.redhat.com>
Date: Mon, 25 Nov 2013 16:56:42 +0800
From: dyoung@...hat.com
To: linux-kernel@...r.kernel.org
Cc: linux-efi@...r.kernel.org, x86@...nel.org, mjg59@...f.ucam.org,
hpa@...or.com, James.Bottomley@...senPartnership.com,
vgoyal@...hat.com, ebiederm@...ssion.com, horms@...ge.net.au,
kexec@...ts.infradead.org, bp@...en8.de, greg@...ah.com,
matt@...sole-pimps.org, toshi.kani@...com,
Dave Young <dyoung@...hat.com>
Subject: [patch 12/12 v4] x86: do not use __va for getting setup_data virt addr
Hi,
References: <20131125085630.417850406@...p-16-126.nay.redhat.com>
Content-Disposition: inline; filename=12-x86-kdebugfs-use-ioremap.patch
__va does not work in case memmap=exactmap, so let's always use ioremap_cache.
Signed-off-by: Dave Young <dyoung@...hat.com>
---
arch/x86/kernel/kdebugfs.c | 35 +++++++++++------------------------
1 file changed, 11 insertions(+), 24 deletions(-)
--- efi.orig/arch/x86/kernel/kdebugfs.c
+++ efi/arch/x86/kernel/kdebugfs.c
@@ -33,7 +33,6 @@ static ssize_t setup_data_read(struct fi
struct setup_data_node *node = file->private_data;
unsigned long remain;
loff_t pos = *ppos;
- struct page *pg;
void *p;
u64 pa;
@@ -47,18 +46,12 @@ static ssize_t setup_data_read(struct fi
count = node->len - pos;
pa = node->paddr + sizeof(struct setup_data) + pos;
- pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT);
- if (PageHighMem(pg)) {
- p = ioremap_cache(pa, count);
- if (!p)
- return -ENXIO;
- } else
- p = __va(pa);
+ p = ioremap_cache(pa, count);
+ if (!p)
+ return -ENXIO;
remain = copy_to_user(user_buf, p, count);
-
- if (PageHighMem(pg))
- iounmap(p);
+ iounmap(p);
if (remain)
return -EFAULT;
@@ -109,7 +102,6 @@ static int __init create_setup_data_node
struct setup_data *data;
int error;
struct dentry *d;
- struct page *pg;
u64 pa_data;
int no = 0;
@@ -126,16 +118,12 @@ static int __init create_setup_data_node
goto err_dir;
}
- pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT);
- if (PageHighMem(pg)) {
- data = ioremap_cache(pa_data, sizeof(*data));
- if (!data) {
- kfree(node);
- error = -ENXIO;
- goto err_dir;
- }
- } else
- data = __va(pa_data);
+ data = ioremap_cache(pa_data, sizeof(*data));
+ if (!data) {
+ kfree(node);
+ error = -ENXIO;
+ goto err_dir;
+ }
node->paddr = pa_data;
node->type = data->type;
@@ -143,8 +131,7 @@ static int __init create_setup_data_node
error = create_setup_data_node(d, no, node);
pa_data = data->next;
- if (PageHighMem(pg))
- iounmap(data);
+ iounmap(data);
if (error)
goto err_dir;
no++;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists