[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix segment-register dumping in show_registers().
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 39b392a220025993cfb9dfa6ae5554ac3c88a340 # Parent 07a892f1260933c584f781f2262dfa59a5ba8d70 Fix segment-register dumping in show_registers(). Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r 07a892f12609 -r 39b392a22002 xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c Tue Feb 14 17:25:10 2006 +++ b/xen/arch/x86/domain.c Tue Feb 14 18:43:45 2006 @@ -615,10 +615,10 @@ if ( HVM_DOMAIN(v) ) hvm_save_segments(v); - __asm__ __volatile__ ( "mov %%ds,%0" : "=m" (regs->ds) ); - __asm__ __volatile__ ( "mov %%es,%0" : "=m" (regs->es) ); - __asm__ __volatile__ ( "mov %%fs,%0" : "=m" (regs->fs) ); - __asm__ __volatile__ ( "mov %%gs,%0" : "=m" (regs->gs) ); + regs->ds = read_segment_register(ds); + regs->es = read_segment_register(es); + regs->fs = read_segment_register(fs); + regs->gs = read_segment_register(gs); if ( regs->ds ) dirty_segment_mask |= DIRTY_DS; diff -r 07a892f12609 -r 39b392a22002 xen/arch/x86/x86_32/traps.c --- a/xen/arch/x86/x86_32/traps.c Tue Feb 14 17:25:10 2006 +++ b/xen/arch/x86/x86_32/traps.c Tue Feb 14 18:43:45 2006 @@ -37,16 +37,13 @@ if ( !GUEST_MODE(regs) ) { fault_regs.esp = (unsigned long)®s->esp; - fault_regs.ss = __HYPERVISOR_DS; - fault_regs.ds = __HYPERVISOR_DS; - fault_regs.es = __HYPERVISOR_DS; - fault_regs.cs = __HYPERVISOR_CS; + fault_regs.ss = read_segment_register(ss); + fault_regs.ds = read_segment_register(ds); + fault_regs.es = read_segment_register(es); + fault_regs.fs = read_segment_register(fs); + fault_regs.gs = read_segment_register(gs); } - __asm__ ( - "movw %%fs,%0 ; movw %%gs,%1" - : "=r" (fault_regs.fs), "=r" (fault_regs.gs) ); - fault_crs[0] = read_cr0(); fault_crs[3] = read_cr3(); } diff -r 07a892f12609 -r 39b392a22002 xen/arch/x86/x86_64/traps.c --- a/xen/arch/x86/x86_64/traps.c Tue Feb 14 17:25:10 2006 +++ b/xen/arch/x86/x86_64/traps.c Tue Feb 14 18:43:45 2006 @@ -35,6 +35,10 @@ context = GUEST_MODE(regs) ? "guest" : "hypervisor"; fault_crs[0] = read_cr0(); fault_crs[3] = read_cr3(); + fault_regs.ds = read_segment_register(ds); + fault_regs.es = read_segment_register(es); + fault_regs.fs = read_segment_register(fs); + fault_regs.gs = read_segment_register(gs); } printk("----[ Xen-%d.%d%s %s ]----\n", @@ -57,6 +61,10 @@ fault_regs.r12, fault_regs.r13, fault_regs.r14); printk("r15: %016lx cr0: %016lx cr3: %016lx\n", fault_regs.r15, fault_crs[0], fault_crs[3]); + printk("ds: %04x es: %04x fs: %04x gs: %04x " + "ss: %04x cs: %04x\n", + fault_regs.ds, fault_regs.es, fault_regs.fs, + fault_regs.gs, fault_regs.ss, fault_regs.cs); show_stack(regs); } diff -r 07a892f12609 -r 39b392a22002 xen/include/asm-x86/system.h --- a/xen/include/asm-x86/system.h Tue Feb 14 17:25:10 2006 +++ b/xen/include/asm-x86/system.h Tue Feb 14 18:43:45 2006 @@ -4,6 +4,12 @@ #include <xen/config.h> #include <xen/types.h> #include <asm/bitops.h> + +#define read_segment_register(name) \ +({ u16 __sel; \ + __asm__ __volatile__ ( "movw %%" STR(name) ",%0" : "=r" (__sel) ); \ + __sel; \ +}) /* Clear and set 'TS' bit respectively */ #define clts() __asm__ __volatile__ ("clts") _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |