ia64/xen-unstable

changeset 11553:e50872355390

[LINUX] Update pci-mmconfig patch to refer to machine_e820 map on Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Sep 21 09:37:28 2006 +0100 (2006-09-21)
parents 1adaf06e8abc
children 69e52712fbc4
files patches/linux-2.6.16.29/pci-mmconfig-fix-from-2.6.17.patch
line diff
     1.1 --- a/patches/linux-2.6.16.29/pci-mmconfig-fix-from-2.6.17.patch	Thu Sep 21 09:37:03 2006 +0100
     1.2 +++ b/patches/linux-2.6.16.29/pci-mmconfig-fix-from-2.6.17.patch	Thu Sep 21 09:37:28 2006 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  diff -pruN ../orig-linux-2.6.16.29/arch/i386/pci/mmconfig.c ./arch/i386/pci/mmconfig.c
     1.5  --- ../orig-linux-2.6.16.29/arch/i386/pci/mmconfig.c	2006-09-12 19:02:10.000000000 +0100
     1.6 -+++ ./arch/i386/pci/mmconfig.c	2006-09-20 11:55:32.000000000 +0100
     1.7 ++++ ./arch/i386/pci/mmconfig.c	2006-09-21 09:35:27.000000000 +0100
     1.8  @@ -12,14 +12,22 @@
     1.9   #include <linux/pci.h>
    1.10   #include <linux/init.h>
    1.11 @@ -48,7 +48,7 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.12   
    1.13   	base = get_base_addr(seg, bus, devfn);
    1.14   	if (!base)
    1.15 -@@ -146,30 +156,62 @@ static struct pci_raw_ops pci_mmcfg = {
    1.16 +@@ -146,30 +156,66 @@ static struct pci_raw_ops pci_mmcfg = {
    1.17      Normally this can be expressed in the MCFG by not listing them
    1.18      and assigning suitable _SEGs, but this isn't implemented in some BIOS.
    1.19      Instead try to discover all devices on bus 0 that are unreachable using MM
    1.20 @@ -92,6 +92,10 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.21  -		pci_conf1_read(0, 0, PCI_DEVFN(i, 0), 0, 4, &val1);
    1.22  -		if (val1 == 0xffffffff)
    1.23  +/* NB. Ripped from arch/i386/kernel/setup.c for this Xen bugfix patch. */
    1.24 ++#ifdef CONFIG_XEN
    1.25 ++extern struct e820map machine_e820;
    1.26 ++#define e820 machine_e820
    1.27 ++#endif
    1.28  +static int __init
    1.29  +e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
    1.30  +{
    1.31 @@ -128,7 +132,7 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.32   }
    1.33   
    1.34   static int __init pci_mmcfg_init(void)
    1.35 -@@ -183,6 +225,15 @@ static int __init pci_mmcfg_init(void)
    1.36 +@@ -183,6 +229,15 @@ static int __init pci_mmcfg_init(void)
    1.37   	    (pci_mmcfg_config[0].base_address == 0))
    1.38   		goto out;
    1.39   
    1.40 @@ -146,7 +150,7 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.41   	pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
    1.42  diff -pruN ../orig-linux-2.6.16.29/arch/x86_64/pci/mmconfig.c ./arch/x86_64/pci/mmconfig.c
    1.43  --- ../orig-linux-2.6.16.29/arch/x86_64/pci/mmconfig.c	2006-09-12 19:02:10.000000000 +0100
    1.44 -+++ ./arch/x86_64/pci/mmconfig.c	2006-09-20 11:55:41.000000000 +0100
    1.45 ++++ ./arch/x86_64/pci/mmconfig.c	2006-09-21 09:35:40.000000000 +0100
    1.46  @@ -9,11 +9,19 @@
    1.47   #include <linux/init.h>
    1.48   #include <linux/acpi.h>
    1.49 @@ -191,7 +195,7 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.50   
    1.51   	addr = pci_dev_base(seg, bus, devfn);
    1.52   	if (!addr)
    1.53 -@@ -129,23 +140,52 @@ static struct pci_raw_ops pci_mmcfg = {
    1.54 +@@ -129,23 +140,56 @@ static struct pci_raw_ops pci_mmcfg = {
    1.55      Normally this can be expressed in the MCFG by not listing them
    1.56      and assigning suitable _SEGs, but this isn't implemented in some BIOS.
    1.57      Instead try to discover all devices on bus 0 that are unreachable using MM
    1.58 @@ -228,6 +232,10 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.59  -		pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1);
    1.60  -		if (val1 == 0xffffffff)
    1.61  +/* NB. Ripped from arch/x86_64/kernel/e820.c for this Xen bugfix patch. */
    1.62 ++#ifdef CONFIG_XEN
    1.63 ++extern struct e820map machine_e820;
    1.64 ++#define e820 machine_e820
    1.65 ++#endif
    1.66  +static int __init e820_all_mapped(unsigned long start, unsigned long end, unsigned type)
    1.67  +{
    1.68  +	int i;
    1.69 @@ -256,7 +264,7 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.70   }
    1.71   
    1.72   static int __init pci_mmcfg_init(void)
    1.73 -@@ -161,6 +201,15 @@ static int __init pci_mmcfg_init(void)
    1.74 +@@ -161,6 +205,15 @@ static int __init pci_mmcfg_init(void)
    1.75   	    (pci_mmcfg_config[0].base_address == 0))
    1.76   		return 0;
    1.77   
    1.78 @@ -272,7 +280,7 @@ diff -pruN ../orig-linux-2.6.16.29/arch/
    1.79   	/* RED-PEN i386 doesn't do _nocache right now */
    1.80   	pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL);
    1.81   	if (pci_mmcfg_virt == NULL) {
    1.82 -@@ -169,7 +218,8 @@ static int __init pci_mmcfg_init(void)
    1.83 +@@ -169,7 +222,8 @@ static int __init pci_mmcfg_init(void)
    1.84   	}
    1.85   	for (i = 0; i < pci_mmcfg_config_num; ++i) {
    1.86   		pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i];