ia64/xen-unstable

changeset 2108:6a95987050ca

bitkeeper revision 1.1159.1.2 (4113876512dMKuet45HFX0pB88bZlA)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xeno.bk-26dom0
into freefall.cl.cam.ac.uk:/local/scratch/cl349/xeno.bk-26dom0
author cl349@freefall.cl.cam.ac.uk
date Fri Aug 06 13:28:05 2004 +0000 (2004-08-06)
parents bf212ae2e94c cfe6d46a6298
children 8d3ff2e0b2e0
files .rootkeys linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pci.h xen/common/physdev.c
line diff
     1.1 --- a/.rootkeys	Fri Aug 06 12:39:03 2004 +0000
     1.2 +++ b/.rootkeys	Fri Aug 06 13:28:05 2004 +0000
     1.3 @@ -217,6 +217,7 @@ 40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6
     1.4  40f5623aFTyFTR-vdiA-KaGxk5JOKQ linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/msr.h
     1.5  40f5623adgjZq9nAgCt0IXdWl7udSA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/page.h
     1.6  40f5623a54NuG-7qHihGYmw4wWQnMA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/param.h
     1.7 +41137cc1kkvg0cg7uxddcEfjL7L67w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pci.h
     1.8  40f5623atCokYc2uCysSJ8jFO8TEsw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgalloc.h
     1.9  40f5623aEToIXouJgO-ao5d5pcEt1w linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
    1.10  40f5623aCCXRPlGpNthVXstGz9ZV3A linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pgtable.h
     2.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c	Fri Aug 06 12:39:03 2004 +0000
     2.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c	Fri Aug 06 13:28:05 2004 +0000
     2.3 @@ -422,15 +422,21 @@ void zap_low_mappings (void)
     2.4  void __init zone_sizes_init(void)
     2.5  {
     2.6  	unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
     2.7 -	unsigned int high, low;
     2.8 +	unsigned int max_dma, high, low;
     2.9  	
    2.10 +	max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
    2.11  	low = max_low_pfn;
    2.12  	high = highend_pfn;
    2.13  	
    2.14 -	zones_size[ZONE_NORMAL] = low;
    2.15 +	if (low < max_dma)
    2.16 +		zones_size[ZONE_DMA] = low;
    2.17 +	else {
    2.18 +		zones_size[ZONE_DMA] = max_dma;
    2.19 +		zones_size[ZONE_NORMAL] = low - max_dma;
    2.20  #ifdef CONFIG_HIGHMEM
    2.21 -	zones_size[ZONE_HIGHMEM] = high - low;
    2.22 +		zones_size[ZONE_HIGHMEM] = high - low;
    2.23  #endif
    2.24 +	}
    2.25  	free_area_init(zones_size);	
    2.26  }
    2.27  #else
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/pci.h	Fri Aug 06 13:28:05 2004 +0000
     3.3 @@ -0,0 +1,117 @@
     3.4 +#ifndef __i386_PCI_H
     3.5 +#define __i386_PCI_H
     3.6 +
     3.7 +#include <linux/config.h>
     3.8 +
     3.9 +#ifdef __KERNEL__
    3.10 +#include <linux/mm.h>		/* for struct page */
    3.11 +
    3.12 +/* Can be used to override the logic in pci_scan_bus for skipping
    3.13 +   already-configured bus numbers - to be used for buggy BIOSes
    3.14 +   or architectures with incomplete PCI setup by the loader */
    3.15 +
    3.16 +#ifdef CONFIG_PCI
    3.17 +extern unsigned int pcibios_assign_all_busses(void);
    3.18 +#else
    3.19 +#define pcibios_assign_all_busses()	0
    3.20 +#endif
    3.21 +#define pcibios_scan_all_fns(a, b)	0
    3.22 +
    3.23 +extern unsigned long pci_mem_start;
    3.24 +#define PCIBIOS_MIN_IO		0x1000
    3.25 +#define PCIBIOS_MIN_MEM		(pci_mem_start)
    3.26 +
    3.27 +#define PCIBIOS_MIN_CARDBUS_IO	0x4000
    3.28 +
    3.29 +void pcibios_config_init(void);
    3.30 +struct pci_bus * pcibios_scan_root(int bus);
    3.31 +
    3.32 +void pcibios_set_master(struct pci_dev *dev);
    3.33 +void pcibios_penalize_isa_irq(int irq);
    3.34 +struct irq_routing_table *pcibios_get_irq_routing_table(void);
    3.35 +int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
    3.36 +
    3.37 +/* Dynamic DMA mapping stuff.
    3.38 + * i386 has everything mapped statically.
    3.39 + */
    3.40 +
    3.41 +#include <linux/types.h>
    3.42 +#include <linux/slab.h>
    3.43 +#include <asm/scatterlist.h>
    3.44 +#include <linux/string.h>
    3.45 +#include <asm/io.h>
    3.46 +
    3.47 +struct pci_dev;
    3.48 +
    3.49 +/* The PCI address space does equal the physical memory
    3.50 + * address space.  The networking and block device layers use
    3.51 + * this boolean for bounce buffer decisions.
    3.52 + */
    3.53 +#define PCI_DMA_BUS_IS_PHYS	(1)
    3.54 +
    3.55 +/* pci_unmap_{page,single} is a nop so... */
    3.56 +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
    3.57 +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
    3.58 +#define pci_unmap_addr(PTR, ADDR_NAME)		(0)
    3.59 +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)	do { } while (0)
    3.60 +#define pci_unmap_len(PTR, LEN_NAME)		(0)
    3.61 +#define pci_unmap_len_set(PTR, LEN_NAME, VAL)	do { } while (0)
    3.62 +
    3.63 +/* This is always fine. */
    3.64 +#define pci_dac_dma_supported(pci_dev, mask)	(1)
    3.65 +
    3.66 +static inline dma64_addr_t
    3.67 +pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
    3.68 +{
    3.69 +	return ((dma64_addr_t) page_to_phys(page) +
    3.70 +		(dma64_addr_t) offset);
    3.71 +}
    3.72 +
    3.73 +static inline struct page *
    3.74 +pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
    3.75 +{
    3.76 +	return pfn_to_page(dma_addr >> PAGE_SHIFT);
    3.77 +}
    3.78 +
    3.79 +static inline unsigned long
    3.80 +pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
    3.81 +{
    3.82 +	return (dma_addr & ~PAGE_MASK);
    3.83 +}
    3.84 +
    3.85 +static inline void
    3.86 +pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
    3.87 +{
    3.88 +}
    3.89 +
    3.90 +static inline void
    3.91 +pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
    3.92 +{
    3.93 +	flush_write_buffers();
    3.94 +}
    3.95 +
    3.96 +#define HAVE_PCI_MMAP
    3.97 +extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
    3.98 +			       enum pci_mmap_state mmap_state, int write_combine);
    3.99 +
   3.100 +
   3.101 +static inline void pcibios_add_platform_entries(struct pci_dev *dev)
   3.102 +{
   3.103 +}
   3.104 +
   3.105 +#endif /* __KERNEL__ */
   3.106 +
   3.107 +/* implement the pci_ DMA API in terms of the generic device dma_ one */
   3.108 +#include <asm-generic/pci-dma-compat.h>
   3.109 +
   3.110 +/* generic pci stuff */
   3.111 +#include <asm-generic/pci.h>
   3.112 +
   3.113 +/* On Xen we have to scan all functions since Xen hides bridges from
   3.114 + * us.  If a bridge is at fn=0 and that slot has a multifunction
   3.115 + * device, we won't find the additional devices without scanning all
   3.116 + * functions. */
   3.117 +#undef pcibios_scan_all_fns
   3.118 +#define pcibios_scan_all_fns(a, b)	1
   3.119 +
   3.120 +#endif /* __i386_PCI_H */
     4.1 --- a/xen/common/physdev.c	Fri Aug 06 12:39:03 2004 +0000
     4.2 +++ b/xen/common/physdev.c	Fri Aug 06 13:28:05 2004 +0000
     4.3 @@ -734,7 +734,19 @@ void physdev_init_dom0(struct domain *p)
     4.4              continue;
     4.5          }
     4.6  
     4.7 -        /* Skip bridges and other peculiarities for now. */
     4.8 +        /* Skip bridges and other peculiarities for now.
     4.9 +         *
    4.10 +         * Note that this can prevent the guest from detecting devices
    4.11 +         * with fn>0 on slots where the fn=0 device is a bridge.  We
    4.12 +         * can identify such slots by looking at the multifunction bit
    4.13 +         * (top bit of hdr_type, masked out in dev->hdr_type).
    4.14 +         *
    4.15 +         * In Linux2.4 we find all devices because the detection code
    4.16 +         * scans all functions if the read of the fn=0 device's header
    4.17 +         * type fails.
    4.18 +         *
    4.19 +         * In Linux2.6 we set pcibios_scan_all_fns().
    4.20 +         */
    4.21          if ( dev->hdr_type != PCI_HEADER_TYPE_NORMAL )
    4.22              continue;
    4.23          pdev = xmalloc(sizeof(phys_dev_t));