From patchwork Wed Mar 4 11:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45408 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C27321486 for ; Wed, 4 Mar 2015 11:27:56 +0000 (UTC) Received: by lbiv13 with SMTP id v13sf16751533lbi.1 for ; Wed, 04 Mar 2015 03:27:55 -0800 (PST) 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=Y7/Be3mzQfNPrKP1GKNQS99PtYhgaZ7XfQ87DQxYVn4=; b=cFF2F8BB7egrWe+i9QfDbCn4Gwp4NobdWFjG6sb2MBouFBcq2K9fyMDe+/K2W8fdAx DKrc3EK/GA+YC92FWZ0508kBc9+f8lQ2DcUfWA07j0TAnwFwWMbKSLqUe1N50kb8P9b+ 5C99G1W+Z/55Ics3S4k01Clg2+AmQTrYvibWQOZm/Qzj15YHROD2TPEpCKchwOVzhhtE /rwV5KVzYt/2srdVApbDg8VBVP38NOdaoInXYIDQ3XgzeQl9WsbsOhx70upTOb95phcK 6yLMaRS/43+EFZvgnr/7X0DMqwZPLkSVXPJR6xisgorrr8y89ggNJUKEpgsNTOqr7Ba3 UPMQ== X-Gm-Message-State: ALoCoQlOsASU26bAUY52mY29LIlk+mZQX2dSbs53QCr2e+fYbmPGOANOpcLp8zWlD6xIa+pOvJ+6 X-Received: by 10.181.13.236 with SMTP id fb12mr1038586wid.1.1425468475197; Wed, 04 Mar 2015 03:27:55 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.36 with SMTP id n4ls138467laj.27.gmail; Wed, 04 Mar 2015 03:27:55 -0800 (PST) X-Received: by 10.152.206.70 with SMTP id lm6mr2958200lac.35.1425468475037; Wed, 04 Mar 2015 03:27:55 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id ai6si2369117lbc.7.2015.03.04.03.27.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 03:27:54 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbdu14 with SMTP id u14so22362862lbd.0 for ; Wed, 04 Mar 2015 03:27:54 -0800 (PST) X-Received: by 10.152.115.136 with SMTP id jo8mr3124933lab.32.1425468474884; Wed, 04 Mar 2015 03:27:54 -0800 (PST) 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 h5csp1156478lbj; Wed, 4 Mar 2015 03:27:54 -0800 (PST) X-Received: by 10.67.3.105 with SMTP id bv9mr5693472pad.149.1425468473058; Wed, 04 Mar 2015 03:27:53 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 5si827816pdp.102.2015.03.04.03.27.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 03:27:53 -0800 (PST) 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 1YT7RT-0002Wx-A7; Wed, 04 Mar 2015 11:26:19 +0000 Received: from mail-wi0-f175.google.com ([209.85.212.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YT7P5-0000BY-Ki for linux-arm-kernel@lists.infradead.org; Wed, 04 Mar 2015 11:23:52 +0000 Received: by wibhm9 with SMTP id hm9so6642809wib.2 for ; Wed, 04 Mar 2015 03:23:29 -0800 (PST) X-Received: by 10.180.198.211 with SMTP id je19mr11131278wic.37.1425468208992; Wed, 04 Mar 2015 03:23:28 -0800 (PST) Received: from ards-macbook-pro.local ([213.143.61.51]) by mx.google.com with ESMTPSA id q10sm3965332wjr.41.2015.03.04.03.23.27 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 03:23:28 -0800 (PST) From: Ard Biesheuvel To: catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] arm64: remove __switch_data object from head.S Date: Wed, 4 Mar 2015 12:23:16 +0100 Message-Id: <1425468197-22377-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425468197-22377-1-git-send-email-ard.biesheuvel@linaro.org> References: <1425468197-22377-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150304_032351_859903_A5E13207 X-CRM114-Status: GOOD ( 11.76 ) 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.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.175 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: 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.217.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 This removes the confusing __switch_data object from head.S, and replaces it with standard PC-relative references to the various symbols it encapsulates. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/head.S | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 003db2eadd7a..e6216b56257a 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -263,7 +263,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 @@ -432,35 +432,27 @@ __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 + adrp x6, __bss_start + adrp x7, __bss_stop + add x6, x6, :lo12:__bss_start + add x7, x7, :lo12:__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 + adrp x4, initial_sp + adrp x5, __fdt_pointer + adrp x6, memstart_addr + add sp, x4, :lo12:initial_sp + str x21, [x5, :lo12:__fdt_pointer] // Save FDT pointer + str x24, [x6, :lo12:memstart_addr] // Save PHYS_OFFSET mov x29, #0 b start_kernel ENDPROC(__mmap_switched)