From patchwork Mon Jan 28 11:50:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 156713 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3333239jaa; Mon, 28 Jan 2019 03:52:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5EBLoILeBrt0ZFFM+t9D50e7cbASfckWonllQ1nTYWbSiCY0TB06JjQ/J0hIFmGLL47lcU X-Received: by 2002:a81:4ac6:: with SMTP id x189mr20761790ywa.249.1548676345584; Mon, 28 Jan 2019 03:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548676345; cv=none; d=google.com; s=arc-20160816; b=iUaF6QI4kaclwqJwig/gYkh1Cfe3xHcjbRN+pDgkZq6/aTb815snYcTYeGEbXs+Yl9 HlwX6TpeOMsCWWA++q8cmFbTIp0ICTmq/kG9pdiLj03uJRNot9YIAWzF58SbnVWTuby1 1oZFhR7IgWdO9lt1oghjujcnrCbGyUWffHNxL7Ijo/pnzl/1T0+yGxxPlm8Ljqr6toX3 R3z2zKm9CtY9iWpU4ZmtoCwcMY6Hej+dTc8ogbIv11F/+NsvmZKzqTuUX8cJRUm8qBsj M3+hIc7LbhInOTPdLXquXmaPDVwKNO9B6Y8G8kWsRz4e78V+66VI2VBAUCBpeWQAaxWh wKsg== 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=RNCcUnlWXdBb6E0ujhullIEVUGgG8lFiSP54bQbb3KA=; b=DVplhobDrMbqSwC4NXvmVX8H0scBYfzoZgqYj3cgo1LrEXi3xuGTLAO2CVwQp/KDsH 3KDoe4Q1mRORtJ+kOnM6e5xvUhc38TTt7QsVGkaJEIKSqe1RNRbNiraCIFjh+fHr15LN +KjThxYaQKwoDxOJyQFjBpILo5hBxuJndBPJgi8jl+pNl/e1uLeD7YIl88U4wGmHrihp UFgafbFXvqJKcIYWq7wri8LgvbjY8Jw9udoorgDP/xmVUw/Nelpiwys3r6nyCAo8Ku/B YZRN7wysv4XGdn5muwJKPloMGprT6uzyuBhq6ckAR1Yzfvo14pMAWUiCypogqke8Mya0 WmXw== 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 k62si19699369ywd.392.2019.01.28.03.52.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 03:52:25 -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 1go5R0-00035V-Ur; Mon, 28 Jan 2019 11:50:38 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1go5Qz-000350-Sd for xen-devel@lists.xenproject.org; Mon, 28 Jan 2019 11:50:37 +0000 X-Inumbo-ID: ed3a8998-22f2-11e9-aeee-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id ed3a8998-22f2-11e9-aeee-bc764e045a96; Mon, 28 Jan 2019 11:50:36 +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 B3965EBD; Mon, 28 Jan 2019 03:50:36 -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 EAD753F59C; Mon, 28 Jan 2019 03:50:35 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 28 Jan 2019 11:50:23 +0000 Message-Id: <20190128115026.3336-5-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190128115026.3336-1-julien.grall@arm.com> References: <20190128115026.3336-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 v2 4/7] 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: 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 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 Reviewed-by: Stefano Stabellini --- Changes in v2: - Fix typo in commit message - Add Stefano's reviewed-by --- 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 d2c63a89ca..31af989e63 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -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; @@ -1945,14 +1944,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;