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/pci | |
parent | da181a8b3916aa7f2e3c5775d2bd2fe3454cf82d (diff) | |
download | kernel_samsung_smdk4412-bd472c794bbf6771c3fc1c58f188bc16c393d2fe.zip kernel_samsung_smdk4412-bd472c794bbf6771c3fc1c58f188bc16c393d2fe.tar.gz kernel_samsung_smdk4412-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/pci')
-rw-r--r-- | arch/i386/pci/pcbios.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c index ed1512a..5f51934 100644 --- a/arch/i386/pci/pcbios.c +++ b/arch/i386/pci/pcbios.c @@ -5,6 +5,7 @@ #include <linux/pci.h> #include <linux/init.h> #include <linux/module.h> +#include <linux/uaccess.h> #include "pci.h" #include "pci-functions.h" @@ -314,6 +315,10 @@ static struct pci_raw_ops * __devinit pci_find_bios(void) for (check = (union bios32 *) __va(0xe0000); check <= (union bios32 *) __va(0xffff0); ++check) { + long sig; + if (probe_kernel_address(&check->fields.signature, sig)) + continue; + if (check->fields.signature != BIOS32_SIGNATURE) continue; length = check->fields.length * 16; @@ -331,11 +336,13 @@ static struct pci_raw_ops * __devinit pci_find_bios(void) } DBG("PCI: BIOS32 Service Directory structure at 0x%p\n", check); if (check->fields.entry >= 0x100000) { - printk("PCI: BIOS32 entry (0x%p) in high memory, cannot use.\n", check); + printk("PCI: BIOS32 entry (0x%p) in high memory, " + "cannot use.\n", check); return NULL; } else { unsigned long bios32_entry = check->fields.entry; - DBG("PCI: BIOS32 Service Directory entry at 0x%lx\n", bios32_entry); + DBG("PCI: BIOS32 Service Directory entry at 0x%lx\n", + bios32_entry); bios32_indirect.address = bios32_entry + PAGE_OFFSET; if (check_pcibios()) return &pci_bios_access; |