From patchwork Tue Mar 17 10:11:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45874 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 904E22153C for ; Tue, 17 Mar 2015 10:14:09 +0000 (UTC) Received: by wibbs8 with SMTP id bs8sf1273992wib.3 for ; Tue, 17 Mar 2015 03:14:08 -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=2ZGFWy0HsTRlfnoFhyheJ4VqBOoJXmMOsbwkj66W3qo=; b=EXQdH7wy4XiXd/EbrzNiYg5+ROwpxzi7NzZWYOWbD6oyCR2ewp1o3gZ8yoV9UhtT1f P/t2ep5zm4i+VZ5Uk58jT6epR4nnHt6GQJ7GHaXLacgkU1Hq4BhyubUKQVC2X1Z5sg9L +uLRsH8xvQVCxI25WDJXrCjzyXx64U0HHtqTAsxpWuJcD73bD0EAQg8FL5phQVodHiL7 mhTZk5WZZgGDLQ36xsY4nMMVNNV55XT0KXcwPidj5+nyjn1XdmsrGDYlJ1amGvzy6qoU gt1TT524zU0v4SVJO3B6rHMPJLOnaK4HxS7Fpl2xnr0hfploGLpl7tpBAVAomAqFIW9P icTQ== X-Gm-Message-State: ALoCoQmxRbakdc99Ks/z4YZgYd2hG3lEYKG88lDoelePKRG1FAIoouU6J9qcZHc3AfvAayG3YsbV X-Received: by 10.152.4.229 with SMTP id n5mr9905798lan.1.1426587248791; Tue, 17 Mar 2015 03:14:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.202.133 with SMTP id ki5ls16388lac.90.gmail; Tue, 17 Mar 2015 03:14:08 -0700 (PDT) X-Received: by 10.152.163.2 with SMTP id ye2mr35795004lab.89.1426587248177; Tue, 17 Mar 2015 03:14:08 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id lm12si10153135lac.175.2015.03.17.03.14.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 03:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagg8 with SMTP id g8so4180729lag.1 for ; Tue, 17 Mar 2015 03:14:07 -0700 (PDT) X-Received: by 10.152.26.201 with SMTP id n9mr58473822lag.29.1426587247394; Tue, 17 Mar 2015 03:14:07 -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 h5csp403101lbj; Tue, 17 Mar 2015 03:14:06 -0700 (PDT) X-Received: by 10.66.140.69 with SMTP id re5mr116457459pab.105.1426587243137; Tue, 17 Mar 2015 03:14:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id z2si28329432par.230.2015.03.17.03.14.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 03:14:03 -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 1YXoU7-0003MG-2h; Tue, 17 Mar 2015 10:12:27 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YXoTW-00037m-7l for linux-arm-kernel@lists.infradead.org; Tue, 17 Mar 2015 10:11:51 +0000 Received: by wixw10 with SMTP id w10so6541043wix.0 for ; Tue, 17 Mar 2015 03:11:28 -0700 (PDT) X-Received: by 10.180.14.66 with SMTP id n2mr168211028wic.50.1426587088064; Tue, 17 Mar 2015 03:11:28 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.4.220]) by mx.google.com with ESMTPSA id r3sm19260430wjw.7.2015.03.17.03.11.26 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Mar 2015 03:11:27 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, marc.zyngier@arm.com Subject: [PATCH 1/3] arm64: merge __enable_mmu and __turn_mmu_on Date: Tue, 17 Mar 2015 11:11:12 +0100 Message-Id: <1426587074-22390-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426587074-22390-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426587074-22390-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150317_031150_509245_21B0AB32 X-CRM114-Status: GOOD ( 13.26 ) 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.171 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.171 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.49 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 Enabling of the MMU is split into two functions, with an align and a branch in the middle. On arm64, the entire kernel Image is ID mapped so this is really not necessary, and we can just merge it into a single function. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/head.S | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 65c7de889c8c..fb912314d5e1 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -615,8 +615,13 @@ ENDPROC(__secondary_switched) #endif /* CONFIG_SMP */ /* - * Setup common bits before finally enabling the MMU. Essentially this is just - * loading the page table pointer and vector base registers. + * Enable the MMU. This completely changes the structure of the visible memory + * space. You will not be able to trace execution through this. + * + * x0 = system control register + * x27 = *virtual* address to jump to upon completion + * + * other registers depend on the function called upon completion * * On entry to this code, x0 must contain the SCTLR_EL1 value for turning on * the MMU. @@ -627,29 +632,10 @@ __enable_mmu: msr ttbr0_el1, x25 // load TTBR0 msr ttbr1_el1, x26 // load TTBR1 isb - b __turn_mmu_on -ENDPROC(__enable_mmu) - -/* - * Enable the MMU. This completely changes the structure of the visible memory - * space. You will not be able to trace execution through this. - * - * x0 = system control register - * x27 = *virtual* address to jump to upon completion - * - * other registers depend on the function called upon completion - * - * We align the entire function to the smallest power of two larger than it to - * ensure it fits within a single block map entry. Otherwise were PHYS_OFFSET - * close to the end of a 512MB or 1GB block we might require an additional - * table to map the entire function. - */ - .align 4 -__turn_mmu_on: msr sctlr_el1, x0 isb br x27 -ENDPROC(__turn_mmu_on) +ENDPROC(__enable_mmu) /* * Calculate the start of physical memory.