Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp108097yba; Mon, 20 May 2019 05:51:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9KWKZmwFfLAiTF246HZ1nbXsfPAOEn17QRn7T4fG3SdU4imPUVEwlVQOtwI21Tg7JfieC X-Received: by 2002:a17:902:a415:: with SMTP id p21mr62143184plq.286.1558356694083; Mon, 20 May 2019 05:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558356694; cv=none; d=google.com; s=arc-20160816; b=Lvv6VRzzEp7vcCGQ2t/cZwHNcrbMw06dRgTStLMfi3lpzuFvobgpAZzEA3uaefhX9S /nfxKDtmNfUghPSakdeyGbTRfxGndUAYosa9UXqA4+uK81Mpm4dvCpFakwwsXSjZvTAY OeQQR15tkm9z7GGyHOo6B5gZNYrb2iX6V8/t2fD2RiJLzAeRsdkW9Zec8FsvbSpTlwKT 9ejTgYbN4ztPA1DMOSqBjosbJ0a5lSyPvdNlMTkMqNt/w70506839NDKAWrFAxBSkHL6 MRgas/m+R8KErSKiZwX1pKMWcnFV/+C2nYqIp+bDcXySHL2gyuwam9mir7lO1eIhy6Cy w26w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gLy2YT9n9MRlDtiSyvkpR4heNwb2JPTWPrkDUdKnCdw=; b=Mh+93+cXiCw4+CEvi4PBzf8FIWwrlVp4JDhHfoboaYHq31gXTs9KnCjN6DMLrTjVE9 MRouEW6GJMFBMI8k2C0MdJpOSwSlgfuhB1LHUWLKxDunK4kfzk0MjqSicAAjXqMg9Noq uxYZhKiAwLmME0R1yQDJCrlf8vPqd+fwOv/a2DAtmlcrkNhxDEjVR5A6BbK+IaNadSDN Qxdu4wPlENeGRP3zsMXxYSpiMHgoaXRxPorJZApy72nCqs5Hw2i7Xqs3Q0adJEAMj6e2 toN+5+GMTIIa5gIniDYs9WcEcKIrCGuqMKwBhqkVwJ0Piz50oDhrhnr+3NSJzpxRejgP 9TRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V4AJRtcj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h93si18822953plb.256.2019.05.20.05.51.19; Mon, 20 May 2019 05:51:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V4AJRtcj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388164AbfETMV1 (ORCPT + 99 others); Mon, 20 May 2019 08:21:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:35060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbfETMVZ (ORCPT ); Mon, 20 May 2019 08:21:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E85820815; Mon, 20 May 2019 12:21:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354884; bh=RjZ8OXCMB15G5CMO1j9gNDPu9pHkuM/Pdu1KK0RfFRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V4AJRtcjBIKltOHm5gXnEGM5TySQW1wDOOpEsBNv4o1iwnG+RVWRB1DsDrchVdrvT BfsFMQruDzFHMyWQDRG1M+jnqjqoPrz7UWGi7jbmIQm0nJfW9zZhMFWMH3fFoF87wc +9REW70tbrxbBO/F30YzOX5yuy0QRl/jNro04FfA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean-Philippe Brucker , Will Deacon Subject: [PATCH 4.19 016/105] arm64: Save and restore OSDLR_EL1 across suspend/resume Date: Mon, 20 May 2019 14:13:22 +0200 Message-Id: <20190520115248.146098415@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jean-Philippe Brucker commit 827a108e354db633698f0b4a10c1ffd2b1f8d1d0 upstream. When the CPU comes out of suspend, the firmware may have modified the OS Double Lock Register. Save it in an unused slot of cpu_suspend_ctx, and restore it on resume. Cc: Signed-off-by: Jean-Philippe Brucker Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/proc.S | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -70,24 +70,25 @@ ENTRY(cpu_do_suspend) mrs x2, tpidr_el0 mrs x3, tpidrro_el0 mrs x4, contextidr_el1 - mrs x5, cpacr_el1 - mrs x6, tcr_el1 - mrs x7, vbar_el1 - mrs x8, mdscr_el1 - mrs x9, oslsr_el1 - mrs x10, sctlr_el1 + mrs x5, osdlr_el1 + mrs x6, cpacr_el1 + mrs x7, tcr_el1 + mrs x8, vbar_el1 + mrs x9, mdscr_el1 + mrs x10, oslsr_el1 + mrs x11, sctlr_el1 alternative_if_not ARM64_HAS_VIRT_HOST_EXTN - mrs x11, tpidr_el1 + mrs x12, tpidr_el1 alternative_else - mrs x11, tpidr_el2 + mrs x12, tpidr_el2 alternative_endif - mrs x12, sp_el0 + mrs x13, sp_el0 stp x2, x3, [x0] - stp x4, xzr, [x0, #16] - stp x5, x6, [x0, #32] - stp x7, x8, [x0, #48] - stp x9, x10, [x0, #64] - stp x11, x12, [x0, #80] + stp x4, x5, [x0, #16] + stp x6, x7, [x0, #32] + stp x8, x9, [x0, #48] + stp x10, x11, [x0, #64] + stp x12, x13, [x0, #80] ret ENDPROC(cpu_do_suspend) @@ -110,8 +111,8 @@ ENTRY(cpu_do_resume) msr cpacr_el1, x6 /* Don't change t0sz here, mask those bits when restoring */ - mrs x5, tcr_el1 - bfi x8, x5, TCR_T0SZ_OFFSET, TCR_TxSZ_WIDTH + mrs x7, tcr_el1 + bfi x8, x7, TCR_T0SZ_OFFSET, TCR_TxSZ_WIDTH msr tcr_el1, x8 msr vbar_el1, x9 @@ -135,6 +136,7 @@ alternative_endif /* * Restore oslsr_el1 by writing oslar_el1 */ + msr osdlr_el1, x5 ubfx x11, x11, #1, #1 msr oslar_el1, x11 reset_pmuserenr_el0 x0 // Disable PMU access from EL0