From patchwork Wed Mar 4 19:11:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45441 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B28F92055F for ; Wed, 4 Mar 2015 19:14:33 +0000 (UTC) Received: by wesu56 with SMTP id u56sf35536469wes.1 for ; Wed, 04 Mar 2015 11:14:33 -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=oB11ekziL9P7bWakx9SurUuQ/KkdtVpRyqZyGYlKtzI=; b=kOnGCqgsnKDhHVHTbV3i4FOeUf1rUI6B+cUhyw5kLMI8+okD/rBhvI6U6kpzrDPYQt ZyOVpNmsGgYaYyCJdroI6aDOVHX0+K9gD7DDiodq8Gl2sRcRwmKlyQ2L3TbWW3wEbQYN t/dRsmHoKcNEIbfxQ+yL0Ry0w6SF5GaL36H6k8q+WLS9N03z1979GfGDhQXon6npcjeJ QFgB7kQWx8NRhqxD7SsFAgFsc/lhG8XxesedBSin1gXNHHXnx9cYqdqMHemvLgeSzDoJ pm+ENDnWH+QSKv92z6WkdIQZh2SuD5oa0SgOTKA5TwQF3D6aIHWTM+hb6uvlANQ4s+IY dwQg== X-Gm-Message-State: ALoCoQlRinVCUY+zVaqlLykMa8QhypttQKY0Q7ks1riF2eJPNTfrcnaHi0sFFD++4AUd5kkLqQwY X-Received: by 10.180.182.81 with SMTP id ec17mr1397073wic.0.1425496473024; Wed, 04 Mar 2015 11:14:33 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.98 with SMTP id m2ls231364lae.5.gmail; Wed, 04 Mar 2015 11:14:32 -0800 (PST) X-Received: by 10.112.205.68 with SMTP id le4mr4770896lbc.96.1425496472710; Wed, 04 Mar 2015 11:14:32 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id w18si2909424laz.50.2015.03.04.11.14.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 11:14:32 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbiz12 with SMTP id z12so23581710lbi.5 for ; Wed, 04 Mar 2015 11:14:32 -0800 (PST) X-Received: by 10.112.224.3 with SMTP id qy3mr4895421lbc.36.1425496472627; Wed, 04 Mar 2015 11:14:32 -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 h5csp31824lbj; Wed, 4 Mar 2015 11:14:31 -0800 (PST) X-Received: by 10.66.66.135 with SMTP id f7mr9129269pat.93.1425496470725; Wed, 04 Mar 2015 11:14:30 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id nw2si6067339pab.196.2015.03.04.11.14.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 11:14:30 -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 1YTEj5-0006Gn-Dz; Wed, 04 Mar 2015 19:12:59 +0000 Received: from mail-wg0-f52.google.com ([74.125.82.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YTEiD-0005f3-W5 for linux-arm-kernel@lists.infradead.org; Wed, 04 Mar 2015 19:12:06 +0000 Received: by wghl18 with SMTP id l18so1478875wgh.5 for ; Wed, 04 Mar 2015 11:11:44 -0800 (PST) X-Received: by 10.180.211.235 with SMTP id nf11mr16056362wic.52.1425496304010; Wed, 04 Mar 2015 11:11:44 -0800 (PST) Received: from ards-macbook-pro.local ([213.143.60.151]) by mx.google.com with ESMTPSA id ch6sm7224104wjc.3.2015.03.04.11.11.40 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 11:11:42 -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 v3 3/4] arm64: remove __switch_data object from head.S Date: Wed, 4 Mar 2015 20:11:27 +0100 Message-Id: <1425496288-14483-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425496288-14483-1-git-send-email-ard.biesheuvel@linaro.org> References: <1425496288-14483-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_111206_223057_13368CF4 X-CRM114-Status: GOOD ( 11.66 ) 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.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.52 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.174 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)