ia64/linux-2.6.18-xen.hg

changeset 642:cdd156cb645b

merge with linux-2.6.18-xen.hg
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Aug 11 11:05:57 2008 +0900 (2008-08-11)
parents a18df47f671b 56902bb0ce6d
children 1c928f28914a
files
line diff
     1.1 --- a/arch/i386/Kconfig	Fri Aug 08 11:39:35 2008 +0900
     1.2 +++ b/arch/i386/Kconfig	Mon Aug 11 11:05:57 2008 +0900
     1.3 @@ -397,7 +397,7 @@ config I8K
     1.4  
     1.5  config X86_REBOOTFIXUPS
     1.6  	bool "Enable X86 board specific fixups for reboot"
     1.7 -	depends on X86
     1.8 +	depends on !X86_XEN
     1.9  	default n
    1.10  	---help---
    1.11  	  This enables chipset and/or board specific fixups to be done
    1.12 @@ -661,7 +661,6 @@ config MATH_EMULATION
    1.13  config MTRR
    1.14  	bool "MTRR (Memory Type Range Register) support"
    1.15  	depends on !XEN_UNPRIVILEGED_GUEST
    1.16 -	default y if X86_XEN
    1.17  	---help---
    1.18  	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
    1.19  	  the Memory Type Range Registers (MTRRs) may be used to control
    1.20 @@ -781,6 +780,7 @@ config CRASH_DUMP
    1.21  	bool "kernel crash dumps (EXPERIMENTAL)"
    1.22  	depends on EXPERIMENTAL
    1.23  	depends on HIGHMEM
    1.24 +	depends on !XEN
    1.25  	help
    1.26  	  Generate crash dump after being started by kexec.
    1.27  
     2.1 --- a/arch/i386/kernel/setup-xen.c	Fri Aug 08 11:39:35 2008 +0900
     2.2 +++ b/arch/i386/kernel/setup-xen.c	Mon Aug 11 11:05:57 2008 +0900
     2.3 @@ -405,7 +405,7 @@ shared_info_t *HYPERVISOR_shared_info = 
     2.4  EXPORT_SYMBOL(HYPERVISOR_shared_info);
     2.5  
     2.6  unsigned long *phys_to_machine_mapping;
     2.7 -unsigned long *pfn_to_mfn_frame_list_list, *pfn_to_mfn_frame_list[16];
     2.8 +unsigned long *pfn_to_mfn_frame_list_list, **pfn_to_mfn_frame_list;
     2.9  EXPORT_SYMBOL(phys_to_machine_mapping);
    2.10  
    2.11  /* Raw start-of-day parameters from the hypervisor. */
    2.12 @@ -831,6 +831,7 @@ static void __init parse_cmdline_early (
    2.13  			}
    2.14  		}
    2.15  
    2.16 +#ifndef CONFIG_XEN
    2.17  		else if (!memcmp(from, "memmap=", 7)) {
    2.18  			if (to != command_line)
    2.19  				to--;
    2.20 @@ -872,6 +873,7 @@ static void __init parse_cmdline_early (
    2.21  				}
    2.22  			}
    2.23  		}
    2.24 +#endif
    2.25  
    2.26  		else if (!memcmp(from, "noexec=", 7))
    2.27  			noexec_setup(from + 7);
    2.28 @@ -1617,7 +1619,7 @@ void __init setup_arch(char **cmdline_p)
    2.29  	int i, j, k, fpp;
    2.30  	struct physdev_set_iopl set_iopl;
    2.31  	unsigned long max_low_pfn;
    2.32 -	unsigned long p2m_pages;
    2.33 +	unsigned long p2m_pages, size;
    2.34  
    2.35  	/* Force a quick death if the kernel panics (not domain 0). */
    2.36  	extern int panic_timeout;
    2.37 @@ -1779,11 +1781,11 @@ void __init setup_arch(char **cmdline_p)
    2.38  	if (!xen_feature(XENFEAT_auto_translated_physmap)) {
    2.39  		phys_to_machine_mapping = alloc_bootmem_low_pages(
    2.40  		     max_pfn * sizeof(unsigned long));
    2.41 -		memset(phys_to_machine_mapping, ~0,
    2.42 -		       max_pfn * sizeof(unsigned long));
    2.43  		memcpy(phys_to_machine_mapping,
    2.44  		       (unsigned long *)xen_start_info->mfn_list,
    2.45  		       p2m_pages * sizeof(unsigned long));
    2.46 +		memset(phys_to_machine_mapping + p2m_pages, ~0,
    2.47 +		       (max_pfn - p2m_pages) * sizeof(unsigned long));
    2.48  		free_bootmem(
    2.49  		     __pa(xen_start_info->mfn_list),
    2.50  		     PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
    2.51 @@ -1793,13 +1795,18 @@ void __init setup_arch(char **cmdline_p)
    2.52  		 * Initialise the list of the frames that specify the list of
    2.53  		 * frames that make up the p2m table. Used by save/restore
    2.54  		 */
    2.55 -		pfn_to_mfn_frame_list_list = alloc_bootmem_low_pages(PAGE_SIZE);
    2.56 +		fpp = PAGE_SIZE/sizeof(unsigned long);
    2.57 +		size = (max_pfn + fpp - 1) / fpp;
    2.58 +		size = (size + fpp - 1) / fpp;
    2.59 +		size *= sizeof(unsigned long);
    2.60 +		BUG_ON(size > PAGE_SIZE);
    2.61 +		pfn_to_mfn_frame_list_list = alloc_bootmem_low_pages(size);
    2.62 +		pfn_to_mfn_frame_list = alloc_bootmem_low(size);
    2.63  
    2.64 -		fpp = PAGE_SIZE/sizeof(unsigned long);
    2.65  		for (i=0, j=0, k=-1; i< max_pfn; i+=fpp, j++) {
    2.66  			if ((j % fpp) == 0) {
    2.67  				k++;
    2.68 -				BUG_ON(k>=16);
    2.69 +				BUG_ON(k * sizeof(unsigned long) >= size);
    2.70  				pfn_to_mfn_frame_list[k] =
    2.71  					alloc_bootmem_low_pages(PAGE_SIZE);
    2.72  				pfn_to_mfn_frame_list_list[k] =
     3.1 --- a/arch/i386/kernel/time-xen.c	Fri Aug 08 11:39:35 2008 +0900
     3.2 +++ b/arch/i386/kernel/time-xen.c	Mon Aug 11 11:05:57 2008 +0900
     3.3 @@ -314,21 +314,28 @@ static void get_time_values_from_xen(uns
     3.4  {
     3.5  	struct vcpu_time_info   *src;
     3.6  	struct shadow_time_info *dst;
     3.7 +	unsigned long flags;
     3.8 +	u32 pre_version, post_version;
     3.9  
    3.10  	src = &vcpu_info(cpu)->time;
    3.11  	dst = &per_cpu(shadow_time, cpu);
    3.12  
    3.13 +	local_irq_save(flags);
    3.14 +
    3.15  	do {
    3.16 -		dst->version = src->version;
    3.17 +		pre_version = dst->version = src->version;
    3.18  		rmb();
    3.19  		dst->tsc_timestamp     = src->tsc_timestamp;
    3.20  		dst->system_timestamp  = src->system_time;
    3.21  		dst->tsc_to_nsec_mul   = src->tsc_to_system_mul;
    3.22  		dst->tsc_shift         = src->tsc_shift;
    3.23  		rmb();
    3.24 -	} while ((src->version & 1) | (dst->version ^ src->version));
    3.25 +		post_version = src->version;
    3.26 +	} while ((pre_version & 1) | (pre_version ^ post_version));
    3.27  
    3.28  	dst->tsc_to_usec_mul = dst->tsc_to_nsec_mul / 1000;
    3.29 +
    3.30 +	local_irq_restore(flags);
    3.31  }
    3.32  
    3.33  static inline int time_values_up_to_date(unsigned int cpu)
     4.1 --- a/arch/x86_64/kernel/e820-xen.c	Fri Aug 08 11:39:35 2008 +0900
     4.2 +++ b/arch/x86_64/kernel/e820-xen.c	Mon Aug 11 11:05:57 2008 +0900
     4.3 @@ -16,6 +16,7 @@
     4.4  #include <linux/string.h>
     4.5  #include <linux/kexec.h>
     4.6  #include <linux/module.h>
     4.7 +#include <linux/mm.h>
     4.8  
     4.9  #include <asm/pgtable.h>
    4.10  #include <asm/page.h>
    4.11 @@ -703,6 +704,24 @@ void __init parse_memopt(char *p, char *
    4.12  	i = e820.nr_map-1;
    4.13  	current_end = e820.map[i].addr + e820.map[i].size;
    4.14  
    4.15 +	/*
    4.16 +	 * A little less than 2% of available memory are needed for page
    4.17 +	 * tables, p2m map, and mem_map. Hence the maximum amount of memory
    4.18 +	 * we can potentially balloon up to cannot exceed about 50 times
    4.19 +	 * what we've been given initially.
    4.20 +	 */
    4.21 +#define PAGE_OVERHEAD (PAGE_SIZE \
    4.22 +		       / (sizeof(pte_t) + sizeof(long) + sizeof(struct page)))
    4.23 +	if (end_user_pfn / (PAGE_OVERHEAD - 1) > xen_start_info->nr_pages) {
    4.24 +		end = (xen_start_info->nr_pages * (PAGE_OVERHEAD - 1))
    4.25 +		      << PAGE_SHIFT;
    4.26 +		printk(KERN_WARNING "mem=%lu is invalid for an initial"
    4.27 +				    " allocation of %lu, using %lu\n",
    4.28 +		       end_user_pfn << PAGE_SHIFT,
    4.29 +		       xen_start_info->nr_pages << PAGE_SHIFT, end);
    4.30 +		end_user_pfn = end >> PAGE_SHIFT;
    4.31 +	}
    4.32 +
    4.33  	if (current_end < end) {
    4.34  		/*
    4.35                   * The e820 map ends before our requested size so
    4.36 @@ -715,6 +734,7 @@ void __init parse_memopt(char *p, char *
    4.37  	}
    4.38  } 
    4.39  
    4.40 +#ifndef CONFIG_XEN
    4.41  void __init parse_memmapopt(char *p, char **from)
    4.42  {
    4.43  	unsigned long long start_at, mem_size;
    4.44 @@ -735,6 +755,7 @@ void __init parse_memmapopt(char *p, cha
    4.45  	}
    4.46  	p = *from;
    4.47  }
    4.48 +#endif
    4.49  
    4.50  unsigned long pci_mem_start = 0xaeedbabe;
    4.51  EXPORT_SYMBOL(pci_mem_start);
     5.1 --- a/arch/x86_64/kernel/setup-xen.c	Fri Aug 08 11:39:35 2008 +0900
     5.2 +++ b/arch/x86_64/kernel/setup-xen.c	Mon Aug 11 11:05:57 2008 +0900
     5.3 @@ -97,7 +97,7 @@ static struct notifier_block xen_panic_b
     5.4  };
     5.5  
     5.6  unsigned long *phys_to_machine_mapping;
     5.7 -unsigned long *pfn_to_mfn_frame_list_list, *pfn_to_mfn_frame_list[512];
     5.8 +unsigned long *pfn_to_mfn_frame_list_list, **pfn_to_mfn_frame_list;
     5.9  
    5.10  EXPORT_SYMBOL(phys_to_machine_mapping);
    5.11  
    5.12 @@ -419,6 +419,7 @@ static __init void parse_cmdline_early (
    5.13  		if (!memcmp(from, "mem=", 4))
    5.14  			parse_memopt(from+4, &from); 
    5.15  
    5.16 +#ifndef CONFIG_XEN
    5.17  		if (!memcmp(from, "memmap=", 7)) {
    5.18  			/* exactmap option is for used defined memory */
    5.19  			if (!memcmp(from+7, "exactmap", 8)) {
    5.20 @@ -440,6 +441,7 @@ static __init void parse_cmdline_early (
    5.21  				userdef = 1;
    5.22  			}
    5.23  		}
    5.24 +#endif
    5.25  
    5.26  #ifdef CONFIG_NUMA
    5.27  		if (!memcmp(from, "numa=", 5))
    5.28 @@ -776,7 +778,7 @@ void __init setup_arch(char **cmdline_p)
    5.29  #ifdef CONFIG_XEN
    5.30  	{
    5.31  		int i, j, k, fpp;
    5.32 -		unsigned long p2m_pages;
    5.33 +		unsigned long p2m_pages, size;
    5.34  
    5.35  		p2m_pages = end_pfn;
    5.36  		if (xen_start_info->nr_pages > end_pfn) {
    5.37 @@ -808,11 +810,11 @@ void __init setup_arch(char **cmdline_p)
    5.38  			/* Make sure we have a large enough P->M table. */
    5.39  			phys_to_machine_mapping = alloc_bootmem_pages(
    5.40  				end_pfn * sizeof(unsigned long));
    5.41 -			memset(phys_to_machine_mapping, ~0,
    5.42 -			       end_pfn * sizeof(unsigned long));
    5.43  			memcpy(phys_to_machine_mapping,
    5.44  			       (unsigned long *)xen_start_info->mfn_list,
    5.45  			       p2m_pages * sizeof(unsigned long));
    5.46 +			memset(phys_to_machine_mapping + p2m_pages, ~0,
    5.47 +			       (end_pfn - p2m_pages) * sizeof(unsigned long));
    5.48  			free_bootmem(
    5.49  				__pa(xen_start_info->mfn_list),
    5.50  				PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
    5.51 @@ -823,13 +825,22 @@ void __init setup_arch(char **cmdline_p)
    5.52  			 * list of frames that make up the p2m table. Used by
    5.53                           * save/restore.
    5.54  			 */
    5.55 -			pfn_to_mfn_frame_list_list = alloc_bootmem_pages(PAGE_SIZE);
    5.56 +			fpp = PAGE_SIZE/sizeof(unsigned long);
    5.57 +			size = (max_pfn + fpp - 1) / fpp;
    5.58 +			size = (size + fpp - 1) / fpp;
    5.59 +			size *= sizeof(unsigned long);
    5.60 +			pfn_to_mfn_frame_list_list = alloc_bootmem_pages(size);
    5.61 +			if (size > PAGE_SIZE
    5.62 +			    && xen_create_contiguous_region((unsigned long)
    5.63 +							    pfn_to_mfn_frame_list_list,
    5.64 +							    get_order(size), 0))
    5.65 +				BUG();
    5.66 +			pfn_to_mfn_frame_list = alloc_bootmem(size);
    5.67  
    5.68 -			fpp = PAGE_SIZE/sizeof(unsigned long);
    5.69  			for (i=0, j=0, k=-1; i< end_pfn; i+=fpp, j++) {
    5.70  				if ((j % fpp) == 0) {
    5.71  					k++;
    5.72 -					BUG_ON(k>=fpp);
    5.73 +					BUG_ON(k * sizeof(unsigned long) >= size);
    5.74  					pfn_to_mfn_frame_list[k] =
    5.75  						alloc_bootmem_pages(PAGE_SIZE);
    5.76  					pfn_to_mfn_frame_list_list[k] =
     6.1 --- a/arch/x86_64/mm/init-xen.c	Fri Aug 08 11:39:35 2008 +0900
     6.2 +++ b/arch/x86_64/mm/init-xen.c	Mon Aug 11 11:05:57 2008 +0900
     6.3 @@ -610,6 +610,13 @@ static void __init extend_init_mapping(u
     6.4  	while (va < (__START_KERNEL_map
     6.5  		     + (start_pfn << PAGE_SHIFT)
     6.6  		     + tables_space)) {
     6.7 +		if (!pmd_index(va) && !pte_index(va)) {
     6.8 +			page = (unsigned long *)init_level4_pgt;
     6.9 +			addr = page[pgd_index(va)];
    6.10 +			addr_to_page(addr, page);
    6.11 +			addr = page[pud_index(va)];
    6.12 +			addr_to_page(addr, page);
    6.13 +		}
    6.14  		pmd = (pmd_t *)&page[pmd_index(va)];
    6.15  		if (pmd_none(*pmd)) {
    6.16  			pte_page = alloc_static_page(&phys);
     7.1 --- a/drivers/acpi/processor_core.c	Fri Aug 08 11:39:35 2008 +0900
     7.2 +++ b/drivers/acpi/processor_core.c	Mon Aug 11 11:05:57 2008 +0900
     7.3 @@ -509,7 +509,9 @@ static int acpi_processor_get_info(struc
     7.4  		request_region(pr->throttling.address, 6, "ACPI CPU throttle");
     7.5  	}
     7.6  
     7.7 +#if defined(CONFIG_CPU_FREQ) || defined(CONFIG_PROCESSOR_EXTERNAL_CONTROL)
     7.8  	acpi_processor_ppc_has_changed(pr);
     7.9 +#endif
    7.10  	acpi_processor_get_throttling_info(pr);
    7.11  	acpi_processor_get_limit_info(pr);
    7.12  
     8.1 --- a/drivers/acpi/processor_extcntl.c	Fri Aug 08 11:39:35 2008 +0900
     8.2 +++ b/drivers/acpi/processor_extcntl.c	Mon Aug 11 11:05:57 2008 +0900
     8.3 @@ -30,6 +30,12 @@
     8.4  
     8.5  #include <acpi/processor.h>
     8.6  
     8.7 +#define ACPI_PROCESSOR_COMPONENT        0x01000000
     8.8 +#define ACPI_PROCESSOR_CLASS            "processor"
     8.9 +#define ACPI_PROCESSOR_DRIVER_NAME      "ACPI Processor Driver"
    8.10 +#define _COMPONENT              ACPI_PROCESSOR_COMPONENT
    8.11 +ACPI_MODULE_NAME("acpi_processor")
    8.12 +
    8.13  static int processor_extcntl_parse_csd(struct acpi_processor *pr);
    8.14  static int processor_extcntl_get_performance(struct acpi_processor *pr);
    8.15  /*
     9.1 --- a/drivers/char/Kconfig	Fri Aug 08 11:39:35 2008 +0900
     9.2 +++ b/drivers/char/Kconfig	Mon Aug 11 11:05:57 2008 +0900
     9.3 @@ -1005,7 +1005,7 @@ config MAX_RAW_DEVS
     9.4  config HPET
     9.5  	bool "HPET - High Precision Event Timer" if (X86 || IA64)
     9.6  	default n
     9.7 -	depends on ACPI
     9.8 +	depends on ACPI && !XEN
     9.9  	help
    9.10  	  If you say Y here, you will have a miscdevice named "/dev/hpet/".  Each
    9.11  	  open selects one of the timers supported by the HPET.  The timers are
    10.1 --- a/drivers/video/Kconfig	Fri Aug 08 11:39:35 2008 +0900
    10.2 +++ b/drivers/video/Kconfig	Mon Aug 11 11:05:57 2008 +0900
    10.3 @@ -1254,7 +1254,7 @@ config FB_CYBLA
    10.4  	tristate "Cyberblade/i1 support"
    10.5  	depends on FB && PCI && X86_32 && !64BIT
    10.6  	select FB_CFB_IMAGEBLIT
    10.7 -	select VIDEO_SELECT
    10.8 +	select VIDEO_SELECT if !XEN
    10.9  	---help---
   10.10  	  This driver is supposed to support the Trident Cyberblade/i1
   10.11  	  graphics core integrated in the VIA VT8601A North Bridge,
    11.1 --- a/drivers/xen/core/machine_reboot.c	Fri Aug 08 11:39:35 2008 +0900
    11.2 +++ b/drivers/xen/core/machine_reboot.c	Mon Aug 11 11:05:57 2008 +0900
    11.3 @@ -74,7 +74,7 @@ static void post_suspend(int suspend_can
    11.4  	unsigned long shinfo_mfn;
    11.5  	extern unsigned long max_pfn;
    11.6  	extern unsigned long *pfn_to_mfn_frame_list_list;
    11.7 -	extern unsigned long *pfn_to_mfn_frame_list[];
    11.8 +	extern unsigned long **pfn_to_mfn_frame_list;
    11.9  
   11.10  	if (suspend_cancelled) {
   11.11  		xen_start_info->store_mfn =
   11.12 @@ -184,14 +184,9 @@ static int take_machine_down(void *_susp
   11.13  		 * We do it here just in case, but there's no need if we are
   11.14  		 * in fast-suspend mode as that implies a new enough Xen.
   11.15  		 */
   11.16 -		if (!suspend->fast_suspend) {
   11.17 -			struct mmuext_op op;
   11.18 -			op.cmd = MMUEXT_NEW_USER_BASEPTR;
   11.19 -			op.arg1.mfn = pfn_to_mfn(__pa(__user_pgd(
   11.20 -				current->active_mm->pgd)) >> PAGE_SHIFT);
   11.21 -			if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
   11.22 -				BUG();
   11.23 -		}
   11.24 +		if (!suspend->fast_suspend)
   11.25 +			xen_new_user_pt(__pa(__user_pgd(
   11.26 +				current->active_mm->pgd)));
   11.27  #endif
   11.28  	}
   11.29  	time_resume();
    12.1 --- a/drivers/xen/core/pci.c	Fri Aug 08 11:39:35 2008 +0900
    12.2 +++ b/drivers/xen/core/pci.c	Mon Aug 11 11:05:57 2008 +0900
    12.3 @@ -23,9 +23,13 @@ static int pci_bus_probe_wrapper(struct 
    12.4  		return r;
    12.5  
    12.6  	r = pci_bus_probe(dev);
    12.7 -	if (r)
    12.8 -		WARN_ON(HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_remove,
    12.9 -					      &manage_pci));
   12.10 +	if (r) {
   12.11 +		int ret;
   12.12 +
   12.13 +		ret = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_remove,
   12.14 +					    &manage_pci);
   12.15 +		WARN_ON(ret && ret != -ENOSYS);
   12.16 +	}
   12.17  
   12.18  	return r;
   12.19  }
    13.1 --- a/drivers/xen/pciback/pci_stub.c	Fri Aug 08 11:39:35 2008 +0900
    13.2 +++ b/drivers/xen/pciback/pci_stub.c	Mon Aug 11 11:05:57 2008 +0900
    13.3 @@ -813,11 +813,10 @@ int pciback_get_owner(struct pci_dev *de
    13.4  
    13.5  	psdev = pcistub_device_find(pci_domain_nr(dev->bus), dev->bus->number,
    13.6  			PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
    13.7 -	/* XXX will other domain has pciback support ??? */
    13.8 -	if (!psdev || !psdev->pdev) {
    13.9 -		printk(KERN_WARNING "no ownder\n");
   13.10 +
   13.11 +	if (!psdev || !psdev->pdev)
   13.12  		return -1;
   13.13 -	}
   13.14 +
   13.15  	return psdev->pdev->xdev->otherend_id;
   13.16  }
   13.17  #endif
    14.1 --- a/include/asm-x86_64/mach-xen/asm/pgtable.h	Fri Aug 08 11:39:35 2008 +0900
    14.2 +++ b/include/asm-x86_64/mach-xen/asm/pgtable.h	Mon Aug 11 11:05:57 2008 +0900
    14.3 @@ -135,11 +135,11 @@ static inline void pgd_clear (pgd_t * pg
    14.4  #define FIRST_USER_ADDRESS	0
    14.5  
    14.6  #ifndef __ASSEMBLY__
    14.7 -#define MAXMEM		 0x3fffffffffffUL
    14.8 +#define MAXMEM		 0xdfffffffffUL
    14.9  #define VMALLOC_START    0xffffc20000000000UL
   14.10  #define VMALLOC_END      0xffffe1ffffffffffUL
   14.11  #define MODULES_VADDR    0xffffffff88000000UL
   14.12 -#define MODULES_END      0xfffffffffff00000UL
   14.13 +#define MODULES_END      0xffffffffff000000UL
   14.14  #define MODULES_LEN   (MODULES_END - MODULES_VADDR)
   14.15  
   14.16  #define _PAGE_BIT_PRESENT	0