From patchwork Fri Jul 18 16:57:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 33882 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9759B208CF for ; Fri, 18 Jul 2014 16:59:21 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf29325010pac.7 for ; Fri, 18 Jul 2014 09:59:20 -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:message-id:from:to:date:in-reply-to :references:organization: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=W+C+n2eIKw+US9uCCloXTilzEIIE5ABC+vOftxsE/AY=; b=inMCvIK9J6u8/VtsYYXN0fq8qMFtoK8SLZ3ygDfputS/4FBSRklHDZBHxiWdOzciE0 z1EMK9wt6lAjqcCt0rSTwPXS0V8eXHUNIwOrFtt4yqtgCb/R08pKml1Dzja7h5713Nch n0XHJmmru/DsCNFORI1FrfDTn4Ewp0frseESV96FvP8tw5m0MyFY8BJiLb0t/ssHxlMa vXMpc+9oOoWvSS4WD7/mx69/gJ/O5BDVpQ8JfPUqww+XnJGZ1AlHKBxytaZ9rfDsl/1e 6Vq86pI6z2CHi3F7YEtrprPrW4+Lvdtf8xAPDwv/EiMNBrzvD0sDcdhjAnhFcF/q4woj +2ag== X-Gm-Message-State: ALoCoQksLaMqaaWMcpcHB9r6QcrW89JpSUHaWAEtnuz6dEQifOtNZJydqdhf8BLGxvD61VnLFro6 X-Received: by 10.66.157.67 with SMTP id wk3mr2960953pab.24.1405702760759; Fri, 18 Jul 2014 09:59:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.77 with SMTP id r71ls1028267qga.71.gmail; Fri, 18 Jul 2014 09:59:20 -0700 (PDT) X-Received: by 10.52.120.38 with SMTP id kz6mr6453280vdb.86.1405702760547; Fri, 18 Jul 2014 09:59:20 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id h4si6390184vdi.70.2014.07.18.09.59.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 09:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so7680722vcb.31 for ; Fri, 18 Jul 2014 09:59:20 -0700 (PDT) X-Received: by 10.52.244.81 with SMTP id xe17mr6639229vdc.24.1405702760454; Fri, 18 Jul 2014 09:59:20 -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.221.37.5 with SMTP id tc5csp26921vcb; Fri, 18 Jul 2014 09:59:20 -0700 (PDT) X-Received: by 10.50.27.4 with SMTP id p4mr11230071igg.22.1405702759925; Fri, 18 Jul 2014 09:59:19 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id dw5si6536816igb.18.2014.07.18.09.59.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 18 Jul 2014 09:59:19 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1X8BTN-0002vf-I0; Fri, 18 Jul 2014 16:57:29 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X8BTM-0002vZ-Pz for xen-devel@lists.xen.org; Fri, 18 Jul 2014 16:57:28 +0000 Received: from [85.158.139.211:27221] by server-13.bemta-5.messagelabs.com id 44/AE-17773-8F159C35; Fri, 18 Jul 2014 16:57:28 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1405702646!10941998!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6433 invoked from network); 18 Jul 2014 16:57:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 Jul 2014 16:57:27 -0000 X-IronPort-AV: E=Sophos;i="5.01,686,1400025600"; d="scan'208";a="153743082" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 18 Jul 2014 16:57:25 +0000 Received: from kazak.uk.xensource.com (10.80.2.80) by FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Fri, 18 Jul 2014 12:57:25 -0400 Message-ID: <1405702643.14973.5.camel@kazak.uk.xensource.com> From: Ian Campbell To: xen-devel Date: Fri, 18 Jul 2014 17:57:23 +0100 In-Reply-To: <1405699899.6419.7.camel@kazak.uk.xensource.com> References: <1405699899.6419.7.camel@kazak.uk.xensource.com> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.12.2-1 MIME-Version: 1.0 X-Originating-IP: [10.80.2.80] X-DLP: MIA1 Cc: Tim Deegan , Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH v2 5/4] xen: arm: ensure that the boot code is <4K in size 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) 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 avoids having to deal with the 1:1 boot mapping crossing a section or page boundary. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/arm32/head.S | 3 +++ xen/arch/arm/arm64/head.S | 3 +++ xen/arch/arm/xen.lds.S | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index caf7934..b4c3973 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -458,6 +458,9 @@ fail: PRINT("- Boot failed -\r\n") 1: wfe b 1b +.globl _end_boot +_end_boot: + /* Copy Xen to new location and switch TTBR * r1:r0 ttbr * r2 source address diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index f28b74a..a52e2e4 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -487,6 +487,9 @@ fail: PRINT("- Boot failed -\r\n") 1: wfe b 1b +.globl _end_boot +_end_boot: + /* Copy Xen to new location and switch TTBR * x0 ttbr * x1 source address diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index be55dad..079e085 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -178,3 +178,9 @@ SECTIONS .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } } + +/* + * We require that Xen is loaded at a 4K boundary, so this ensures that any + * code running on the boot time identity map cannot cross a section boundary. + */ +ASSERT( _end_boot - start <= PAGE_SIZE, "Boot code is larger than 4K")