From patchwork Fri Dec 14 11:44:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 153824 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1961261ljp; Fri, 14 Dec 2018 03:47:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/XeaMKTqtjSfX2ZkVLMpTJ4vAmLLOtVQtNg8uwjE2pIu8CmyX9/DR1DFJ/zyKpQi5Z7t9iw X-Received: by 2002:a0d:da44:: with SMTP id c65mr2591947ywe.218.1544788038733; Fri, 14 Dec 2018 03:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544788038; cv=none; d=google.com; s=arc-20160816; b=bfj4RxDP90wHAdvG6DjiGTuL2HHJQuWtF9h0zBXU+Us9Tv/5JrAiLD6nivii0+7CbJ Hn4Ndqc+wI8nIAu6TBcn/Qg37pXmNqwPF/o3lPyPFCVLR8s7Th+yPeWdPKeH7hn/cJSw ZMefUpE1IJL3dvC3wWs45sE3XUkOtbVcMLpPpBvNoHs6ACFbzZFeA9YBW7opY9Jyo/qB VbdW7RU59TW6nF3vyPagg5kwv+xgzdyAhiNIzWFSFY56cNZpTY4u8MbhBOyvO9eNMMMp /6FMaPzc6NUbXkFtKK/e5Hli+iOaAyXvPQpHjzTPQFrIQcym+M6r1rJcpL5jl51B7N0r 8Grg== 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=FK+JDuwMB4KCQIVyh9JikR5unp1n9xywXuQ44NHhnxA=; b=ZfFA/4UKPCcDvun+Z3g/xqqRs94Z6MWRz1l6ozhoJe9IraZTZfD5dP7S2EbVnmSxrm XnH5FEAirxVlgb3EE6NXqL23JpkroIE6xuik/puhmEnqbyVMEeLHlhpUhqMB+u40LCb4 wYv5QT/YMAsH78WM5X4QaXMUODW3gCyFTVd6fPMNSuPiTysS2Nfi8w7wDhce8WSEPQjW HaIdGC0pF6kbuN+p+BvMYr7bdHbteryHtDgX+vno9CV5sf847qrw8Pgbev7EL5o2ApJV UT7cH/v2EYAHvXSNz1p1iaQ1kPRJBLWyFPWBaRi0BzZSyL0WOvb2JTtcQKRph00KFQFu +KmA== 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 a17si2601223ybq.294.2018.12.14.03.47.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Dec 2018 03:47:18 -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 1gXlu1-0007xD-D9; Fri, 14 Dec 2018 11:45:09 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gXltz-0007wx-Mq for xen-devel@lists.xen.org; Fri, 14 Dec 2018 11:45:07 +0000 X-Inumbo-ID: b37bbc6e-ff95-11e8-8e1d-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id b37bbc6e-ff95-11e8-8e1d-bc764e045a96; Fri, 14 Dec 2018 11:45:06 +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 ED52315AD; Fri, 14 Dec 2018 03:45:05 -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 308F13F575; Fri, 14 Dec 2018 03:45:05 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 14 Dec 2018 11:44:54 +0000 Message-Id: <20181214114455.5841-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181214114455.5841-1-julien.grall@arm.com> References: <20181214114455.5841-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 v2 1/2] xen/arm: mm: Use pte_xen_addr when creating xen entries 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" The helper pte_xen_addr computes the MFN based on the virtual address and generates the PTE. This can be r At the same time, make va a vaddr_t to make clear it holds virtual address. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- Changes in v2: - New patch --- xen/arch/arm/mm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 2556e57a99..91f3aef93c 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -652,12 +652,11 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr) /* Break up the Xen mapping into 4k pages and protect them separately. */ for ( i = 0; i < LPAE_ENTRIES; i++ ) { - mfn_t mfn = mfn_add(maddr_to_mfn(xen_paddr), i); - unsigned long va = XEN_VIRT_START + (i << PAGE_SHIFT); + vaddr_t va = XEN_VIRT_START + (i << PAGE_SHIFT); if ( !is_kernel(va) ) break; - pte = mfn_to_xen_entry(mfn, MT_NORMAL); + pte = pte_of_xenaddr(va); pte.pt.table = 1; /* 4k mappings always have this bit set */ if ( is_kernel_text(va) || is_kernel_inittext(va) ) {