ia64/xen-unstable

changeset 16817:564fa97594a6

[IA64] Introduce dom0_vhpt_size_log2 boot option to change dom0 vhpt size

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Tue Jan 22 08:26:20 2008 -0700 (2008-01-22)
parents ff90abf572f2
children 29268e3fc7ab
files xen/arch/ia64/xen/dom0_ops.c xen/arch/ia64/xen/vhpt.c xen/arch/ia64/xen/xensetup.c xen/include/asm-ia64/vhpt.h
line diff
     1.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Fri Jan 18 14:11:20 2008 -0700
     1.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Tue Jan 22 08:26:20 2008 -0700
     1.3 @@ -20,6 +20,7 @@
     1.4  #include <xen/guest_access.h>
     1.5  #include <asm/vmx.h>
     1.6  #include <asm/dom_fw.h>
     1.7 +#include <asm/vhpt.h>
     1.8  #include <xen/iocap.h>
     1.9  #include <xen/errno.h>
    1.10  #include <xen/nodemask.h>
    1.11 @@ -121,20 +122,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
    1.12                      for_each_vcpu (d, v)
    1.13                          v->arch.breakimm = d->arch.breakimm;
    1.14                  }
    1.15 -#ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
    1.16 -                if (ds->vhpt_size_log2 == -1) {
    1.17 -                    d->arch.has_pervcpu_vhpt = 0;
    1.18 -                    ds->vhpt_size_log2 = -1;
    1.19 -                    printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
    1.20 -                           "domain %d VHPT is global.\n", d->domain_id);
    1.21 -                } else {
    1.22 -                    d->arch.has_pervcpu_vhpt = 1;
    1.23 -                    d->arch.vhpt_size_log2 = ds->vhpt_size_log2;
    1.24 -                    printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
    1.25 -                           "domain %d VHPT is per vcpu. size=2**%d\n",
    1.26 -                           d->domain_id, ds->vhpt_size_log2);
    1.27 -                }
    1.28 -#endif
    1.29 +                domain_set_vhpt_size(d, ds->vhpt_size_log2);
    1.30                  if (ds->xsi_va)
    1.31                      d->arch.shared_info_va = ds->xsi_va;
    1.32                  ret = dom_fw_setup(d, ds->bp, ds->maxmem);
     2.1 --- a/xen/arch/ia64/xen/vhpt.c	Fri Jan 18 14:11:20 2008 -0700
     2.2 +++ b/xen/arch/ia64/xen/vhpt.c	Tue Jan 22 08:26:20 2008 -0700
     2.3 @@ -153,6 +153,22 @@ void __init vhpt_init(void)
     2.4  }
     2.5  
     2.6  #ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
     2.7 +void
     2.8 +domain_set_vhpt_size(struct domain *d, int8_t vhpt_size_log2)
     2.9 +{
    2.10 +	if (vhpt_size_log2 == -1) {
    2.11 +		d->arch.has_pervcpu_vhpt = 0;
    2.12 +		printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
    2.13 +		       "domain %d VHPT is global.\n", d->domain_id);
    2.14 +	} else {
    2.15 +		d->arch.has_pervcpu_vhpt = 1;
    2.16 +		d->arch.vhpt_size_log2 = vhpt_size_log2;
    2.17 +		printk(XENLOG_INFO "XEN_DOMCTL_arch_setup: "
    2.18 +		       "domain %d VHPT is per vcpu. size=2**%d\n",
    2.19 +		       d->domain_id, vhpt_size_log2);
    2.20 +	}
    2.21 +}
    2.22 +
    2.23  int
    2.24  pervcpu_vhpt_alloc(struct vcpu *v)
    2.25  {
     3.1 --- a/xen/arch/ia64/xen/xensetup.c	Fri Jan 18 14:11:20 2008 -0700
     3.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Jan 22 08:26:20 2008 -0700
     3.3 @@ -22,6 +22,7 @@
     3.4  #include <asm/meminit.h>
     3.5  #include <asm/page.h>
     3.6  #include <asm/setup.h>
     3.7 +#include <asm/vhpt.h>
     3.8  #include <xen/string.h>
     3.9  #include <asm/vmx.h>
    3.10  #include <linux/efi.h>
    3.11 @@ -329,6 +330,11 @@ is_platform_hp_ski(void)
    3.12      return 1;
    3.13  }
    3.14  
    3.15 +#ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
    3.16 +static int __initdata dom0_vhpt_size_log2;
    3.17 +integer_param("dom0_vhpt_size_log2", dom0_vhpt_size_log2);
    3.18 +#endif
    3.19 +
    3.20  void __init start_kernel(void)
    3.21  {
    3.22      char *cmdline;
    3.23 @@ -630,6 +636,7 @@ printk("num_online_cpus=%d, max_cpus=%d\
    3.24      dom0 = domain_create(0, 0, DOM0_SSIDREF);
    3.25      if (dom0 == NULL)
    3.26          panic("Error creating domain 0\n");
    3.27 +    domain_set_vhpt_size(dom0, dom0_vhpt_size_log2);
    3.28      dom0_vcpu0 = alloc_vcpu(dom0, 0, 0);
    3.29      if (dom0_vcpu0 == NULL || vcpu_late_initialise(dom0_vcpu0) != 0)
    3.30          panic("Cannot allocate dom0 vcpu 0\n");
     4.1 --- a/xen/include/asm-ia64/vhpt.h	Fri Jan 18 14:11:20 2008 -0700
     4.2 +++ b/xen/include/asm-ia64/vhpt.h	Tue Jan 22 08:26:20 2008 -0700
     4.3 @@ -55,8 +55,16 @@ DECLARE_PER_CPU (unsigned long, vhpt_pen
     4.4  #endif
     4.5  
     4.6  #include <xen/sched.h>
     4.7 +#ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
     4.8 +void domain_set_vhpt_size(struct domain *d, int8_t vhpt_size_log2);
     4.9  int pervcpu_vhpt_alloc(struct vcpu *v);
    4.10  void pervcpu_vhpt_free(struct vcpu *v);
    4.11 +#else
    4.12 +#define domain_set_vhpt_size(d, vhpt_size_log2) do { } while (0)
    4.13 +#define pervcpu_vhpt_alloc(v)                   (0)
    4.14 +#define pervcpu_vhpt_free(v)                    do { } while (0)
    4.15 +#endif
    4.16 +
    4.17  static inline unsigned long
    4.18  vcpu_vhpt_maddr(struct vcpu* v)
    4.19  {