# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID b16063ae0703bf728eff740e34744d32662e397e
# Parent eb6b0c7d99929559fefb49fda2469a0c27754f9e
[IA64] enable xenctx on ia64
Signed-off-by: Tristan Gingold <tristan.gingold@xxxxxxxx>
---
tools/libxc/xc_ia64_stubs.c | 2 +-
tools/libxc/xc_linux_build.c | 8 ++++----
tools/xentrace/Makefile | 4 ++++
tools/xentrace/xenctx.c | 39 ++++++++++++++++++++++++++++++++++++++-
xen/arch/ia64/xen/domain.c | 4 ++--
xen/include/public/arch-ia64.h | 2 +-
6 files changed, 50 insertions(+), 9 deletions(-)
diff -r eb6b0c7d9992 -r b16063ae0703 tools/libxc/xc_ia64_stubs.c
--- a/tools/libxc/xc_ia64_stubs.c Mon Jun 19 13:15:31 2006 -0600
+++ b/tools/libxc/xc_ia64_stubs.c Mon Jun 19 13:26:45 2006 -0600
@@ -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 eb6b0c7d9992 -r b16063ae0703 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c Mon Jun 19 13:15:31 2006 -0600
+++ b/tools/libxc/xc_linux_build.c Mon Jun 19 13:26:45 2006 -0600
@@ -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 eb6b0c7d9992 -r b16063ae0703 tools/xentrace/Makefile
--- a/tools/xentrace/Makefile Mon Jun 19 13:15:31 2006 -0600
+++ b/tools/xentrace/Makefile Mon Jun 19 13:26:45 2006 -0600
@@ -28,6 +28,10 @@ LIBBIN += xenctx
LIBBIN += xenctx
endif
+ifeq ($(XEN_TARGET_ARCH),ia64)
+LIBBIN += xenctx
+endif
+
.PHONY: all
all: build
diff -r eb6b0c7d9992 -r b16063ae0703 tools/xentrace/xenctx.c
--- a/tools/xentrace/xenctx.c Mon Jun 19 13:15:31 2006 -0600
+++ b/tools/xentrace/xenctx.c Mon Jun 19 13:26:45 2006 -0600
@@ -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 eb6b0c7d9992 -r b16063ae0703 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c Mon Jun 19 13:15:31 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c Mon Jun 19 13:26:45 2006 -0600
@@ -353,7 +353,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;
}
@@ -378,7 +378,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 eb6b0c7d9992 -r b16063ae0703 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h Mon Jun 19 13:15:31 2006 -0600
+++ b/xen/include/public/arch-ia64.h Mon Jun 19 13:26:45 2006 -0600
@@ -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;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|