From patchwork Fri Apr 4 12:56:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27813 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2A22F20369 for ; Fri, 4 Apr 2014 12:58:51 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id il7sf9098512vcb.1 for ; Fri, 04 Apr 2014 05:58:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=6HGIhsD3+YLeHKoryRFuOJkWBiU6IyF2WG55bPgY1Ag=; b=Eg330sszNQcKhaEbteh6z90fjR3pHL6Cf3aNFntUoc8G2ni5w+DT7ScY59K89d3/5i 8TrMh9hPzY7awiMoGG0nQ/IvAxioohQBWxzzZndFFXggK3FwH50U3Coy7gY0/B3Gnnf0 HsIEkox5aSCFd57Q7esql+ms2sL1OsrDiXEuYr5BqELwFrTy15gqfkYIx5ZUNFe5iJyo 0ISj1WLlSZUcRc9RXrkqPeRHMlb24VDrGOwwZSBkLTAess2JgCtGI9TjgjNNXtlK9KMF xgYG434xCe7Nu8TpaydhdJLHW25c+9OSaUhjlDuF+TsOlcGDLrJf8lzjkTANGR47eOEx ryXA== X-Gm-Message-State: ALoCoQlfiiytQuxa8WAe2mN+BmEooCIrmmgYSM+1339FdkoNCehU9Y7F1aCoYcbAbK/0lBB4dz+c X-Received: by 10.236.29.51 with SMTP id h39mr6682869yha.45.1396616330537; Fri, 04 Apr 2014 05:58:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.8 with SMTP id l8ls1044314qge.27.gmail; Fri, 04 Apr 2014 05:58:50 -0700 (PDT) X-Received: by 10.58.111.163 with SMTP id ij3mr564045veb.26.1396616330479; Fri, 04 Apr 2014 05:58:50 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id xo2si758892vec.8.2014.04.04.05.58.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 05:58:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so3039460vcb.6 for ; Fri, 04 Apr 2014 05:58:50 -0700 (PDT) X-Received: by 10.58.187.78 with SMTP id fq14mr4953686vec.9.1396616330398; Fri, 04 Apr 2014 05:58:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp111903vcv; Fri, 4 Apr 2014 05:58:49 -0700 (PDT) X-Received: by 10.50.118.69 with SMTP id kk5mr3101384igb.10.1396616327362; Fri, 04 Apr 2014 05:58:47 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id lp10si4789319igb.41.2014.04.04.05.58.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 04 Apr 2014 05:58:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WW3gC-0000Mm-Iu; Fri, 04 Apr 2014 12:57:08 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WW3gC-0000MR-2S for xen-devel@lists.xen.org; Fri, 04 Apr 2014 12:57:08 +0000 Received: from [85.158.137.68:48766] by server-16.bemta-3.messagelabs.com id FF/32-13481-32CAE335; Fri, 04 Apr 2014 12:57:07 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1396616224!5082833!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10533 invoked from network); 4 Apr 2014 12:57:06 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 4 Apr 2014 12:57:06 -0000 X-IronPort-AV: E=Sophos;i="4.97,795,1389744000"; d="scan'208";a="116786619" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 04 Apr 2014 12:57:01 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Fri, 4 Apr 2014 08:57:00 -0400 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WW3g4-0000qs-EF; Fri, 04 Apr 2014 12:57:00 +0000 From: Ian Campbell To: Date: Fri, 4 Apr 2014 13:56:59 +0100 Message-ID: <1396616219-32219-3-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396616194.4211.223.camel@kazak.uk.xensource.com> References: <1396616194.4211.223.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 3/3] Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround" X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This reverts commit 6c21cb36e263de2db8716b477157a5b6cd531e1e. The Linux = issue which this works around was fixed in v3.13 via f52bb722547f "ARM: mm: Correct virt_to_phys patching for 64 bit physical addresses". This is the second attempt to revert this. Now that we have fixed allocate_memory_11 to allocate accessible memory on 32-bit this is safe to do. This is not quite a straight revert since we need to ensure that for 32-bit domain 0 we do not allocate dom0's memory above 4GB where the domain cannot access it without paging (which is disabled at start of day) and LPAE (which the kernel may not support) enabled. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 4d6b26b..e7cc2c9 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -69,19 +69,21 @@ static void allocate_memory_11(struct domain *d, struct kernel_info *kinfo) { paddr_t start; paddr_t size; - struct page_info *pg = NULL; + struct page_info *pg; unsigned int order = get_order_from_bytes(dom0_mem); int res; paddr_t spfn; - unsigned int bits; - for ( bits = PAGE_SHIFT + 1; bits < PADDR_BITS; bits++ ) + if ( is_32bit_domain(d) ) { - pg = alloc_domheap_pages(d, order, MEMF_bits(bits)); - if ( pg != NULL ) - break; + printk("32 bit domain\n"); + pg = alloc_domheap_pages(d, order, MEMF_bits(32)); + } + else + { + printk("64 bit domain\n"); + pg = alloc_domheap_pages(d, order, 0); } - if ( !pg ) panic("Failed to allocate contiguous memory for dom0");