From patchwork Mon Jun 1 11:40:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 49297 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E348B218FC for ; Mon, 1 Jun 2015 11:43:36 +0000 (UTC) Received: by wgla2 with SMTP id a2sf32807320wgl.1 for ; Mon, 01 Jun 2015 04:43:36 -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=A1DmoJE2nayP2nbVxWVwIME0wvgr5wsmLCWeUXLE5NGl3tmvMb3QuHJu2s7SdDadCO 1TfQy8Y7AYuE0mNtQVkAAhB15Dvid7sVm/8cbYnQwW0xAiOW071lV6ilOVoPoz4ZQ5jX WUP/lZcLma8BsyzOp42q8Ln0MhyofkS6fSD/gNG5Yau2DxxMr+6m+wx5+ZT03oex7jY6 zNSeLO+q/tppYWet/yDh7b+9AuNRAQ9MxeM7atStusEU4E+awL8kpMfyPOAt9KYwGNNP DREi53fBk9eYDJ1sSBwX8r8YLqsLpNaDjwXsX4Zr6ZYx3kuDXBeLQ3WKkxIDLHUzfyHs U6rw== X-Gm-Message-State: ALoCoQnQm/NqSdi0qeMJ53XNtQZSTjqLqHH72AbaiYL6QB3wEYZGfFaWWFhXPl7gyyrEcDg1HDoc X-Received: by 10.112.144.4 with SMTP id si4mr13859233lbb.17.1433159016231; Mon, 01 Jun 2015 04:43:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.166 with SMTP id z6ls582620laj.64.gmail; Mon, 01 Jun 2015 04:43:36 -0700 (PDT) X-Received: by 10.152.197.2 with SMTP id iq2mr20770263lac.103.1433159016083; Mon, 01 Jun 2015 04:43:36 -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 x7si2628662laa.34.2015.06.01.04.43.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:43:36 -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 labpy14 with SMTP id py14so87390992lab.0 for ; Mon, 01 Jun 2015 04:43:36 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr20433438lbb.76.1433159015968; Mon, 01 Jun 2015 04:43:35 -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 hn6csp2250681lbb; Mon, 1 Jun 2015 04:43:34 -0700 (PDT) X-Received: by 10.70.90.1 with SMTP id bs1mr40004254pdb.10.1433159014216; Mon, 01 Jun 2015 04:43:34 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id km5si21152046pdb.246.2015.06.01.04.43.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:43:34 -0700 (PDT) Received-SPF: pass (google.com: 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; 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 1YzO6L-00081A-Hy; Mon, 01 Jun 2015 11:41:53 +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 1YzO5l-0007kY-NY for linux-arm-kernel@lists.infradead.org; Mon, 01 Jun 2015 11:41:19 +0000 Received: by wgv5 with SMTP id 5so111736173wgv.1 for ; Mon, 01 Jun 2015 04:40:55 -0700 (PDT) X-Received: by 10.180.87.201 with SMTP id ba9mr19839293wib.73.1433158855413; Mon, 01 Jun 2015 04:40:55 -0700 (PDT) Received: from localhost.localdomain ([31.157.58.113]) by mx.google.com with ESMTPSA id l6sm21505253wjz.4.2015.06.01.04.40.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 04:40:54 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH for-v4.2 4/4] arm64: drop sleep_idmap_phys and clean up cpu_resume() Date: Mon, 1 Jun 2015 13:40:34 +0200 Message-Id: <1433158834-25238-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433158834-25238-1-git-send-email-ard.biesheuvel@linaro.org> References: <1433158834-25238-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150601_044117_945997_A677BB74 X-CRM114-Status: GOOD ( 11.71 ) 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 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.52 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: roy.franz@linaro.org, will.deacon@arm.com, leif.lindholm@linaro.org, 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 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; }