]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/arm: domain_build: Don't switch to the guest P2M when copying data
authorJulien Grall <julien.grall@arm.com>
Mon, 28 Jan 2019 11:50:23 +0000 (11:50 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 29 Jan 2019 00:53:23 +0000 (16:53 -0800)
Until recently, kernel/initrd/dtb were loaded using guest VA and
therefore requiring to restore temporarily the P2M. This was reworked
in a series of commits (up to 9292086 "xen/arm: domain_build: Use
copy_to_guest_phys_flush_dcache in dtb_load") to use a guest PA.

This will also help a follow-up patch which will require
p2m_{save,restore}_state to work in pair to workaround an erratum.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain_build.c

index d2c63a89ca8a7c956ef8c90158c3338e9a4d1ef4..31af989e639226fd2ffa84f3e2956a4743b081a2 100644 (file)
@@ -1923,7 +1923,6 @@ static void __init find_gnttab_region(struct domain *d,
 
 static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
 {
-    struct vcpu *saved_current;
     int i, cpu;
     struct vcpu *v = d->vcpu[0];
     struct cpu_user_regs *regs = &v->arch.cpu_info->guest_cpu_user_regs;
@@ -1944,14 +1943,6 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
 
 #endif
 
-    /*
-     * The following loads use the domain's p2m and require current to
-     * be a vcpu of the domain, temporarily switch
-     */
-    saved_current = current;
-    p2m_restore_state(v);
-    set_current(v);
-
     /*
      * kernel_load will determine the placement of the kernel as well
      * as the initrd & fdt in RAM, so call it first.
@@ -1961,10 +1952,6 @@ static int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
     initrd_load(kinfo);
     dtb_load(kinfo);
 
-    /* Now that we are done restore the original p2m and current. */
-    set_current(saved_current);
-    p2m_restore_state(saved_current);
-
     memset(regs, 0, sizeof(*regs));
 
     regs->pc = (register_t)kinfo->entry;