direct-io.hg

changeset 10589:b16063ae0703

[IA64] enable xenctx on ia64

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Mon Jun 19 13:26:45 2006 -0600 (2006-06-19)
parents eb6b0c7d9992
children df67fa9b1376
files tools/libxc/xc_ia64_stubs.c tools/libxc/xc_linux_build.c tools/xentrace/Makefile tools/xentrace/xenctx.c xen/arch/ia64/xen/domain.c xen/include/public/arch-ia64.h
line diff
     1.1 --- a/tools/libxc/xc_ia64_stubs.c	Mon Jun 19 13:15:31 2006 -0600
     1.2 +++ b/tools/libxc/xc_ia64_stubs.c	Mon Jun 19 13:26:45 2006 -0600
     1.3 @@ -738,7 +738,7 @@ int xc_hvm_build(int xc_handle,
     1.4      free(image);
     1.5  
     1.6      ctxt->flags = VGCF_VMX_GUEST;
     1.7 -    ctxt->regs.cr_iip = 0x80000000ffffffb0UL;
     1.8 +    ctxt->user_regs.cr_iip = 0x80000000ffffffb0UL;
     1.9      ctxt->privregs = 0;
    1.10  
    1.11      memset( &launch_op, 0, sizeof(launch_op) );
     2.1 --- a/tools/libxc/xc_linux_build.c	Mon Jun 19 13:15:31 2006 -0600
     2.2 +++ b/tools/libxc/xc_linux_build.c	Mon Jun 19 13:26:45 2006 -0600
     2.3 @@ -1158,10 +1158,10 @@ static int xc_linux_build_internal(int x
     2.4      ctxt->flags = 0;
     2.5      ctxt->shared.flags = flags;
     2.6      ctxt->shared.start_info_pfn = nr_pages - 3; /* metaphysical */
     2.7 -    ctxt->regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */
     2.8 -    ctxt->regs.cr_iip = vkern_entry;
     2.9 -    ctxt->regs.cr_ifs = 1UL << 63;
    2.10 -    ctxt->regs.ar_fpsr = xc_ia64_fpsr_default();
    2.11 +    ctxt->user_regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */
    2.12 +    ctxt->user_regs.cr_iip = vkern_entry;
    2.13 +    ctxt->user_regs.cr_ifs = 1UL << 63;
    2.14 +    ctxt->user_regs.ar_fpsr = xc_ia64_fpsr_default();
    2.15      /* currently done by hypervisor, should move here */
    2.16      /* ctxt->regs.r28 = dom_fw_setup(); */
    2.17      ctxt->privregs = 0;
     3.1 --- a/tools/xentrace/Makefile	Mon Jun 19 13:15:31 2006 -0600
     3.2 +++ b/tools/xentrace/Makefile	Mon Jun 19 13:26:45 2006 -0600
     3.3 @@ -28,6 +28,10 @@ ifeq ($(XEN_TARGET_ARCH),x86_64)
     3.4  LIBBIN  += xenctx
     3.5  endif
     3.6  
     3.7 +ifeq ($(XEN_TARGET_ARCH),ia64)
     3.8 +LIBBIN  += xenctx
     3.9 +endif
    3.10 +
    3.11  .PHONY: all
    3.12  all: build
    3.13  
     4.1 --- a/tools/xentrace/xenctx.c	Mon Jun 19 13:15:31 2006 -0600
     4.2 +++ b/tools/xentrace/xenctx.c	Mon Jun 19 13:26:45 2006 -0600
     4.3 @@ -44,6 +44,15 @@ int stack_trace = 0;
     4.4  #define INSTR_POINTER(regs)	(regs->rip)
     4.5  #define STACK_ROWS		4
     4.6  #define STACK_COLS		4
     4.7 +#elif defined (__ia64__)
     4.8 +#define FMT_SIZE_T		"%016lx"
     4.9 +#define STACK_POINTER(regs)	(regs->r12)
    4.10 +#define FRAME_POINTER(regs)	0
    4.11 +#define INSTR_POINTER(regs)	(regs->cr_iip)
    4.12 +#define STACK_ROWS		4
    4.13 +#define STACK_COLS		4
    4.14 +/* On ia64, we can't translate virtual address to physical address.  */
    4.15 +#define NO_TRANSLATION
    4.16  #endif
    4.17  
    4.18  struct symbol {
    4.19 @@ -255,8 +264,33 @@ void print_ctx(vcpu_guest_context_t *ctx
    4.20      printf(" gs: %08x\n", regs->gs);
    4.21  
    4.22  }
    4.23 +#elif defined(__ia64__)
    4.24 +void print_ctx(vcpu_guest_context_t *ctx1)
    4.25 +{
    4.26 +    struct cpu_user_regs *regs = &ctx1->user_regs;
    4.27 +
    4.28 +    printf("iip: %016lx ", regs->cr_iip);
    4.29 +    print_symbol(regs->cr_iip);
    4.30 +    printf("\n");
    4.31 +    printf(" sp: %016lx  ", regs->r12);
    4.32 +    printf(" b0: %016lx\n", regs->b0);
    4.33 +    printf(" tp: %016lx  ", regs->r13);
    4.34 +    printf(" r1: %016lx\n", regs->r1);
    4.35 +
    4.36 +
    4.37 +    printf(" r2: %016lx  ", regs->r2);
    4.38 +    printf(" r3: %016lx\n", regs->r3);
    4.39 +    printf(" r4: %016lx  ", regs->r4);
    4.40 +    printf(" r5: %016lx\n", regs->r5);
    4.41 +
    4.42 +    printf(" r6: %016lx  ", regs->r6);
    4.43 +    printf(" r7: %016lx\n", regs->r7);
    4.44 +    printf(" r8: %016lx  ", regs->r8);
    4.45 +    printf(" r9: %016lx\n", regs->r9);
    4.46 +}
    4.47  #endif
    4.48  
    4.49 +#ifndef NO_TRANSLATION
    4.50  void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt)
    4.51  {
    4.52      static unsigned long previous_mfn = 0;
    4.53 @@ -371,6 +405,7 @@ void print_stack(vcpu_guest_context_t *c
    4.54          }
    4.55      }
    4.56  }
    4.57 +#endif
    4.58  
    4.59  void dump_ctx(int vcpu)
    4.60  {
    4.61 @@ -393,8 +428,10 @@ void dump_ctx(int vcpu)
    4.62      }
    4.63  
    4.64      print_ctx(&ctx);
    4.65 -    if (is_kernel_text(ctx.user_regs.eip))
    4.66 +#ifndef NO_TRANSLATION
    4.67 +    if (is_kernel_text(INSTR_POINTER((&ctx.user_regs))))
    4.68          print_stack(&ctx, vcpu);
    4.69 +#endif
    4.70  
    4.71      ret = xc_domain_unpause(xc_handle, domid);
    4.72      if (ret < 0) {
     5.1 --- a/xen/arch/ia64/xen/domain.c	Mon Jun 19 13:15:31 2006 -0600
     5.2 +++ b/xen/arch/ia64/xen/domain.c	Mon Jun 19 13:26:45 2006 -0600
     5.3 @@ -353,7 +353,7 @@ void arch_domain_destroy(struct domain *
     5.4  
     5.5  void arch_getdomaininfo_ctxt(struct vcpu *v, struct vcpu_guest_context *c)
     5.6  {
     5.7 -	c->regs = *vcpu_regs (v);
     5.8 +	c->user_regs = *vcpu_regs (v);
     5.9  	c->shared = v->domain->shared_info->arch;
    5.10  }
    5.11  
    5.12 @@ -378,7 +378,7 @@ int arch_set_info_guest(struct vcpu *v, 
    5.13  	} else if (!d->arch.physmap_built)
    5.14  	    build_physmap_table(d);
    5.15  
    5.16 -	*regs = c->regs;
    5.17 +	*regs = c->user_regs;
    5.18  	cmdline_addr = 0;
    5.19  	if (v == d->vcpu[0]) {
    5.20  	    /* Only for first vcpu.  */
     6.1 --- a/xen/include/public/arch-ia64.h	Mon Jun 19 13:15:31 2006 -0600
     6.2 +++ b/xen/include/public/arch-ia64.h	Mon Jun 19 13:26:45 2006 -0600
     6.3 @@ -336,7 +336,7 @@ struct vcpu_guest_context {
     6.4      unsigned long sys_pgnr;    /* System pages out of domain memory */
     6.5      unsigned long vm_assist;   /* VMASST_TYPE_* bitmap, now none on IPF */
     6.6  
     6.7 -    struct cpu_user_regs regs;
     6.8 +    struct cpu_user_regs user_regs;
     6.9      struct mapped_regs *privregs;
    6.10      struct arch_shared_info shared;
    6.11      struct arch_initrd_info initrd;