aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/e820.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2006-12-06 20:14:08 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:08 -0500
commitbd472c794bbf6771c3fc1c58f188bc16c393d2fe (patch)
treea7f45422f7df7fa2cd394dcaabe71cb592c2b7da /arch/i386/kernel/e820.c
parentda181a8b3916aa7f2e3c5775d2bd2fe3454cf82d (diff)
[PATCH] paravirt: Be careful about touching BIOS address space
BIOS ROM areas may not be mapped into the guest address space, so be careful when touching those addresses to make sure they appear to be mapped. [akpm@osdl.org: fix unused var warning] AK: Changed __get_user to probe_kernel_address Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch/i386/kernel/e820.c')
-rw-r--r--arch/i386/kernel/e820.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/i386/kernel/e820.c b/arch/i386/kernel/e820.c
index b755255f2721..b704790f7969 100644
--- a/arch/i386/kernel/e820.c
+++ b/arch/i386/kernel/e820.c
@@ -9,6 +9,7 @@
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/efi.h> 10#include <linux/efi.h>
11#include <linux/pfn.h> 11#include <linux/pfn.h>
12#include <linux/uaccess.h>
12 13
13#include <asm/pgtable.h> 14#include <asm/pgtable.h>
14#include <asm/page.h> 15#include <asm/page.h>
@@ -155,7 +156,14 @@ static struct resource standard_io_resources[] = { {
155 .flags = IORESOURCE_BUSY | IORESOURCE_IO 156 .flags = IORESOURCE_BUSY | IORESOURCE_IO
156} }; 157} };
157 158
158#define romsignature(x) (*(unsigned short *)(x) == 0xaa55) 159static int romsignature(const unsigned char *x)
160{
161 unsigned short sig;
162 int ret = 0;
163 if (probe_kernel_address((const unsigned short *)x, sig) == 0)
164 ret = (sig == 0xaa55);
165 return ret;
166}
159 167
160static int __init romchecksum(unsigned char *rom, unsigned long length) 168static int __init romchecksum(unsigned char *rom, unsigned long length)
161{ 169{