From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E64AC10F0E for ; Tue, 9 Apr 2019 11:30:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E430820857 for ; Tue, 9 Apr 2019 11:30:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="INxrLLSP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E430820857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8D4tYVEASIQtU3eJNIplIuzGXwItjyyzWUhApKbvpWY=; b=INxrLLSPHL9Hw7 nM566LAnpYZrEF1Z6arzlBo4kkXDTpiSkeyb4UNcPLx2yhm6Yfl6ajMRcT6jbpJEHV5RDBMZCT/NB H5USuNqQZPUdfy51Hu0ICZXgWPph993y3WzZEutSe1AlV6b9pjfDx11VrITCX1fEAGHUxEFvYd4mf uDJ+KH0fAKHFw4wJZFa9KuYthodNfmC+2s9yy0cujtv9mDP5CqlBUPRsjSDU4wfs030Cssx6oGdoq NyaNuqOV4buqkCH+9BxcjXa1P4om4qze/Lc1jxFiDKoSCk8b20WnVzu8UQ7mYmmmmhlgfbsQ/spI3 dOdLIX4ba1jwHwr+Xfsg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDowy-0004YS-Uu; Tue, 09 Apr 2019 11:30:00 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDoww-0004Xx-DW for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2019 11:29:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1955BA78; Tue, 9 Apr 2019 04:29:58 -0700 (PDT) Received: from [10.1.196.129] (ostrya.cambridge.arm.com [10.1.196.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 728713F59C; Tue, 9 Apr 2019 04:29:57 -0700 (PDT) Subject: Re: [PATCH 2/2] arm64: Save and restore OSDLR_EL1 To: Will Deacon References: <20190408171719.44711-1-jean-philippe.brucker@arm.com> <20190408171719.44711-3-jean-philippe.brucker@arm.com> <20190409103717.GA16236@fuggles.cambridge.arm.com> From: Jean-Philippe Brucker Message-ID: <7ad9f7e1-d664-01c9-0ab9-6b36ecc10b7b@arm.com> Date: Tue, 9 Apr 2019 12:29:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <20190409103717.GA16236@fuggles.cambridge.arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_042958_462331_10703354 X-CRM114-Status: GOOD ( 19.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 09/04/2019 11:37, Will Deacon wrote: > Hi Jean-Philippe, > > On Mon, Apr 08, 2019 at 06:17:19PM +0100, Jean-Philippe Brucker wrote: >> 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. >> >> Signed-off-by: Jean-Philippe Brucker >> --- >> arch/arm64/mm/proc.S | 34 ++++++++++++++++++---------------- >> 1 file changed, 18 insertions(+), 16 deletions(-) > > [...] > >> @@ -105,8 +106,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 >> @@ -132,6 +133,7 @@ alternative_endif >> */ >> ubfx x11, x11, #1, #1 >> msr oslar_el1, x11 >> + msr osdlr_el1, x5 > > Just one oddity, but I notice you restore these in the opposite order from > the order in which initialise them on the boot path. Is that ok? I haven't found any documentation about the unlock order. Given that OS Lock is locked before OS Double Lock, I think restoring OSDLR before OSLAR makes more sense, so I can change the order in this patch for consistency. > Also, did you test a suspend/resume cycle with this change? Yes but only on Juno, because the suspend/resume code doesn't seem to be used on TX2 Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel