From patchwork Mon May 11 07:13:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48210 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BC2B62121F for ; Mon, 11 May 2015 07:16:18 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf39245390lab.1 for ; Mon, 11 May 2015 00:16:17 -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=o2Wwv3rQk9/sTiGDr+WX9hvyMQNbaGuio6c2gMr0y6s=; b=RuetJCYyzfC0yXICKEcu1FPUjf5fw9RkWGDLM9g6EkWnN/FyvEDl1c9bSq9niI1Xj5 WmqA8BxxqdE93YjDw5aFDA23ZDfgNaL2j0/AUgzDzvcTceske8NH2KRy1BD3f/N6goAk JGJWf8laJ4ypNA2zNiQxQ28Xjj79n/EB8bShSp7gdRtvQGufARpf4xj1+j3Mr8ouRb/Q zlYxxo6pLclg5JGuEiVsvyi/Wc/s+ELdXF78I3PbRFScbux6arHK/cGvyW5VEu31obJh dQO6kWId5QEuEcWms7dExI3rdoSggtyTDnuIVyshJf15EhbhBlzW71jw9CMZLBDk2yq0 PBWA== X-Gm-Message-State: ALoCoQn7e/Nyz27jB5uIz/D89EbrZCOcR6PHhmfetxojvBTiPkeUDOqO3z2N+L2jywc+JlO/2dXI X-Received: by 10.152.184.73 with SMTP id es9mr6690396lac.4.1431328577765; Mon, 11 May 2015 00:16:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.10 with SMTP id p10ls616738lag.29.gmail; Mon, 11 May 2015 00:16:17 -0700 (PDT) X-Received: by 10.112.132.9 with SMTP id oq9mr7029147lbb.26.1431328577490; Mon, 11 May 2015 00:16:17 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id dv6si7851383lbc.141.2015.05.11.00.16.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbuc2 with SMTP id uc2so87457720lbb.2 for ; Mon, 11 May 2015 00:16:17 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr6874611lbb.76.1431328577353; Mon, 11 May 2015 00:16:17 -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.108.230 with SMTP id hn6csp1345759lbb; Mon, 11 May 2015 00:16:16 -0700 (PDT) X-Received: by 10.68.69.35 with SMTP id b3mr16917658pbu.96.1431328575556; Mon, 11 May 2015 00:16:15 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id gi6si16787012pbd.142.2015.05.11.00.16.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:16:15 -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 1Yrhv5-0001D7-0n; Mon, 11 May 2015 07:14:31 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YrhuH-0000is-88 for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2015 07:13:42 +0000 Received: by wgiu9 with SMTP id u9so119063573wgi.3 for ; Mon, 11 May 2015 00:13:19 -0700 (PDT) X-Received: by 10.180.19.100 with SMTP id d4mr16855299wie.29.1431328399618; Mon, 11 May 2015 00:13:19 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id o5sm10728933wia.0.2015.05.11.00.13.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 00:13:18 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/10] arm64: drop sleep_idmap_phys and clean up cpu_resume() Date: Mon, 11 May 2015 09:13:01 +0200 Message-Id: <1431328388-3051-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431328388-3051-1-git-send-email-ard.biesheuvel@linaro.org> References: <1431328388-3051-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150511_001341_472284_E281FAE9 X-CRM114-Status: GOOD ( 11.42 ) 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.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.49 listed in wl.mailspike.net] -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.177 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 Two cleanups of the asm function cpu_resume(): - 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. - Unclutter the load of sleep_save_sp::save_ptr_stash_phys. Acked-by: Lorenzo Pieralisi Tested-by: Lorenzo Pieralisi 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 811e61a2d847..803cfea41962 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; }