# HG changeset patch # User gingold@virtu10 # Node ID 449a6a7b60fbba092f5e0c64572c74b6b79350ce # Parent 7ceaa73bf8fa219f141ebaa6d37cf402010e9ccc Enable xenctx on ia64. Signed-off-by: Tristan Gingold diff -r 7ceaa73bf8fa -r 449a6a7b60fb tools/libxc/xc_ia64_stubs.c --- a/tools/libxc/xc_ia64_stubs.c Fri Jun 16 08:49:00 2006 +0200 +++ b/tools/libxc/xc_ia64_stubs.c Fri Jun 16 09:43:48 2006 +0200 @@ -738,7 +738,7 @@ int xc_hvm_build(int xc_handle, free(image); ctxt->flags = VGCF_VMX_GUEST; - ctxt->regs.cr_iip = 0x80000000ffffffb0UL; + ctxt->user_regs.cr_iip = 0x80000000ffffffb0UL; ctxt->privregs = 0; memset( &launch_op, 0, sizeof(launch_op) ); diff -r 7ceaa73bf8fa -r 449a6a7b60fb tools/libxc/xc_linux_build.c --- a/tools/libxc/xc_linux_build.c Fri Jun 16 08:49:00 2006 +0200 +++ b/tools/libxc/xc_linux_build.c Fri Jun 16 09:43:48 2006 +0200 @@ -1158,10 +1158,10 @@ static int xc_linux_build_internal(int x ctxt->flags = 0; ctxt->shared.flags = flags; ctxt->shared.start_info_pfn = nr_pages - 3; /* metaphysical */ - ctxt->regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */ - ctxt->regs.cr_iip = vkern_entry; - ctxt->regs.cr_ifs = 1UL << 63; - ctxt->regs.ar_fpsr = xc_ia64_fpsr_default(); + ctxt->user_regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */ + ctxt->user_regs.cr_iip = vkern_entry; + ctxt->user_regs.cr_ifs = 1UL << 63; + ctxt->user_regs.ar_fpsr = xc_ia64_fpsr_default(); /* currently done by hypervisor, should move here */ /* ctxt->regs.r28 = dom_fw_setup(); */ ctxt->privregs = 0; diff -r 7ceaa73bf8fa -r 449a6a7b60fb tools/xentrace/Makefile --- a/tools/xentrace/Makefile Fri Jun 16 08:49:00 2006 +0200 +++ b/tools/xentrace/Makefile Fri Jun 16 09:43:48 2006 +0200 @@ -28,6 +28,10 @@ LIBBIN += xenctx LIBBIN += xenctx endif +ifeq ($(XEN_TARGET_ARCH),ia64) +LIBBIN += xenctx +endif + .PHONY: all all: build diff -r 7ceaa73bf8fa -r 449a6a7b60fb tools/xentrace/xenctx.c --- a/tools/xentrace/xenctx.c Fri Jun 16 08:49:00 2006 +0200 +++ b/tools/xentrace/xenctx.c Fri Jun 16 09:43:48 2006 +0200 @@ -44,6 +44,15 @@ int stack_trace = 0; #define INSTR_POINTER(regs) (regs->rip) #define STACK_ROWS 4 #define STACK_COLS 4 +#elif defined (__ia64__) +#define FMT_SIZE_T "%016lx" +#define STACK_POINTER(regs) (regs->r12) +#define FRAME_POINTER(regs) 0 +#define INSTR_POINTER(regs) (regs->cr_iip) +#define STACK_ROWS 4 +#define STACK_COLS 4 +/* On ia64, we can't translate virtual address to physical address. */ +#define NO_TRANSLATION #endif struct symbol { @@ -255,8 +264,33 @@ void print_ctx(vcpu_guest_context_t *ctx printf(" gs: %08x\n", regs->gs); } +#elif defined(__ia64__) +void print_ctx(vcpu_guest_context_t *ctx1) +{ + struct cpu_user_regs *regs = &ctx1->user_regs; + + printf("iip: %016lx ", regs->cr_iip); + print_symbol(regs->cr_iip); + printf("\n"); + printf(" sp: %016lx ", regs->r12); + printf(" b0: %016lx\n", regs->b0); + printf(" tp: %016lx ", regs->r13); + printf(" r1: %016lx\n", regs->r1); + + + printf(" r2: %016lx ", regs->r2); + printf(" r3: %016lx\n", regs->r3); + printf(" r4: %016lx ", regs->r4); + printf(" r5: %016lx\n", regs->r5); + + printf(" r6: %016lx ", regs->r6); + printf(" r7: %016lx\n", regs->r7); + printf(" r8: %016lx ", regs->r8); + printf(" r9: %016lx\n", regs->r9); +} #endif +#ifndef NO_TRANSLATION void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt) { static unsigned long previous_mfn = 0; @@ -371,6 +405,7 @@ void print_stack(vcpu_guest_context_t *c } } } +#endif void dump_ctx(int vcpu) { @@ -393,8 +428,10 @@ void dump_ctx(int vcpu) } print_ctx(&ctx); - if (is_kernel_text(ctx.user_regs.eip)) +#ifndef NO_TRANSLATION + if (is_kernel_text(INSTR_POINTER((&ctx.user_regs)))) print_stack(&ctx, vcpu); +#endif ret = xc_domain_unpause(xc_handle, domid); if (ret < 0) { diff -r 7ceaa73bf8fa -r 449a6a7b60fb xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Fri Jun 16 08:49:00 2006 +0200 +++ b/xen/arch/ia64/xen/domain.c Fri Jun 16 09:43:48 2006 +0200 @@ -354,7 +354,7 @@ void arch_domain_destroy(struct domain * void arch_getdomaininfo_ctxt(struct vcpu *v, struct vcpu_guest_context *c) { - c->regs = *vcpu_regs (v); + c->user_regs = *vcpu_regs (v); c->shared = v->domain->shared_info->arch; } @@ -379,7 +379,7 @@ int arch_set_info_guest(struct vcpu *v, } else if (!d->arch.physmap_built) build_physmap_table(d); - *regs = c->regs; + *regs = c->user_regs; cmdline_addr = 0; if (v == d->vcpu[0]) { /* Only for first vcpu. */ diff -r 7ceaa73bf8fa -r 449a6a7b60fb xen/include/public/arch-ia64.h --- a/xen/include/public/arch-ia64.h Fri Jun 16 08:49:00 2006 +0200 +++ b/xen/include/public/arch-ia64.h Fri Jun 16 09:43:48 2006 +0200 @@ -336,7 +336,7 @@ struct vcpu_guest_context { unsigned long sys_pgnr; /* System pages out of domain memory */ unsigned long vm_assist; /* VMASST_TYPE_* bitmap, now none on IPF */ - struct cpu_user_regs regs; + struct cpu_user_regs user_regs; struct mapped_regs *privregs; struct arch_shared_info shared; struct arch_initrd_info initrd;