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=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 4D8C7C282C4 for ; Mon, 4 Feb 2019 10:43:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E9232075B for ; Mon, 4 Feb 2019 10:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549276999; bh=/CAce4KVjiK/BAo+ccijntJ5fxGCwfJXiVQ9SMbSHm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TFD/78422FJ05KIpWsYcTuL+JFCB9pX4/DPDCfkebpgKj+jY6/0KHtd0gryaTQyM2 X+TwHCs4ESVDKR+hKXPrTyLohLUmRE7oFZ7G9tnP7MhmP2Os/4vVaCk05oyd8XSSwr iIOODpOZRgeB714coqQ2C8ZCQTgWYIfwynCQH4hw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730706AbfBDKnS (ORCPT ); Mon, 4 Feb 2019 05:43:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:41122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729860AbfBDKnP (ORCPT ); Mon, 4 Feb 2019 05:43:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 59D592087C; Mon, 4 Feb 2019 10:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549276994; bh=/CAce4KVjiK/BAo+ccijntJ5fxGCwfJXiVQ9SMbSHm0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KmFbyLEGxEYfuo6j7Xh95VlruNNJjjPUQqO9ixY71q0daxfGkA8VIH2QzULdKPMAu hpRJfW63nlOCf7ie4Qepv2kfcH05s4CAUb0ICERL5y6KK09WXpzKb+CtKS9RZhTNeV HMNkFvC0NOnFFKguWlWDrS5YxswdDCuUJLhD5pUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Morse , Will Deacon Subject: [PATCH 4.9 18/30] arm64: hibernate: Clean the __hyp_text to PoC after resume Date: Mon, 4 Feb 2019 11:36:56 +0100 Message-Id: <20190204103608.727363689@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204103605.271746870@linuxfoundation.org> References: <20190204103605.271746870@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Morse commit f7daa9c8fd191724b9ab9580a7be55cd1a67d799 upstream. During resume hibernate restores all physical memory. Any memory that is accessed with the MMU disabled needs to be cleaned to the PoC. KVMs __hyp_text was previously ommitted as it runs with the MMU enabled, but now that the hyp-stub is located in this section, we must clean __hyp_text too. This ensures secondary CPUs that come online after hibernate has finished resuming, and load KVM via the freshly written hyp-stub see the correct instructions. Signed-off-by: James Morse Cc: stable@vger.kernel.org Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/hibernate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/arm64/kernel/hibernate.c +++ b/arch/arm64/kernel/hibernate.c @@ -297,8 +297,10 @@ int swsusp_arch_suspend(void) dcache_clean_range(__idmap_text_start, __idmap_text_end); /* Clean kvm setup code to PoC? */ - if (el2_reset_needed()) + if (el2_reset_needed()) { dcache_clean_range(__hyp_idmap_text_start, __hyp_idmap_text_end); + dcache_clean_range(__hyp_text_start, __hyp_text_end); + } /* * Tell the hibernation core that we've just restored