From patchwork Mon Mar 23 09:07:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 46170 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FD0520D10 for ; Mon, 23 Mar 2015 09:10:11 +0000 (UTC) Received: by wggx13 with SMTP id x13sf25789829wgg.0 for ; Mon, 23 Mar 2015 02:10: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: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=DJ3Gj5XH54vcBGtjIfaRp9MHtFlWBXXoTvIZj0JfeMc=; b=DnWGs/OerzIFpaj7enAX3eddH1cexrlAb4xOnydk20W9eZVtMclnHI81EeedyS0Zzh Rrfk0t/mBEn6Z9RmksADjkippCnta2BfMvZUc22a+syNKRwpY6r7TnOptx0XbA0omGzJ K3+tAnN1WJ6TAjPIRUC9wJE8u/IEIgxnLfNh2Ap84kWeeHMTkc+hMaNDdDO+bh8TlHNL 98UVDCivB093JUCX4ysWcpmoChM+FZgHjzJlvgMiAX/IyTv7W7zoCPEKp3cTsLMS2T1d 4ffy3UmjbVADOgtS/KS+c8IM9/5xYfDtLhEYK8rm8UqvK0sMRD3a1za5Zxsa0UCIfrCY CI8A== X-Gm-Message-State: ALoCoQn3nxSgZUt7YKFRz1arSjcpjHnuaiT1MgzstI7KPKHhRunmthcVnlVncbPDhnwzutjlQ73Q X-Received: by 10.112.181.166 with SMTP id dx6mr12815663lbc.17.1427101810902; Mon, 23 Mar 2015 02:10:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.4 with SMTP id dc4ls658888lac.73.gmail; Mon, 23 Mar 2015 02:10:10 -0700 (PDT) X-Received: by 10.152.121.33 with SMTP id lh1mr83236195lab.86.1427101810590; Mon, 23 Mar 2015 02:10:10 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id pq6si100226lbc.137.2015.03.23.02.10.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 02:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labto5 with SMTP id to5so21120505lab.0 for ; Mon, 23 Mar 2015 02:10:10 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr15189168lac.36.1427101810418; Mon, 23 Mar 2015 02:10:10 -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.57.201 with SMTP id k9csp700747lbq; Mon, 23 Mar 2015 02:10:09 -0700 (PDT) X-Received: by 10.68.251.226 with SMTP id zn2mr19126631pbc.100.1427101805423; Mon, 23 Mar 2015 02:10:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kt1si382743pdb.20.2015.03.23.02.10.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 02:10:05 -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 1YZyLU-0007qe-Ik; Mon, 23 Mar 2015 09:08:28 +0000 Received: from mail-wg0-f51.google.com ([74.125.82.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YZyL1-0007g9-U1 for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2015 09:08:01 +0000 Received: by wgbcc7 with SMTP id cc7so140290798wgb.0 for ; Mon, 23 Mar 2015 02:07:38 -0700 (PDT) X-Received: by 10.180.77.199 with SMTP id u7mr17694820wiw.42.1427101658080; Mon, 23 Mar 2015 02:07:38 -0700 (PDT) Received: from ards-macbook-pro.local (62.82.106.185.static.user.ono.com. [62.82.106.185]) by mx.google.com with ESMTPSA id hw7sm400542wjb.24.2015.03.23.02.07.36 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Mar 2015 02:07:37 -0700 (PDT) From: Ard Biesheuvel To: mark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/3] arm64: drop sleep_idmap_phys Date: Mon, 23 Mar 2015 10:07:26 +0100 Message-Id: <1427101646-465-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1427101646-465-1-git-send-email-ard.biesheuvel@linaro.org> References: <1427101646-465-1-git-send-email-ard.biesheuvel@linaro.org> In-Reply-To: <1426870974-4801-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426870974-4801-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150323_020800_204091_3FAAE722 X-CRM114-Status: GOOD ( 11.03 ) 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.51 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.51 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.45 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 The global variable sleep_idmap_phys always points to idmap_pg_dir, so we can just use that value directly in the CPU resume path. Also unclutters the load of sleep_save_sp::save_ptr_stash_phys. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/sleep.S | 7 ++----- arch/arm64/kernel/suspend.c | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S index 04dc9aa2831e..3c98fe1c1c2f 100644 --- a/arch/arm64/kernel/sleep.S +++ b/arch/arm64/kernel/sleep.S @@ -164,15 +164,12 @@ ENTRY(cpu_resume) #else mov x7, xzr #endif - adrp x0, sleep_save_sp - add x0, x0, #:lo12:sleep_save_sp - ldr x0, [x0, #SLEEP_SAVE_SP_PHYS] + ldr_l x0, sleep_save_sp + SLEEP_SAVE_SP_PHYS ldr x0, [x0, x7, lsl #3] /* load sp from context */ ldr x2, [x0, #CPU_CTX_SP] - adrp x1, sleep_idmap_phys /* load physical address of identity map page table in x1 */ - ldr x1, [x1, #:lo12:sleep_idmap_phys] + adrp x1, idmap_pg_dir mov sp, x2 /* * cpu_do_resume expects x0 to contain context physical address diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c index d7daf45ae7a2..f6073c27d65f 100644 --- a/arch/arm64/kernel/suspend.c +++ b/arch/arm64/kernel/suspend.c @@ -118,7 +118,6 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) } struct sleep_save_sp sleep_save_sp; -phys_addr_t sleep_idmap_phys; static int __init cpu_suspend_init(void) { @@ -132,9 +131,7 @@ static int __init cpu_suspend_init(void) sleep_save_sp.save_ptr_stash = ctx_ptr; sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr); - sleep_idmap_phys = virt_to_phys(idmap_pg_dir); __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp)); - __flush_dcache_area(&sleep_idmap_phys, sizeof(sleep_idmap_phys)); return 0; }