ia64/xen-unstable

changeset 350:4fd13119bcc6

bitkeeper revision 1.160.1.3 (3e93f829-ne467JH-6UdjBVdjZRCgw)

a few tricks to avoid memory problems.
BUG remains: there is nothing to stop the kernel stack growing too big (i.e. to nearly 8k); if it does, it will overwrite the idle0_task task struct which it shares a page with.
If you see a page fault in the scheduler (prev_task, next_task corrupted), suspect this bug.
author jws@cairnwell.research
date Wed Apr 09 10:38:33 2003 +0000 (2003-04-09)
parents 15ffd7ee35df
children 56fce5176629 e36f732a6380 8fec4dd2cebb
files xen/arch/i386/ioremap.c xen/drivers/pci/pci.c
line diff
     1.1 --- a/xen/arch/i386/ioremap.c	Thu Apr 03 21:21:26 2003 +0000
     1.2 +++ b/xen/arch/i386/ioremap.c	Wed Apr 09 10:38:33 2003 +0000
     1.3 @@ -50,6 +50,10 @@ void * __ioremap(unsigned long phys_addr
     1.4      if (phys_addr >= 0xA0000 && last_addr < 0x100000)
     1.5          return phys_to_virt(phys_addr);
     1.6  
     1.7 +    if(remap_base + size > IOREMAP_VIRT_END) {
     1.8 +      printk("ioremap: going past end of reserved space!\n");
     1.9 +      return NULL;
    1.10 +    }
    1.11  #if 0
    1.12      /*
    1.13       * Don't allow anybody to remap normal RAM that we're using..
     2.1 --- a/xen/drivers/pci/pci.c	Thu Apr 03 21:21:26 2003 +0000
     2.2 +++ b/xen/drivers/pci/pci.c	Wed Apr 09 10:38:33 2003 +0000
     2.3 @@ -1505,21 +1505,26 @@ unsigned int __devinit pci_do_scan_bus(s
     2.4  {
     2.5  	unsigned int devfn, max, pass;
     2.6  	struct list_head *ln;
     2.7 -	struct pci_dev *dev, dev0;
     2.8 +	struct pci_dev *dev, *dev0;
     2.9  
    2.10  	DBG("Scanning bus %02x\n", bus->number);
    2.11  	max = bus->secondary;
    2.12  
    2.13  	/* Create a device template */
    2.14 -	memset(&dev0, 0, sizeof(dev0));
    2.15 -	dev0.bus = bus;
    2.16 -	dev0.sysdata = bus->sysdata;
    2.17 +	dev0 = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
    2.18 +	if(!dev0) {
    2.19 +	  panic("Out of memory scanning PCI bus!\n");
    2.20 +	}
    2.21 +	memset(dev0, 0, sizeof(struct pci_dev));
    2.22 +	dev0->bus = bus;
    2.23 +	dev0->sysdata = bus->sysdata;
    2.24  
    2.25  	/* Go find them, Rover! */
    2.26  	for (devfn = 0; devfn < 0x100; devfn += 8) {
    2.27 -		dev0.devfn = devfn;
    2.28 -		pci_scan_slot(&dev0);
    2.29 +		dev0->devfn = devfn;
    2.30 +		pci_scan_slot(dev0);
    2.31  	}
    2.32 +	kfree(dev0);
    2.33  
    2.34  	/*
    2.35  	 * After performing arch-dependent fixup of the bus, look behind