From patchwork Wed Mar 18 14:55:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45968 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BD6A72153B for ; Wed, 18 Mar 2015 15:41:49 +0000 (UTC) Received: by wibbs8 with SMTP id bs8sf8390950wib.3 for ; Wed, 18 Mar 2015 08:41:49 -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:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=vYbKA70RbpR3tcRMlOYB3hdVOUrg6bakz5kU7wtYbfM=; b=VJkC4MX7yro5llZRZMFEbL4C/V4Qi45c5Irg91onIuzr7kYGuwfsXdKpZ2J6aiBA4U OFxUrnaWNRlQ5m56VkNLl70PzeRNf4fGjaLUtI7uIg7WDXk4VpNHA55NVWuQ0hm1fGmp 5IjT1ZDg9r9sTqjSdUSy2aecIxpnsPMPG9o/22EC5lZssuIEO9rDzAgXI14aMJNNHryQ o+QeCZAf9qpijGhVsPYGTtQ2mgPueJIavOaEjG0OYy5JMf2uM2J1495IYxjZTB8/xslg o/D/FyZbHfSp7DQxgpHbG0eEUw7T7cJXOT6vHf0p2ofsUodLyayFGRuLxqN8mmd1Ao2F gtyA== X-Gm-Message-State: ALoCoQmnsuw5NdAAXeLEZOEeYyEUPsZOe3u8ZIwRNBpwUz0UACXUeM+i/bhZ1w7aI4bWKq+oZJmd X-Received: by 10.112.98.38 with SMTP id ef6mr10324379lbb.3.1426693309110; Wed, 18 Mar 2015 08:41:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.137 with SMTP id z9ls163666laa.15.gmail; Wed, 18 Mar 2015 08:41:48 -0700 (PDT) X-Received: by 10.112.155.65 with SMTP id vu1mr35512738lbb.61.1426693308831; Wed, 18 Mar 2015 08:41:48 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id lm12si13148097lac.175.2015.03.18.08.41.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 08:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lamx15 with SMTP id x15so39482703lam.3 for ; Wed, 18 Mar 2015 08:41:48 -0700 (PDT) X-Received: by 10.152.8.15 with SMTP id n15mr37621832laa.41.1426693308745; Wed, 18 Mar 2015 08:41:48 -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.112.35.133 with SMTP id h5csp1236477lbj; Wed, 18 Mar 2015 08:41:47 -0700 (PDT) X-Received: by 10.66.63.72 with SMTP id e8mr160185956pas.3.1426693306573; Wed, 18 Mar 2015 08:41:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id xt13si36762657pac.54.2015.03.18.08.41.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Mar 2015 08:41:46 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYG4e-0005tS-AC; Wed, 18 Mar 2015 15:40:00 +0000 Received: from mail-wi0-f178.google.com ([209.85.212.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYFOA-0003Qu-Qp for linux-arm-kernel@lists.infradead.org; Wed, 18 Mar 2015 14:56:07 +0000 Received: by wifj2 with SMTP id j2so42088548wif.1 for ; Wed, 18 Mar 2015 07:55:44 -0700 (PDT) X-Received: by 10.180.80.199 with SMTP id t7mr7856567wix.52.1426690544472; Wed, 18 Mar 2015 07:55:44 -0700 (PDT) Received: from ards-macbook-pro.local ([84.78.25.113]) by mx.google.com with ESMTPSA id y14sm24826582wjr.39.2015.03.18.07.55.42 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Mar 2015 07:55:43 -0700 (PDT) From: Ard Biesheuvel To: will.deacon@arm.com, mark.rutland@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 4/8] arm64: remove __switch_data object from head.S Date: Wed, 18 Mar 2015 15:55:23 +0100 Message-Id: <1426690527-14258-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426690527-14258-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426690527-14258-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150318_075607_038775_A24A74BE X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.178 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.178 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: marc.zyngier@arm.com, Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 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 This removes the confusing __switch_data object from head.S, and replaces it with standard PC-relative references to the various symbols it encapsulates. Reviewed-by: Catalin Marinas Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/head.S | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index c9131f94be19..7e8e746931af 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -253,7 +253,7 @@ ENTRY(stext) * On return, the CPU will be ready for the MMU to be turned on and * the TCR will have been set. */ - ldr x27, __switch_data // address to jump to after + ldr x27, =__mmap_switched // address to jump to after // MMU has been enabled adrp lr, __enable_mmu // return (PIC) address add lr, lr, #:lo12:__enable_mmu @@ -420,35 +420,22 @@ __create_page_tables: ENDPROC(__create_page_tables) .ltorg - .align 3 - .type __switch_data, %object -__switch_data: - .quad __mmap_switched - .quad __bss_start // x6 - .quad __bss_stop // x7 - .quad __fdt_pointer // x5 - .quad memstart_addr // x6 - .quad init_thread_union + THREAD_START_SP // sp - /* - * The following fragment of code is executed with the MMU on in MMU mode, and - * uses absolute addresses; this is not position independent. + * The following fragment of code is executed with the MMU enabled. */ + .set initial_sp, init_thread_union + THREAD_START_SP __mmap_switched: - adr x3, __switch_data + 8 + adr_l x6, __bss_start + adr_l x7, __bss_stop - ldp x6, x7, [x3], #16 1: cmp x6, x7 b.hs 2f str xzr, [x6], #8 // Clear BSS b 1b 2: - ldr x5, [x3], #8 - ldr x6, [x3], #8 - ldr x16, [x3] - mov sp, x16 - str x21, [x5] // Save FDT pointer - str x24, [x6] // Save PHYS_OFFSET + adr_l sp, initial_sp, x4 + str_l x21, __fdt_pointer, x5 // Save FDT pointer + str_l x24, memstart_addr, x6 // Save PHYS_OFFSET mov x29, #0 b start_kernel ENDPROC(__mmap_switched)