ia64/xen-unstable

changeset 11389:18ce855ff594

[XEN][POWERPC] catch up with xen-unstable changes
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Tue Aug 29 17:53:57 2006 -0500 (2006-08-29)
parents 030a041bbe90
children e01441c9a607
files xen/arch/powerpc/Rules.mk xen/arch/powerpc/boot_of.c xen/arch/powerpc/dom0_ops.c xen/arch/powerpc/setup.c xen/arch/powerpc/shadow.c xen/include/asm-powerpc/shadow.h
line diff
     1.1 --- a/xen/arch/powerpc/Rules.mk	Tue Aug 29 06:53:58 2006 -0400
     1.2 +++ b/xen/arch/powerpc/Rules.mk	Tue Aug 29 17:53:57 2006 -0500
     1.3 @@ -4,7 +4,7 @@ CC := $(CROSS_COMPILE)gcc
     1.4  LD := $(CROSS_COMPILE)ld
     1.5  
     1.6  # These are goodess that applies to all source.
     1.7 -C_WARNINGS := -Wpointer-arith -Wredundant-decls
     1.8 +C_WARNINGS := -Wredundant-decls
     1.9  
    1.10  # _no_ common code can have packed data structures or we are in touble.
    1.11  C_WARNINGS += -Wpacked
     2.1 --- a/xen/arch/powerpc/boot_of.c	Tue Aug 29 06:53:58 2006 -0400
     2.2 +++ b/xen/arch/powerpc/boot_of.c	Tue Aug 29 17:53:57 2006 -0500
     2.3 @@ -993,6 +993,7 @@ static int __init boot_of_cpus(void)
     2.4      /* We want a continuous logical cpu number space.  */
     2.5      cpu_set(0, cpu_present_map);
     2.6      cpu_set(0, cpu_online_map);
     2.7 +    cpu_set(0, cpu_possible_map);
     2.8  
     2.9      /* Spin up all CPUS, even if there are more than NR_CPUS, because
    2.10       * Open Firmware has them spinning on cache lines which will
    2.11 @@ -1039,8 +1040,10 @@ static int __init boot_of_cpus(void)
    2.12          } while (pong == ping);
    2.13          of_printf("pong = 0x%x\n", pong);
    2.14  
    2.15 -        if (pong != ping)
    2.16 +        if (pong != ping) {
    2.17              cpu_set(logical, cpu_present_map);
    2.18 +            cpu_set(logical, cpu_possible_map);
    2.19 +        }
    2.20  
    2.21          cpu = of_getpeer(cpu);
    2.22      }
     3.1 --- a/xen/arch/powerpc/dom0_ops.c	Tue Aug 29 06:53:58 2006 -0400
     3.2 +++ b/xen/arch/powerpc/dom0_ops.c	Tue Aug 29 17:53:57 2006 -0500
     3.3 @@ -28,6 +28,7 @@
     3.4  #include <public/domctl.h>
     3.5  #include <public/sysctl.h>
     3.6  
     3.7 +void arch_getdomaininfo_ctxt(struct vcpu *, vcpu_guest_context_t *);
     3.8  void arch_getdomaininfo_ctxt(struct vcpu *v, vcpu_guest_context_t *c)
     3.9  { 
    3.10      memcpy(&c->user_regs, &v->arch.ctxt, sizeof(struct cpu_user_regs));
    3.11 @@ -35,6 +36,8 @@ void arch_getdomaininfo_ctxt(struct vcpu
    3.12  }
    3.13  
    3.14  long arch_do_domctl(struct xen_domctl *domctl,
    3.15 +                    XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
    3.16 +long arch_do_domctl(struct xen_domctl *domctl,
    3.17                      XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
    3.18  {
    3.19      long ret = 0;
    3.20 @@ -76,6 +79,19 @@ long arch_do_domctl(struct xen_domctl *d
    3.21          }
    3.22      }
    3.23      break;
    3.24 +    case XEN_DOMCTL_shadow_op:
    3.25 +    {
    3.26 +        struct domain *d;
    3.27 +        ret = -ESRCH;
    3.28 +        d = find_domain_by_id(domctl->domain);
    3.29 +        if ( d != NULL )
    3.30 +        {
    3.31 +            ret = shadow_domctl(d, &domctl->u.shadow_op, u_domctl);
    3.32 +            put_domain(d);
    3.33 +            copy_to_guest(u_domctl, domctl, 1);
    3.34 +        } 
    3.35 +    }
    3.36 +    break;
    3.37  
    3.38      default:
    3.39          ret = -ENOSYS;
    3.40 @@ -86,6 +102,8 @@ long arch_do_domctl(struct xen_domctl *d
    3.41  }
    3.42  
    3.43  long arch_do_sysctl(struct xen_sysctl *sysctl,
    3.44 +                    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl);
    3.45 +long arch_do_sysctl(struct xen_sysctl *sysctl,
    3.46                      XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
    3.47  {
    3.48      long ret = 0;
    3.49 @@ -108,22 +126,9 @@ long arch_do_sysctl(struct xen_sysctl *s
    3.50              ret = -EFAULT;
    3.51      }
    3.52      break;
    3.53 -    case DOM0_SHADOW_CONTROL:
    3.54 -    {
    3.55 -        struct domain *d;
    3.56 -        ret = -ESRCH;
    3.57 -        d = find_domain_by_id(op->u.shadow_control.domain);
    3.58 -        if ( d != NULL )
    3.59 -        {
    3.60 -            ret = shadow_control_op(d, &op->u.shadow_control, u_dom0_op);
    3.61 -            put_domain(d);
    3.62 -            copy_to_guest(u_dom0_op, op, 1);
    3.63 -        } 
    3.64 -    }
    3.65 -    break;
    3.66  
    3.67      default:
    3.68 -        printk("%s: unsupported op: 0x%x\n", __func__, (op->cmd));
    3.69 +        printk("%s: unsupported sysctl: 0x%x\n", __func__, (sysctl->cmd));
    3.70          ret = -ENOSYS;
    3.71          break;
    3.72      }
     4.1 --- a/xen/arch/powerpc/setup.c	Tue Aug 29 06:53:58 2006 -0400
     4.2 +++ b/xen/arch/powerpc/setup.c	Tue Aug 29 17:53:57 2006 -0500
     4.3 @@ -74,6 +74,7 @@ ulong oftree_end;
     4.4  cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
     4.5  cpumask_t cpu_online_map; /* missing ifdef in schedule.c */
     4.6  cpumask_t cpu_present_map;
     4.7 +cpumask_t cpu_possible_map;
     4.8  
     4.9  /* XXX get this from ISA node in device tree */
    4.10  ulong isa_io_base;
    4.11 @@ -254,6 +255,7 @@ static int kick_secondary_cpus(int maxcp
    4.12              break;
    4.13          init_parea(cpuid);
    4.14          cpu_set(cpuid, cpu_online_map);
    4.15 +        cpu_set(cpuid, cpu_possible_map);
    4.16      }
    4.17  
    4.18      return 0;
     5.1 --- a/xen/arch/powerpc/shadow.c	Tue Aug 29 06:53:58 2006 -0400
     5.2 +++ b/xen/arch/powerpc/shadow.c	Tue Aug 29 17:53:57 2006 -0500
     5.3 @@ -21,7 +21,6 @@
     5.4  #include <xen/config.h>
     5.5  #include <xen/types.h>
     5.6  #include <xen/shadow.h>
     5.7 -#include <public/dom0_ops.h>
     5.8  
     5.9  static ulong htab_calc_sdr1(ulong htab_addr, ulong log_htab_size)
    5.10  {
    5.11 @@ -116,9 +115,9 @@ unsigned int shadow_set_allocation(struc
    5.12      return rc;
    5.13  }
    5.14  
    5.15 -int shadow_control_op(struct domain *d, 
    5.16 -                      dom0_shadow_control_t *sc,
    5.17 -                      XEN_GUEST_HANDLE(dom0_op_t) u_dom0_op)
    5.18 +int shadow_domctl(struct domain *d, 
    5.19 +				  xen_domctl_shadow_op_t *sc,
    5.20 +				  XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
    5.21  {
    5.22      if ( unlikely(d == current->domain) )
    5.23      {
    5.24 @@ -128,15 +127,15 @@ int shadow_control_op(struct domain *d,
    5.25  
    5.26      switch ( sc->op )
    5.27      {
    5.28 -    case DOM0_SHADOW_CONTROL_OP_OFF:
    5.29 +    case XEN_DOMCTL_SHADOW_OP_OFF:
    5.30           DPRINTK("Shadow is mandatory!\n");
    5.31           return -EINVAL;
    5.32  
    5.33 -    case DOM0_SHADOW2_CONTROL_OP_GET_ALLOCATION:
    5.34 +    case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
    5.35          sc->mb = shadow_get_allocation(d);
    5.36          return 0;
    5.37  
    5.38 -    case DOM0_SHADOW2_CONTROL_OP_SET_ALLOCATION: {
    5.39 +    case XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION: {
    5.40          int rc;
    5.41          int preempted = 0;
    5.42  
    5.43 @@ -145,7 +144,7 @@ int shadow_control_op(struct domain *d,
    5.44          if (preempted)
    5.45              /* Not finished.  Set up to re-run the call. */
    5.46              rc = hypercall_create_continuation(
    5.47 -                __HYPERVISOR_dom0_op, "h", u_dom0_op);
    5.48 +                __HYPERVISOR_domctl, "h", u_domctl);
    5.49          else 
    5.50              /* Finished.  Return the new allocation */
    5.51              sc->mb = shadow_get_allocation(d);
     6.1 --- a/xen/include/asm-powerpc/shadow.h	Tue Aug 29 06:53:58 2006 -0400
     6.2 +++ b/xen/include/asm-powerpc/shadow.h	Tue Aug 29 17:53:57 2006 -0500
     6.3 @@ -57,14 +57,14 @@ static inline void mark_dirty(struct dom
     6.4  }
     6.5  #define gnttab_mark_dirty(d, f) mark_dirty((d), (f))
     6.6  
     6.7 -extern int shadow_control_op(struct domain *d, 
     6.8 -                             dom0_shadow_control_t *sc,
     6.9 -                             XEN_GUEST_HANDLE(dom0_op_t) u_dom0_op);
    6.10 +extern int shadow_domctl(struct domain *d, 
    6.11 +                   xen_domctl_shadow_op_t *sc,
    6.12 +                   XEN_GUEST_HANDLE(xen_domctl_t) u_domctl);
    6.13  extern unsigned int shadow_teardown(struct domain *d);
    6.14  extern unsigned int shadow_set_allocation(
    6.15      struct domain *d, unsigned int megabytes, int *preempted);
    6.16  
    6.17 -/* Return the size of the shadow2 pool, rounded up to the nearest MB */
    6.18 +/* Return the size of the shadow pool, rounded up to the nearest MB */
    6.19  static inline unsigned int shadow_get_allocation(struct domain *d)
    6.20  {
    6.21      return (1ULL << (d->arch.htab.order + PAGE_SHIFT)) >> 20;