ia64/xen-unstable

changeset 15384:8eaee9ef472f

Further fixes for 32on64 bit kexec.

* switch to a suitable stack before jumping to compatibility mode.
* return the correct range for KEXEC_RANGE_MA_XEN.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Tue Jun 19 15:03:55 2007 +0100 (2007-06-19)
parents 5794f9b80c3f
children 07688f8f5394
files xen/arch/x86/x86_64/compat_kexec.S xen/common/kexec.c
line diff
     1.1 --- a/xen/arch/x86/x86_64/compat_kexec.S	Tue Jun 19 14:52:53 2007 +0100
     1.2 +++ b/xen/arch/x86/x86_64/compat_kexec.S	Tue Jun 19 15:03:55 2007 +0100
     1.3 @@ -73,6 +73,10 @@ 1:      dec %r9
     1.4          RELOCATE_SYM(idle_pg_table,%rax)
     1.5          movq %rax, %cr3
     1.6  
     1.7 +        /* Switch to identity mapped compatibility stack. */
     1.8 +        RELOCATE_SYM(compat_stack,%rax)
     1.9 +        movq %rax, %rsp
    1.10 +
    1.11          /* Save xen_phys_start for 32 bit code. */
    1.12          movq xen_phys_start(%rip), %rbx
    1.13  
    1.14 @@ -84,6 +88,14 @@ compatibility_mode_far:
    1.15          .long SYM_PHYS(compatibility_mode)
    1.16          .long __HYPERVISOR_CS32
    1.17  
    1.18 +        /*
    1.19 +         * We use 5 words of stack for the arguments passed to the kernel. The
    1.20 +         * kernel only uses 1 word before switching to its own stack. Allocate
    1.21 +         * 16 words to give "plenty" of room.
    1.22 +         */
    1.23 +        .fill 16,4,0
    1.24 +compat_stack:
    1.25 +
    1.26          .code32
    1.27  
    1.28  #undef RELOCATE_SYM
     2.1 --- a/xen/common/kexec.c	Tue Jun 19 14:52:53 2007 +0100
     2.2 +++ b/xen/common/kexec.c	Tue Jun 19 15:03:55 2007 +0100
     2.3 @@ -169,7 +169,11 @@ static int kexec_get(reserve)(xen_kexec_
     2.4  
     2.5  static int kexec_get(xen)(xen_kexec_range_t *range)
     2.6  {
     2.7 +#ifdef CONFIG_X86_64
     2.8 +    range->start = xenheap_phys_start;
     2.9 +#else
    2.10      range->start = virt_to_maddr(_start);
    2.11 +#endif
    2.12      range->size = (unsigned long)xenheap_phys_end - (unsigned long)range->start;
    2.13      return 0;
    2.14  }