ia64/linux-2.6.18-xen.hg

changeset 43:245902ee7ce0

[IA64] Pull in changes from xen-ia64 tree

Includes changes to old sparse tree and interface changes from
xen-ia64-unstable.hg csets:
15115:24463758319b - 15169:8655f7b7d50c

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author Alex Williamson <alex.williamson@hp.com>
date Mon Jun 11 14:59:53 2007 -0600 (2007-06-11)
parents c09686d2bbff
children 50306c166500
files arch/ia64/kernel/setup.c arch/ia64/xen/hypervisor.c arch/ia64/xen/xcom_hcall.c arch/ia64/xen/xcom_mini.c arch/ia64/xen/xcom_privcmd.c arch/ia64/xen/xen_dma.c include/asm-ia64/hypercall.h include/asm-ia64/hypervisor.h include/asm-ia64/pal.h include/xen/interface/arch-ia64.h include/xen/interface/foreign/reference.size
line diff
     1.1 --- a/arch/ia64/kernel/setup.c	Mon Jun 11 15:56:06 2007 +0100
     1.2 +++ b/arch/ia64/kernel/setup.c	Mon Jun 11 14:59:53 2007 -0600
     1.3 @@ -610,7 +610,7 @@ setup_arch (char **cmdline_p)
     1.4  #endif
     1.5  	paging_init();
     1.6  #ifdef CONFIG_XEN
     1.7 -	contiguous_bitmap_init(max_pfn);
     1.8 +	xen_contiguous_bitmap_init(max_pfn);
     1.9  #endif
    1.10  }
    1.11  
     2.1 --- a/arch/ia64/xen/hypervisor.c	Mon Jun 11 15:56:06 2007 +0100
     2.2 +++ b/arch/ia64/xen/hypervisor.c	Mon Jun 11 14:59:53 2007 -0600
     2.3 @@ -158,7 +158,7 @@ static void
     2.4  }
     2.5  
     2.6  void
     2.7 -contiguous_bitmap_init(unsigned long end_pfn)
     2.8 +xen_contiguous_bitmap_init(unsigned long end_pfn)
     2.9  {
    2.10  	unsigned long size = (end_pfn + 2 * BITS_PER_LONG) >> 3;
    2.11  #ifndef CONFIG_VIRTUAL_MEM_MAP
    2.12 @@ -1208,7 +1208,7 @@ xen_ia64_allocate_resource(unsigned long
    2.13  	struct resource* res;
    2.14  	int error;
    2.15  	
    2.16 -	res = kmalloc(sizeof(*res), GFP_KERNEL);
    2.17 +	res = kzalloc(sizeof(*res), GFP_KERNEL);
    2.18  	if (res == NULL)
    2.19  		return ERR_PTR(-ENOMEM);
    2.20  
     3.1 --- a/arch/ia64/xen/xcom_hcall.c	Mon Jun 11 15:56:06 2007 +0100
     3.2 +++ b/arch/ia64/xen/xcom_hcall.c	Mon Jun 11 14:59:53 2007 -0600
     3.3 @@ -395,3 +395,10 @@ xencomm_hypercall_vcpu_op(int cmd, int c
     3.4  	return xencomm_arch_hypercall_vcpu_op(cmd, cpu,
     3.5  					      xencomm_create_inline(arg));
     3.6  }
     3.7 +
     3.8 +int
     3.9 +xencomm_hypercall_fpswa_revision(unsigned int *revision)
    3.10 +{
    3.11 +	return xencomm_arch_hypercall_fpswa_revision(
    3.12 +		xencomm_create_inline(revision));
    3.13 +}
     4.1 --- a/arch/ia64/xen/xcom_mini.c	Mon Jun 11 15:56:06 2007 +0100
     4.2 +++ b/arch/ia64/xen/xcom_mini.c	Mon Jun 11 14:59:53 2007 -0600
     4.3 @@ -467,3 +467,19 @@ xencomm_mini_hypercall_sched_op(int cmd,
     4.4  	return xencomm_arch_hypercall_sched_op(cmd, desc);
     4.5  }
     4.6  EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_sched_op);
     4.7 +
     4.8 +int
     4.9 +xencomm_mini_hypercall_fpswa_revision(unsigned int *revision)
    4.10 +{
    4.11 +	int nbr_area = 2;
    4.12 +	struct xencomm_mini xc_area[2];
    4.13 +	struct xencomm_handle *desc;
    4.14 +	int rc;
    4.15 +
    4.16 +	rc = xencomm_create_mini(xc_area, &nbr_area,
    4.17 +				 revision, sizeof(*revision), &desc);
    4.18 +	if (rc)
    4.19 +		return rc;
    4.20 +	return xencomm_arch_hypercall_fpswa_revision(desc);
    4.21 +}
    4.22 +EXPORT_SYMBOL_GPL(xencomm_mini_hypercall_fpswa_revision);
     5.1 --- a/arch/ia64/xen/xcom_privcmd.c	Mon Jun 11 15:56:06 2007 +0100
     5.2 +++ b/arch/ia64/xen/xcom_privcmd.c	Mon Jun 11 14:59:53 2007 -0600
     5.3 @@ -430,6 +430,21 @@ xencomm_privcmd_memory_op(privcmd_hyperc
     5.4  
     5.5  		return ret;
     5.6  	}
     5.7 +	case XENMEM_maximum_gpfn:
     5.8 +	{
     5.9 +		domid_t kern_domid;
    5.10 +		domid_t __user *user_domid;
    5.11 +		struct xencomm_handle *desc;
    5.12 +
    5.13 +		user_domid = (domid_t __user *)hypercall->arg[1];
    5.14 +		if (copy_from_user(&kern_domid, user_domid, sizeof(domid_t)))
    5.15 +			return -EFAULT;
    5.16 +		desc = xencomm_create_inline(&kern_domid);
    5.17 +
    5.18 +		ret = xencomm_arch_hypercall_memory_op(cmd, desc);
    5.19 +
    5.20 +		return ret;
    5.21 +	}
    5.22  	case XENMEM_translate_gpfn_list:
    5.23  	{
    5.24  		xen_translate_gpfn_list_t kern_op;
    5.25 @@ -643,6 +658,38 @@ xencomm_privcmd_sched_op(privcmd_hyperca
    5.26  	return ret;
    5.27  }
    5.28  
    5.29 +static int
    5.30 +xencomm_privcmd_ia64_dom0vp_op(privcmd_hypercall_t *hypercall)
    5.31 +{
    5.32 +	int cmd = hypercall->arg[0];
    5.33 +	int ret;
    5.34 +	
    5.35 +	switch (cmd) {
    5.36 +	case IA64_DOM0VP_fpswa_revision: {
    5.37 +		unsigned int revision;
    5.38 +		unsigned int __user *revision_user =
    5.39 +			(unsigned int* __user)hypercall->arg[1];
    5.40 +		struct xencomm_handle *desc;
    5.41 +		ret = xencomm_create(&revision, sizeof(revision),
    5.42 +				     &desc, GFP_KERNEL);
    5.43 +		if (ret)
    5.44 +			break;
    5.45 +		ret = xencomm_arch_hypercall_fpswa_revision(desc);
    5.46 +		xencomm_free(desc);
    5.47 +		if (ret)
    5.48 +			break;
    5.49 +		if (copy_to_user(revision_user, &revision, sizeof(revision)))
    5.50 +			ret = -EFAULT;
    5.51 +		break;
    5.52 +	}
    5.53 +	default:
    5.54 +		printk("%s: unknown IA64 DOM0VP op %d\n", __func__, cmd);
    5.55 +		ret = -EINVAL;
    5.56 +		break;
    5.57 +	}
    5.58 +	return ret;
    5.59 +}
    5.60 +
    5.61  int
    5.62  privcmd_hypercall(privcmd_hypercall_t *hypercall)
    5.63  {
    5.64 @@ -665,6 +712,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
    5.65  		return xencomm_privcmd_hvm_op(hypercall);
    5.66  	case __HYPERVISOR_sched_op:
    5.67  		return xencomm_privcmd_sched_op(hypercall);
    5.68 +	case __HYPERVISOR_ia64_dom0vp_op:
    5.69 +		return xencomm_privcmd_ia64_dom0vp_op(hypercall);
    5.70  	default:
    5.71  		printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op);
    5.72  		return -ENOSYS;
     6.1 --- a/arch/ia64/xen/xen_dma.c	Mon Jun 11 15:56:06 2007 +0100
     6.2 +++ b/arch/ia64/xen/xen_dma.c	Mon Jun 11 14:59:53 2007 -0600
     6.3 @@ -22,6 +22,7 @@
     6.4   * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     6.5   */
     6.6  
     6.7 +#include <linux/bitops.h>
     6.8  #include <linux/dma-mapping.h>
     6.9  #include <linux/mm.h>
    6.10  #include <asm/scatterlist.h>
    6.11 @@ -40,18 +41,18 @@ do {								\
    6.12   * when merged with upstream Linux.
    6.13   */
    6.14  static inline int
    6.15 -address_needs_mapping(struct device *hwdev, dma_addr_t addr)
    6.16 +address_needs_mapping(struct device *dev, dma_addr_t addr)
    6.17  {
    6.18  	dma_addr_t mask = 0xffffffff;
    6.19  
    6.20  	/* If the device has a mask, use it, otherwise default to 32 bits */
    6.21 -	if (hwdev && hwdev->dma_mask)
    6.22 -		mask = *hwdev->dma_mask;
    6.23 +	if (dev && dev->dma_mask)
    6.24 +		mask = *dev->dma_mask;
    6.25  	return (addr & ~mask) != 0;
    6.26  }
    6.27  
    6.28  int
    6.29 -xen_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
    6.30 +xen_map_sg(struct device *dev, struct scatterlist *sg, int nents,
    6.31  	   int direction)
    6.32  {
    6.33  	int i;
    6.34 @@ -60,7 +61,7 @@ xen_map_sg(struct device *hwdev, struct 
    6.35  		sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
    6.36  		sg[i].dma_length  = sg[i].length;
    6.37  
    6.38 -		IOMMU_BUG_ON(address_needs_mapping(hwdev, sg[i].dma_address));
    6.39 +		IOMMU_BUG_ON(address_needs_mapping(dev, sg[i].dma_address));
    6.40  	}
    6.41  
    6.42  	return nents;
    6.43 @@ -68,7 +69,7 @@ xen_map_sg(struct device *hwdev, struct 
    6.44  EXPORT_SYMBOL(xen_map_sg);
    6.45  
    6.46  void
    6.47 -xen_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
    6.48 +xen_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
    6.49  	     int direction)
    6.50  {
    6.51  }
    6.52 @@ -101,7 +102,7 @@ xen_alloc_coherent(struct device *dev, s
    6.53  		return NULL;
    6.54  
    6.55  	if (xen_create_contiguous_region(vaddr, order,
    6.56 -					 dev->coherent_dma_mask)) {
    6.57 +					 fls64(dev->coherent_dma_mask))) {
    6.58  		free_pages(vaddr, order);
    6.59  		return NULL;
    6.60  	}
     7.1 --- a/include/asm-ia64/hypercall.h	Mon Jun 11 15:56:06 2007 +0100
     7.2 +++ b/include/asm-ia64/hypercall.h	Mon Jun 11 14:59:53 2007 -0600
     7.3 @@ -382,6 +382,13 @@ xencomm_arch_hypercall_perfmon_op(unsign
     7.4  			   IA64_DOM0VP_perfmon, cmd, arg, count);
     7.5  }
     7.6  
     7.7 +static inline int
     7.8 +xencomm_arch_hypercall_fpswa_revision(struct xencomm_handle *arg)
     7.9 +{
    7.10 +	return _hypercall2(int, ia64_dom0vp_op,
    7.11 +			   IA64_DOM0VP_fpswa_revision, arg);
    7.12 +}
    7.13 +
    7.14  // for balloon driver
    7.15  #define HYPERVISOR_update_va_mapping(va, new_val, flags) (0)
    7.16  
    7.17 @@ -397,6 +404,7 @@ xencomm_arch_hypercall_perfmon_op(unsign
    7.18  #define HYPERVISOR_memory_op xencomm_mini_hypercall_memory_op
    7.19  #define HYPERVISOR_xenoprof_op xencomm_mini_hypercall_xenoprof_op
    7.20  #define HYPERVISOR_perfmon_op xencomm_mini_hypercall_perfmon_op
    7.21 +#define HYPERVISOR_fpswa_revision xencomm_mini_hypercall_fpswa_revision
    7.22  #else
    7.23  #define HYPERVISOR_sched_op xencomm_hypercall_sched_op
    7.24  #define HYPERVISOR_event_channel_op xencomm_hypercall_event_channel_op
    7.25 @@ -408,6 +416,7 @@ xencomm_arch_hypercall_perfmon_op(unsign
    7.26  #define HYPERVISOR_memory_op xencomm_hypercall_memory_op
    7.27  #define HYPERVISOR_xenoprof_op xencomm_hypercall_xenoprof_op
    7.28  #define HYPERVISOR_perfmon_op xencomm_hypercall_perfmon_op
    7.29 +#define HYPERVISOR_fpswa_revision xencomm_hypercall_fpswa_revision
    7.30  #endif
    7.31  
    7.32  #define HYPERVISOR_suspend xencomm_hypercall_suspend
     8.1 --- a/include/asm-ia64/hypervisor.h	Mon Jun 11 15:56:06 2007 +0100
     8.2 +++ b/include/asm-ia64/hypervisor.h	Mon Jun 11 14:59:53 2007 -0600
     8.3 @@ -145,6 +145,7 @@ int privcmd_mmap(struct file * file, str
     8.4  #define pfn_pte_ma(_x,_y)	__pte_ma(0)     /* unmodified use */
     8.5  
     8.6  #ifndef CONFIG_VMX_GUEST
     8.7 +void xen_contiguous_bitmap_init(unsigned long end_pfn);
     8.8  int __xen_create_contiguous_region(unsigned long vstart, unsigned int order, unsigned int address_bits);
     8.9  static inline int
    8.10  xen_create_contiguous_region(unsigned long vstart,
     9.1 --- a/include/asm-ia64/pal.h	Mon Jun 11 15:56:06 2007 +0100
     9.2 +++ b/include/asm-ia64/pal.h	Mon Jun 11 14:59:53 2007 -0600
     9.3 @@ -82,7 +82,6 @@
     9.4  #ifndef __ASSEMBLY__
     9.5  
     9.6  #include <linux/types.h>
     9.7 -#include <asm/processor.h>
     9.8  #include <asm/fpu.h>
     9.9  
    9.10  /*
    10.1 --- a/include/xen/interface/arch-ia64.h	Mon Jun 11 15:56:06 2007 +0100
    10.2 +++ b/include/xen/interface/arch-ia64.h	Mon Jun 11 14:59:53 2007 -0600
    10.3 @@ -79,6 +79,10 @@ typedef unsigned long xen_ulong_t;
    10.4  #define MEM_M   (1UL << 20)
    10.5  #define MEM_K   (1UL << 10)
    10.6  
    10.7 +/* Guest physical address of IO ports space.  */
    10.8 +#define IO_PORTS_PADDR          0x00000ffffc000000UL
    10.9 +#define IO_PORTS_SIZE           0x0000000004000000UL
   10.10 +
   10.11  #define MMIO_START       (3 * MEM_G)
   10.12  #define MMIO_SIZE        (512 * MEM_M)
   10.13  
   10.14 @@ -344,7 +348,12 @@ struct arch_shared_info {
   10.15      /* Interrupt vector for event channel.  */
   10.16      int evtchn_vector;
   10.17  
   10.18 -    uint64_t pad[32];
   10.19 +    /* PFN of memmap_info page */
   10.20 +    unsigned int memmap_info_num_pages;/* currently only = 1 case is
   10.21 +                                          supported. */
   10.22 +    unsigned long memmap_info_pfn;
   10.23 +
   10.24 +    uint64_t pad[31];
   10.25  };
   10.26  typedef struct arch_shared_info arch_shared_info_t;
   10.27  
   10.28 @@ -460,8 +469,18 @@ struct vcpu_guest_context_regs {
   10.29  
   10.30          struct vcpu_tr_regs tr;
   10.31  
   10.32 +#if 0
   10.33 +	/*
   10.34 +	 * The vcpu_guest_context structure is allocated on the stack in
   10.35 +	 * a few places.  With this array for RBS storage, that structure
   10.36 +	 * is a bit over 21k.  It looks like maybe we're blowing the stack
   10.37 +	 * and causing rather random looking failures on a couple systems.
   10.38 +	 * Remove since we're not actually using it for now.
   10.39 +	 */
   10.40 +
   10.41          /* Note: loadrs is 2**14 bytes == 2**11 slots.  */
   10.42          unsigned long rbs[2048];
   10.43 +#endif
   10.44  };
   10.45  
   10.46  struct vcpu_guest_context {
   10.47 @@ -509,6 +528,9 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_conte
   10.48  /* gmfn version of IA64_DOM0VP_add_physmap */
   10.49  #define IA64_DOM0VP_add_physmap_with_gmfn       9
   10.50  
   10.51 +/* get fpswa revision */
   10.52 +#define IA64_DOM0VP_fpswa_revision      10
   10.53 +
   10.54  // flags for page assignement to pseudo physical address space
   10.55  #define _ASSIGN_readonly                0
   10.56  #define ASSIGN_readonly                 (1UL << _ASSIGN_readonly)
    11.1 --- a/include/xen/interface/foreign/reference.size	Mon Jun 11 15:56:06 2007 +0100
    11.2 +++ b/include/xen/interface/foreign/reference.size	Mon Jun 11 14:59:53 2007 -0600
    11.3 @@ -8,8 +8,8 @@ cpu_user_regs             |      68     
    11.4  xen_ia64_boot_param       |       -       -      96
    11.5  ia64_tr_entry             |       -       -      32
    11.6  vcpu_tr_regs              |       -       -     512
    11.7 -vcpu_guest_context_regs   |       -       -   21872
    11.8 -vcpu_guest_context        |    2800    5168   21904
    11.9 +vcpu_guest_context_regs   |       -       -    5488
   11.10 +vcpu_guest_context        |    2800    5168    5520
   11.11  arch_vcpu_info            |      24      16       0
   11.12  vcpu_time_info            |      32      32      32
   11.13  vcpu_info                 |      64      64      48