direct-io.hg

changeset 6758:bd951d23d713

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 10:14:20 2005 +0000 (2005-09-13)
parents 4d018790ff8a 69bf4490062f
children b5d91089e42c
files tools/console/daemon/io.c xen/arch/x86/traps.c xen/arch/x86/x86_64/traps.c
line diff
     2.1 --- a/xen/arch/x86/traps.c	Tue Sep 13 10:13:52 2005 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Tue Sep 13 10:14:20 2005 +0000
     2.3 @@ -106,7 +106,7 @@ integer_param("debug_stack_lines", debug
     2.4  #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)&regs->esp)
     2.5  #else
     2.6  #define stack_words_per_line 4
     2.7 -#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->esp)
     2.8 +#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
     2.9  #endif
    2.10  
    2.11  int is_kernel_text(unsigned long addr)
    2.12 @@ -238,7 +238,7 @@ void show_stack(struct cpu_user_regs *re
    2.13      unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
    2.14      int i;
    2.15  
    2.16 -    if ( GUEST_MODE(regs) )
    2.17 +    if ( GUEST_CONTEXT(current, regs) )
    2.18          return show_guest_stack(regs);
    2.19  
    2.20      printk("Xen stack trace from "__OP"sp=%p:\n   ", stack);
     3.1 --- a/xen/arch/x86/x86_64/traps.c	Tue Sep 13 10:13:52 2005 +0000
     3.2 +++ b/xen/arch/x86/x86_64/traps.c	Tue Sep 13 10:14:20 2005 +0000
     3.3 @@ -12,25 +12,51 @@
     3.4  #include <asm/current.h>
     3.5  #include <asm/flushtlb.h>
     3.6  #include <asm/msr.h>
     3.7 +#include <asm/vmx.h>
     3.8  
     3.9  void show_registers(struct cpu_user_regs *regs)
    3.10  {
    3.11 -    printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
    3.12 -           smp_processor_id(), 0xffff & regs->cs, regs->rip);
    3.13 +    unsigned long rip, rsp, rflags, cs, cr0, cr3;
    3.14 +    const char *context;
    3.15 +
    3.16 +    if ( VMX_DOMAIN(current) && (regs->eflags == 0) )
    3.17 +    {
    3.18 +        __vmread(GUEST_RIP, &rip);
    3.19 +        __vmread(GUEST_RSP, &rsp);
    3.20 +        __vmread(GUEST_RFLAGS, &rflags);
    3.21 +        __vmread(GUEST_CS_SELECTOR, &cs);
    3.22 +        __vmread(CR0_READ_SHADOW, &cr0);
    3.23 +        __vmread(GUEST_CR3, &cr3);
    3.24 +        context = "vmx guest";
    3.25 +    }
    3.26 +    else
    3.27 +    {
    3.28 +        rip     = regs->rip;
    3.29 +        rflags  = regs->rflags;
    3.30 +        cr0     = read_cr0();
    3.31 +        cr3     = read_cr3();
    3.32 +        rsp     = regs->rsp;
    3.33 +        cs      = regs->cs & 0xffff;
    3.34 +        context = GUEST_MODE(regs) ? "guest" : "hypervisor";
    3.35 +    }
    3.36 +
    3.37 +    printk("CPU:    %d\nRIP:    %04lx:[<%016lx>]",
    3.38 +           smp_processor_id(), cs, rip);
    3.39      if ( !GUEST_MODE(regs) )
    3.40 -        print_symbol(" %s", regs->rip);
    3.41 -    printk("\nRFLAGS: %016lx\n", regs->eflags);
    3.42 +        print_symbol(" %s", rip);
    3.43 +    printk("\nRFLAGS: %016lx   CONTEXT: %s\n", rflags, context);
    3.44      printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
    3.45             regs->rax, regs->rbx, regs->rcx);
    3.46      printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
    3.47             regs->rdx, regs->rsi, regs->rdi);
    3.48      printk("rbp: %016lx   rsp: %016lx   r8:  %016lx\n",
    3.49 -           regs->rbp, regs->rsp, regs->r8);
    3.50 +           regs->rbp, rsp, regs->r8);
    3.51      printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
    3.52             regs->r9,  regs->r10, regs->r11);
    3.53      printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
    3.54             regs->r12, regs->r13, regs->r14);
    3.55 -    printk("r15: %016lx\n", regs->r15);
    3.56 +    printk("r15: %016lx   cr0: %016lx   cr3: %016lx\n",
    3.57 +           regs->r15, cr0, cr3);
    3.58  
    3.59      show_stack(regs);
    3.60  }
    3.61 @@ -194,3 +220,13 @@ long do_set_callbacks(unsigned long even
    3.62  
    3.63      return 0;
    3.64  }
    3.65 +
    3.66 +/*
    3.67 + * Local variables:
    3.68 + * mode: C
    3.69 + * c-set-style: "BSD"
    3.70 + * c-basic-offset: 4
    3.71 + * tab-width: 4
    3.72 + * indent-tabs-mode: nil
    3.73 + * End:
    3.74 + */