ia64/xen-unstable

changeset 10836:80e2c1b3f9b1

[powerpc] domain building fixes for linux kexec model
The following updates are included:
- No stack allocation is necessary
- Some buggy kernels require r13 to be zeroed
- the DTB must be loaded from a fixed address, we are using
"/root/DomU.dtb" until we have the tools build the DTB on their
own.
- Though we give the PFN of the store and console pages to the new
domain we must make sure the MFN is given to the tools.

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Wed Jul 26 14:24:09 2006 -0400 (2006-07-26)
parents a4ab169ee850
children 15e4b258a69a
files tools/libxc/xc_ppc_linux_build.c
line diff
     1.1 --- a/tools/libxc/xc_ppc_linux_build.c	Thu Jul 13 11:26:51 2006 -0400
     1.2 +++ b/tools/libxc/xc_ppc_linux_build.c	Wed Jul 26 14:24:09 2006 -0400
     1.3 @@ -106,10 +106,13 @@ static int init_boot_vcpu(
     1.4      memset(&ctxt.user_regs, 0x55, sizeof(ctxt.user_regs));
     1.5      ctxt.user_regs.pc = dsi->v_kernentry;
     1.6      ctxt.user_regs.msr = 0;
     1.7 -    ctxt.user_regs.gprs[1] = 32<<20; /* XXX arbitrary stack address */
     1.8 +    ctxt.user_regs.gprs[1] = 0; /* Linux uses its own stack */
     1.9      ctxt.user_regs.gprs[3] = dtb;
    1.10      ctxt.user_regs.gprs[4] = kaddr;
    1.11      ctxt.user_regs.gprs[5] = 0;
    1.12 +    /* There is a buggy kernel that does not zero the "local_paca", so
    1.13 +     * we must make sure this register is 0 */
    1.14 +    ctxt.user_regs.gprs[13] = 0;
    1.15  
    1.16      VERBOSE(printf("xc_vcpu_setvcpucontext:\n"
    1.17                   "  pc 0x%"PRIx64", msr 0x016%"PRIx64"\n"
    1.18 @@ -343,6 +346,8 @@ static int get_page_array(int xc_handle,
    1.19      return 0;
    1.20  }
    1.21  
    1.22 +
    1.23 +
    1.24  int xc_linux_build(int xc_handle,
    1.25                     uint32_t domid,
    1.26                     const char *image_name,
    1.27 @@ -385,13 +390,14 @@ int xc_linux_build(int xc_handle,
    1.28      /* XXX install initrd addr/len into device tree */
    1.29  
    1.30      dtb_addr = (16 << 20);
    1.31 -    if (load_dtb(xc_handle, domid, "DomU.dtb", dtb_addr, &dsi, page_array)) {
    1.32 +    if (load_dtb(xc_handle, domid, "/root/DomU.dtb", dtb_addr, &dsi, page_array)) {
    1.33          dtb_addr = 0;
    1.34      }
    1.35  
    1.36      si_addr = create_start_info(&si, store_evtchn, console_evtchn);
    1.37 -    *console_mfn = si.console_mfn;
    1.38 -    *store_mfn = si.store_mfn;
    1.39 +    *console_mfn = page_array[si.console_mfn];
    1.40 +    *store_mfn = page_array[si.store_mfn];
    1.41 +    
    1.42      if (install_image(xc_handle, domid, page_array, &si, si_addr,
    1.43                  sizeof(start_info_t))) {
    1.44          rc = -1;