From patchwork Wed Nov 28 16:49:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 152313 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1321306ljp; Wed, 28 Nov 2018 08:52:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/WK+yn4Nc0wPCDd3gHuwckq/VM34I4eU2ov3eO7Y0rj674Eusz05Q2dPebkcWBNaMV19POT X-Received: by 2002:a81:e50d:: with SMTP id s13mr38229230ywl.405.1543423935781; Wed, 28 Nov 2018 08:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543423935; cv=none; d=google.com; s=arc-20160816; b=u6mnJcBYG2sOrPiIMlvSFwzzvapP/71TAuXy2v5VcNFDINpAQtjD2pGkSqsgGjdwlI L2RbiIVe+FLqALCP4McNcOKEyLXtkIhwCwANcWm3cK4kT1cl0I3hi7gOCu2dX6bXp3N0 +LTLr26KC1MWr7Utjgmww3LDAQh7PiAsZgVat4o8d9KlZLTChEa8IEE+mTDXGBXrShEg GCGvF0j+3+HUYvg4Ob+YfpTAL36FhfneQPgC0Yh1Ju/99i/FeA6UBSxgJ4tJpTz5JUOK hLE9A75y0AcIiL19cKC8t3WuycCPaujzHz2F7opNpE6Up8SwLtvtrJefxZammOYvzCe1 ROUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=PvjxcZkiqPd/JkbrAOUBh5ovtTZKW2Y/6kQBMSVaX8g=; b=b1fS8PAL3mn3/WPojFaC8/WoC84dFI9/YsdFwbmTzvm13lhDEJ4vJyN8/nu7PnvwDx AQTSCJdGpjE7AjXwiw8eFGCeSUFGBpImT9Th8ld9k45uyNto6tcdsPrFXUThKF0XC/bE 05cLPoPa26tc6qlgpJyd9y9+Od+qyh/6VvQam0uqs57QWU/KH0jfs28mWGsp7TjVg7L7 kj+jNrso24uWHbWdWHo8fdJO285/BuKN4IkiXtLNRytdwyRIWqsZ1Yu6wz+2MDZGaKjx Ejez3r+UCXbbhanUYEAm/rTBe5XlE2xmutBYG2AI3ckG4/8pclSlKDtucHEmZv4tRJir LvEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id s14-v6si5451015ybi.436.2018.11.28.08.52.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 08:52:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gS32B-0000sX-0q; Wed, 28 Nov 2018 16:49:55 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gS329-0000rQ-Gp for xen-devel@lists.xenproject.org; Wed, 28 Nov 2018 16:49:53 +0000 X-Inumbo-ID: a03cc344-f32d-11e8-9a16-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a03cc344-f32d-11e8-9a16-bc764e045a96; Wed, 28 Nov 2018 16:49:52 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 096AA3830; Wed, 28 Nov 2018 08:49:52 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B5D83F575; Wed, 28 Nov 2018 08:49:50 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 28 Nov 2018 16:49:35 +0000 Message-Id: <20181128164939.8329-5-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181128164939.8329-1-julien.grall@arm.com> References: <20181128164939.8329-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 4/8] xen/arm: domain_build: Don't switch to the guest P2M when copying data X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Until recently, kernel/initrd/dtb were loaded using guest VA and therefore requiring to restore temporarily the P2M. This 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 Reviewed-by: Andrii Anisov Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index b0ec3f0b72..ffbf7c6760 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1920,7 +1920,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; @@ -1942,14 +1941,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. */ @@ -1958,10 +1949,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;