From patchwork Fri May 27 05:31:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 9137641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA6396075A for ; Fri, 27 May 2016 05:34:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA4DD27BE4 for ; Fri, 27 May 2016 05:34:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9ED6727CF9; Fri, 27 May 2016 05:34:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2878A27BE4 for ; Fri, 27 May 2016 05:34:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ANq-0004uB-T7; Fri, 27 May 2016 05:32:30 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ANp-0004tZ-8v for xen-devel@lists.xen.org; Fri, 27 May 2016 05:32:29 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 29/58-03047-CEBD7475; Fri, 27 May 2016 05:32:28 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42K5GHrgoO6b2+7 hBmf3s1ss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmXH9xiL7jOWXG8q5e9gfE+excjF4eQwGRG iQfb9zGBOCwCl1gktq/dxQbiSAi8Y5E43bIOqIwTyImRuDrtN5RdI7Flzy82EFtIQEVi7qYeR ohR3UwSO14fYQZJsAmoSRx5P5MRxBYRMJTYfXoRK4jNLGAscXHXdhYQW1ggTOLgonNgQ1kEVC X6zj4Hq+cVcJF4Ne0CK8QyOYkp99uZJjDyLWBkWMWoXpxaVJZapGusl1SUmZ5RkpuYmaNraGC ml5taXJyYnpqTmFSsl5yfu4kRGCoMQLCDseOf0yFGSQ4mJVHeWAP3cCG+pPyUyozE4oz4otKc 1OJDjDIcHEoSvEtvAeUEi1LTUyvSMnOAQQuTluDgURLhvQ2S5i0uSMwtzkyHSJ1iNObY8vvaW iaObVPvrWUSYsnLz0uVEufNBSkVACnNKM2DGwSLpkuMslLCvIxApwnxFKQW5WaWoMq/YhTnYF QS5n0JMoUnM68Ebt8roFOYgE7x/+IMckpJIkJKqoHRrPhy82qxcxMqpd8kpqcpztVmrROf/8j FlHuZtkt4UoW+RZNjs/T0pvfrZIRKT7TnzNFnyNjUrn1t7s+k5a/6A6/9nPjd2CFj0g6u0u29 kqkXlNqdX+1/Jmj64+4x6RTVj3PblfPvrN0fcqbdR5Q9Jn7p037d020vp3wL7m+bfLI1p7pF/ IQSS3FGoqEWc1FxIgDg6a/loQIAAA== X-Env-Sender: van.freenix@gmail.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1464327146!16234836!1 X-Originating-IP: [209.85.192.193] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16873 invoked from network); 27 May 2016 05:32:27 -0000 Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by server-12.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 27 May 2016 05:32:27 -0000 Received: by mail-pf0-f193.google.com with SMTP id b124so11274999pfb.0 for ; Thu, 26 May 2016 22:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=bxwMfKNprioRLiCNDfaCiOQmNmrOgWxob1L4xGDMcq8=; b=RFHJFB6U+cmiPix+gUdfzoo20+hZol4kGg4zqsNcQNCHvOE31J2DMxkYfxzH52NcJx bAEp0U3yaZgugBtGZshStD4fDpPYydtfael3t50hVr68xWhvI/KxI6geGVyxD4MH83hl E3zJGPsBbJotuTqnArBC2vT2B2TijRfFTQYpQ+4NaTTj94APNYR1zB5hhxWYSfh6AwS2 3wT/jHv8A14nU+0zwT6BrcgtukmkuO7Chk68PPxKmLwGwjDmrGGlVwn7t5ObPFKgM88c GuBKmCbJT6QLEt5unlr+0Ym4kZzO6f4YAFoHQipDibjXgbxR9cFlZSIDndK+Zo96LXaQ jKzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bxwMfKNprioRLiCNDfaCiOQmNmrOgWxob1L4xGDMcq8=; b=PZSBcqQIlduAZVMewyaDPzB/J2N/Dd6SIyDXfmlw+SKYaJIcgC3TEscyKBiit/fJA+ aiu9utzFXPqEleOrFTXAM1hJmbgBtDj9AMIFKjxJ+UvVEmGPoVsPrtenJmWlFGAzaF3A QX65t7AR7dUlWDINnvUmr3rz/+NlPaJzQ5w0Ql4FaqThL6btqRhCgbXlfluoA1xEv3sy Dk0WSYQlocUyEPkAqt7B3hCKWuWu+rH8wr2711piXSaIWL5FxTe7LGX6Cr8V0kvCWffP sbjUaITdVm3ddyD0P3eRblEkl4t3E3InhlSRiypqPl6pKPn5dW0sSWVIQET39QPei0zb T0mw== X-Gm-Message-State: ALyK8tLvcJJTz7KChvLc+b+8MzrGMue5hAiOQAkqpdUs20EDofJSEyrrh6Qjc1xjGKmINA== X-Received: by 10.98.104.133 with SMTP id d127mr19718651pfc.112.1464327146382; Thu, 26 May 2016 22:32:26 -0700 (PDT) Received: from linux-7smt.suse (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id n66sm10086796pfb.17.2016.05.26.22.32.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 May 2016 22:32:25 -0700 (PDT) From: Peng Fan To: julien.grall@arm.com, sstabellini@kernel.org Date: Fri, 27 May 2016 13:31:59 +0800 Message-Id: <1464327119-6242-1-git-send-email-van.freenix@gmail.com> X-Mailer: git-send-email 2.6.2 Cc: van.freenix@gmail.com, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH] xen/arm: setup: initialize xenheap mappings after boot pages avaiable X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP To ARM64, setup_xenheap_mappings may call alloc_boot_pages to allocate first level page table, if there is a big chunk memory (ie, >512GB). So, need to make sure boot pages are ready before setup xenheap mappings. Signed-off-by: Peng Fan Cc: Julien Grall Cc: Stefano Stabellini --- xen/arch/arm/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index dcb23b7..24cf9d3 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -641,8 +641,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) ram_start = min(ram_start,bank_start); ram_end = max(ram_end,bank_end); - setup_xenheap_mappings(bank_start>>PAGE_SHIFT, bank_size>>PAGE_SHIFT); - s = bank_start; while ( s < bank_end ) { @@ -663,6 +661,8 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) dt_unreserved_regions(s, e, init_boot_pages, 0); s = n; } + + setup_xenheap_mappings(bank_start>>PAGE_SHIFT, bank_size>>PAGE_SHIFT); } total_pages += ram_size >> PAGE_SHIFT;