[PATCH] Fix CONFIG_PARAVIRT for 2.6.19-rc5-mm1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 8 Nov 2006 23:39:04 -0800
Andrew Morton <akpm at osdl.org> wrote:

> > Can you please resend the patchkit with these patches included?
> > 
> > (and any further changes folded in into the respective patches) 
> > 
> 
> argh.
> 
> I'll do it.

OK, all done.

I kept prep-for-paravirt-be-careful-about-touching-bios.patch (below)
separate, because it's dependent on
x86_64-mm-i386-create-e820.c-to-handle-standard-io-mem-resources.patch.  It
could be folded into one of the other patches I guess.

So I have:

paravirt-i386-header-and-stubs-for-paravirtualisation.patch
paravirt-i386-patch-inline-replacements-for.patch
paravirt-i386-more-generic-paravirtualization.patch
paravirt-i386-allow-selected-bug-checks-to-be.patch
paravirt-i386-allow-disabling-legacy-power.patch
paravirt-i386-add-apic-accessors-to-paravirt-ops.patch
paravirt-i386-add-mmu-virtualization-to.patch
prep-for-paravirt-be-careful-about-touching-bios.patch



From: Rusty Russell <rusty at rustcorp.com.au>

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 at osdl.org: fix unused var warning]
Signed-off-by: Jeremy Fitzhardinge <jeremy at xensource.com>
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy at goop.org>
Cc: Andi Kleen <ak at suse.de>
Signed-off-by: Andrew Morton <akpm at osdl.org>
---

 arch/i386/kernel/e820.c |    9 ++++++++-
 arch/i386/pci/pcbios.c  |   11 +++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff -puN arch/i386/kernel/e820.c~prep-for-paravirt-be-careful-about-touching-bios arch/i386/kernel/e820.c
--- a/arch/i386/kernel/e820.c~prep-for-paravirt-be-careful-about-touching-bios
+++ a/arch/i386/kernel/e820.c
@@ -155,7 +155,14 @@ static struct resource standard_io_resou
 	.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 (__get_user(sig, (const unsigned short *)x) == 0)
+		ret = (sig == 0xaa55);
+	return ret;
+}
 
 static int __init romchecksum(unsigned char *rom, unsigned long length)
 {
diff -puN arch/i386/pci/pcbios.c~prep-for-paravirt-be-careful-about-touching-bios arch/i386/pci/pcbios.c
--- a/arch/i386/pci/pcbios.c~prep-for-paravirt-be-careful-about-touching-bios
+++ a/arch/i386/pci/pcbios.c
@@ -5,6 +5,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <asm/uaccess.h>
 #include "pci.h"
 #include "pci-functions.h"
 
@@ -314,6 +315,10 @@ static struct pci_raw_ops * __devinit pc
 	for (check = (union bios32 *) __va(0xe0000);
 	     check <= (union bios32 *) __va(0xffff0);
 	     ++check) {
+		long sig;
+		if (__get_user(sig, &check->fields.signature))
+			continue;
+
 		if (check->fields.signature != BIOS32_SIGNATURE)
 			continue;
 		length = check->fields.length * 16;
@@ -331,11 +336,13 @@ static struct pci_raw_ops * __devinit pc
 		}
 		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;
_



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux