From patchwork Mon Jul 21 12:59: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: 33955 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 84A4020492 for ; Mon, 21 Jul 2014 13:02:07 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id m15sf4595702wgh.0 for ; Mon, 21 Jul 2014 06:02:06 -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=GRis/jxS5LKHTfnnGDVCcE1TyjPS+WDrt0yXLSrWYvc=; b=JFRdRHbwxSOMB4KEJYJ7LWtAlStef0QkTdC5kY7MAAZB/d21H+epPF9msgYXte6UoF X2TWE4nUpQa8AxzeFlxmMoe8GnoEPtebJNgrQHzkAxdVENZaM7HibWTesw+VRuhaTa11 HPEAOtDh56GnLeLQ9sCR3zE6c2f/suNnYCahBfoMGR/Qw9NEiAziA1KhNTontXdVEwHt lzo41lNZ+cOH2H16iExN/93SUzb5luqLv371pympH9u2+NFVI0LHky5arWMDupsUgi6Q T+7nNWlPPExXXn6hPMZq3M4ERw5cH1DuGzEcNloOudDWezz7N9XtM4CF5or8971Gh0aF 9eJA== X-Gm-Message-State: ALoCoQkgVJ81PfI4mSOmKo0C9cCzyHyKfP+tktvnXmAqCUpm8pCJMIMvqAeVKz41QfZiiR4Yv0+o X-Received: by 10.180.218.170 with SMTP id ph10mr318129wic.1.1405947726329; Mon, 21 Jul 2014 06:02:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.198 with SMTP id 64ls1844654qgn.8.gmail; Mon, 21 Jul 2014 06:02:06 -0700 (PDT) X-Received: by 10.52.115.101 with SMTP id jn5mr8152666vdb.65.1405947726181; Mon, 21 Jul 2014 06:02:06 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id xy3si11240657vec.77.2014.07.21.06.02.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jul 2014 06:02:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so10481758vcb.16 for ; Mon, 21 Jul 2014 06:02:06 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr24543681vdc.40.1405947726110; Mon, 21 Jul 2014 06:02:06 -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 tc5csp110256vcb; Mon, 21 Jul 2014 06:02:05 -0700 (PDT) X-Received: by 10.43.93.199 with SMTP id bv7mr25707190icc.1.1405947725488; Mon, 21 Jul 2014 06:02:05 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ci7si29100485igb.42.2014.07.21.06.02.05 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 21 Jul 2014 06:02:05 -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 1X9DCM-0001Kx-L5; Mon, 21 Jul 2014 13:00:10 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X9DCL-0001Je-8c for xen-devel@lists.xen.org; Mon, 21 Jul 2014 13:00:09 +0000 Received: from [85.158.139.211:22003] by server-12.bemta-5.messagelabs.com id 09/F9-11323-8DE0DC35; Mon, 21 Jul 2014 13:00:08 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1405947606!16693303!1 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.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14961 invoked from network); 21 Jul 2014 13:00:07 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 21 Jul 2014 13:00:07 -0000 X-IronPort-AV: E=Sophos;i="5.01,701,1400025600"; d="scan'208";a="154656218" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 21 Jul 2014 13:00:05 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Mon, 21 Jul 2014 09:00:05 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1X9DCG-0004Og-Dz; Mon, 21 Jul 2014 14:00:05 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Mon, 21 Jul 2014 14:00:04 +0100 From: Ian Campbell To: Date: Mon, 21 Jul 2014 13:59:59 +0100 Message-ID: <1405947600-26047-5-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405947600-26047-1-git-send-email-ian.campbell@citrix.com> References: <1405947513.25022.59.camel@kazak.uk.xensource.com> <1405947600-26047-1-git-send-email-ian.campbell@citrix.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 v3 5/6] 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.171 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 --- v3: Use GLOBAL() v2: New patch #5/4 --- xen/arch/arm/arm32/head.S | 2 ++ xen/arch/arm/arm64/head.S | 2 ++ xen/arch/arm/xen.lds.S | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index afb4c6d..14b172f 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -457,6 +457,8 @@ fail: PRINT("- Boot failed -\r\n") 1: wfe b 1b +GLOBAL(_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 4e22374..9497ca1 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -487,6 +487,8 @@ fail: PRINT("- Boot failed -\r\n") 1: wfe b 1b +GLOBAL(_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")