From patchwork Mon Apr 4 14:52:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 65003 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1232326lbc; Mon, 4 Apr 2016 07:54:23 -0700 (PDT) X-Received: by 10.66.136.41 with SMTP id px9mr124766pab.80.1459781663540; Mon, 04 Apr 2016 07:54:23 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id i64si42201719pfi.132.2016.04.04.07.54.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Apr 2016 07:54:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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 1an5sR-0005Dm-3l; Mon, 04 Apr 2016 14:53:15 +0000 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1an5s8-00056h-K1 for linux-arm-kernel@lists.infradead.org; Mon, 04 Apr 2016 14:52:59 +0000 Received: by mail-lf0-x231.google.com with SMTP id p188so147274122lfd.0 for ; Mon, 04 Apr 2016 07:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OISv8TxUO2RULuDS7IDX2BiF/WYl51QttPGVNN3CuO0=; b=KLv8qzOkoFCEkBanu3Pt1mtccHvm4gU4LKO/OxBsquj09boWdxOxrEbllEiMODCtSj 99Enxp5lnP5ZKg1etUED24A5+Dd1D2VcTkOIl7Jp29INirb/J5Uwe4gLnXhPLeZ9oO19 GkdXbb1JdfIuS6nSBKYbVGxweYDQVS4n3DOKI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OISv8TxUO2RULuDS7IDX2BiF/WYl51QttPGVNN3CuO0=; b=bFMijCOKQmZjz5G3atTEqo4sdtZ6PbrgCU7q1lTvHSfJo6VwzWuoFbvYRJ5+eRiyia v8jJlo4CCeaPtrxsGej4mYnjkUsvSMooehMUP0C32hgIL48os84MwO/JEEQqyaD3YdxE Pcn0BFw1xul69he7yOAcmqo7T/3ZytyUbj0vA0nVAzOPoGRtKM8yJemtZsnH1+4wC8Yi qs4oemWBegG/8DYOS+zkkPNdFvOaGYmX7siwPaJ0HwBL3/rNSx5pqo1iFAd6qhueeysG KM41bIiXIff+ZyFDszY2wKXchcRFd1yOJGdGssTn4q6CbVNEH+ij++NAThiKYLjTj19t f8hA== X-Gm-Message-State: AD7BkJKZq3/cTuBjUG5vTlQqQ//WL5gtn4aweCtD4y6r9xEp6LctxipTRVhehcuqjztDg67L X-Received: by 10.194.179.227 with SMTP id dj3mr11781545wjc.50.1459781554139; Mon, 04 Apr 2016 07:52:34 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id cf6sm7922528wjc.12.2016.04.04.07.52.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Apr 2016 07:52:33 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com Subject: [PATCH 2/8] arm64/kernel: reuse boot_args array to get to __fdt_pointer Date: Mon, 4 Apr 2016 16:52:18 +0200 Message-Id: <1459781544-14310-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459781544-14310-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459781544-14310-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160404_075256_960146_B515D391 X-CRM114-Status: GOOD ( 13.50 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:231 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Since we record the boot_args [x0 .. x3] early at boot anyway, there is no need to keep the FDT address in a callee saved register with file scope in head.S. So simply refer to boot_args[0] directly in the call to setup_machine(), and drop the handling of x21 from head.S entirely. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/head.S | 14 ++++++-------- arch/arm64/kernel/setup.c | 4 +--- 2 files changed, 7 insertions(+), 11 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 69b33535911e..9d8f928c355c 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -234,16 +234,15 @@ ENDPROC(stext) * Preserve the arguments passed by the bootloader in x0 .. x3 */ preserve_boot_args: - mov x21, x0 // x21=FDT - - adr_l x0, boot_args // record the contents of - stp x21, x1, [x0] // x0 .. x3 at kernel entry - stp x2, x3, [x0, #16] + adr_l x4, boot_args // record the contents of + stp x0, x1, [x4] // x0 .. x3 at kernel entry + stp x2, x3, [x4, #16] dmb sy // needed before dc ivac with // MMU off - add x1, x0, #0x20 // 4 x 8 bytes + mov x0, x4 + add x1, x4, #0x20 // 4 x 8 bytes b __inval_cache_range // tail call ENDPROC(preserve_boot_args) @@ -480,7 +479,6 @@ __mmap_switched: mov x4, sp and x4, x4, #~(THREAD_SIZE - 1) msr sp_el0, x4 // Save thread_info - str_l x21, __fdt_pointer, x5 // Save FDT pointer ldr_l x4, kimage_vaddr // Save the offset between sub x4, x4, x24 // the kernel virtual and @@ -492,7 +490,7 @@ __mmap_switched: #endif #ifdef CONFIG_RANDOMIZE_BASE cbnz x23, 0f // already running randomized? - mov x0, x21 // pass FDT address in x0 + ldr_l x0, boot_args // pass FDT address in x0 bl kaslr_early_init // parse FDT for KASLR options cbz x0, 0f // KASLR disabled? just proceed mov x23, x0 // record KASLR offset diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 9dc67769b6a4..83a3e484a90a 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -64,8 +64,6 @@ #include #include -phys_addr_t __fdt_pointer __initdata; - /* * Standard memory resources */ @@ -304,7 +302,7 @@ void __init setup_arch(char **cmdline_p) early_fixmap_init(); early_ioremap_init(); - setup_machine_fdt(__fdt_pointer); + setup_machine_fdt(boot_args[0]); parse_early_param();