From patchwork Tue Mar 10 15:39:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45599 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1F919214BF for ; Tue, 10 Mar 2015 15:43:11 +0000 (UTC) Received: by lams18 with SMTP id s18sf2128802lam.2 for ; Tue, 10 Mar 2015 08:43:10 -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=oB11ekziL9P7bWakx9SurUuQ/KkdtVpRyqZyGYlKtzI=; b=IBtlQC2L8BQkd0apmJLOWeCfFAd16nD5UI17zfY4J6swJe+YD/iObjnJQTJ4dAS9xP SkiQXByBQ4dUNmhFFMzD1VNT8yN4g1C9yLXTdBeNxs/OL1GpTwGJNLhwgJIjVzDVGZiT pcKj1k6smzBupWtv2pvrkKB7NF/iMQdt0CH7eCqSc3rwDrBpiBqOqgDI2HddrZ/gr8Xp uteU43fIqKZEJ7PSRJeFQSqV4yzw7QlZ7VBpgCrbayJAhW0ZQCRQtAxAy6kSlu/mW9cm Q8CFZIVcG1ZWrZuNkFzaG8qKgNgBZ/G8E5wvxoG8TfVteiB08yHSIAv12+7uiQekn72K hb/g== X-Gm-Message-State: ALoCoQmkCwjLRrz2TBzXXqd0ttoLANla3gQNd68YPpUw81YW2I4DVx5iQKx5vIVhVTGPJhumNsxu X-Received: by 10.180.208.12 with SMTP id ma12mr2531471wic.6.1426002190022; Tue, 10 Mar 2015 08:43:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.136 with SMTP id e8ls46941lam.91.gmail; Tue, 10 Mar 2015 08:43:09 -0700 (PDT) X-Received: by 10.152.163.2 with SMTP id ye2mr7728182lab.89.1426002189826; Tue, 10 Mar 2015 08:43:09 -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 dy5si528381lac.130.2015.03.10.08.43.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 08:43:09 -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 labhs14 with SMTP id hs14so2150035lab.5 for ; Tue, 10 Mar 2015 08:43:09 -0700 (PDT) X-Received: by 10.112.212.106 with SMTP id nj10mr12285208lbc.36.1426002189720; Tue, 10 Mar 2015 08:43:09 -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 h5csp2213595lbj; Tue, 10 Mar 2015 08:43:08 -0700 (PDT) X-Received: by 10.107.158.194 with SMTP id h185mr41542181ioe.30.1426002187591; Tue, 10 Mar 2015 08:43:07 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id nr10si1412203pdb.201.2015.03.10.08.43.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 08:43:07 -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 1YVMHW-0004s1-4C; Tue, 10 Mar 2015 15:41:18 +0000 Received: from mail-wg0-f48.google.com ([74.125.82.48]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVMGZ-00038I-RU for linux-arm-kernel@lists.infradead.org; Tue, 10 Mar 2015 15:40:20 +0000 Received: by wghk14 with SMTP id k14so2718502wgh.7 for ; Tue, 10 Mar 2015 08:39:57 -0700 (PDT) X-Received: by 10.180.206.162 with SMTP id lp2mr6209600wic.23.1426001997326; Tue, 10 Mar 2015 08:39:57 -0700 (PDT) Received: from ards-macbook-pro.local ([213.143.60.209]) by mx.google.com with ESMTPSA id ei3sm7381208wib.4.2015.03.10.08.39.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Mar 2015 08:39:56 -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 v4 3/5] arm64: remove __switch_data object from head.S Date: Tue, 10 Mar 2015 16:39:40 +0100 Message-Id: <1426001982-20047-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426001982-20047-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426001982-20047-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150310_084020_096425_5D5ECFDC X-CRM114-Status: GOOD ( 11.53 ) 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 [74.125.82.48 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.48 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.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 003db2eadd7a..2b60b587a70f 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,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)