diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2006-12-07 02:14:08 +0100 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-07 02:14:08 +0100 |
commit | bd472c794bbf6771c3fc1c58f188bc16c393d2fe (patch) | |
tree | a7f45422f7df7fa2cd394dcaabe71cb592c2b7da /arch/i386/kernel/e820.c | |
parent | da181a8b3916aa7f2e3c5775d2bd2fe3454cf82d (diff) | |
download | linux-bd472c794bbf6771c3fc1c58f188bc16c393d2fe.tar.bz2 |
[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.c | 10 |
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 @@ #include <linux/mm.h> #include <linux/efi.h> #include <linux/pfn.h> +#include <linux/uaccess.h> #include <asm/pgtable.h> #include <asm/page.h> @@ -155,7 +156,14 @@ static struct resource standard_io_resources[] = { { .flags = IORESOURCE_BUSY | IORESOURCE_IO } }; -#define romsignature(x) (*(unsigned short *)(x) == 0xaa55) +static int romsignature(const unsigned char *x) +{ + unsigned short sig; + int ret = 0; + if (probe_kernel_address((const unsigned short *)x, sig) == 0) + ret = (sig == 0xaa55); + return ret; +} static int __init romchecksum(unsigned char *rom, unsigned long length) { |