Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3667877ima; Mon, 4 Feb 2019 03:07:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ZX7Anm0GiFLvbw66vNGDQqk0lvC5Z0OiBbgbsil79b2yFgaeq/ZThWvO22jVBh3lpaB9Z X-Received: by 2002:a17:902:b40d:: with SMTP id x13mr51901939plr.237.1549278474615; Mon, 04 Feb 2019 03:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549278474; cv=none; d=google.com; s=arc-20160816; b=zaKtp2V/Deh44wOEoU/dYphyucBYVX6rT3LYHOouiSOGGyR2YtNkfcAagalvnAf4R4 1Jyww03J+fy9wof3ZRd2e+i53HsL1UumKJHfDKUVP+eWivvoeCiPqb1b+Ce6brMmk6Qd UFFqXUGfusb0/R7W8z+x0ZAV3NtGZA/d++jUbxHdTl7zDW/cdXD6YjlhvjBUHM3HhFQc NRuKqj5znH/i4mmdh+E4AFbPS2WdjWZDJCl8Fa9k+qGnWR1IISpkiy+1pTTaNmtTL+NT hNc0RzOp8YiPj1FHC+778etgFObeIAx80d1DB1Na0h69PGgO9HcthjRJ/Wgz814p22En AbtA== 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=LxREl37CzF3zVDbQRIQEtsLi70VLAxYwd4zldRzyQdI=; b=jlRUcKssWijTwWPMHDQP9yxQw0mRQjKAPscaeNItdAfXgiokQMZZigbq3m4lARJZZV i2YnQofaeICyjt7bcbXj6h8WJhQLT7m+SYjhhg8kW2x/YvqdGzkKf531LkcPdp9bDoQ9 Jcmae4US+/XDZ7BR/j3X8aiU5wIZK8v9eh/mxOc5sK9npGR2gManaX0qFJxHF39cz4kw 46VnaHa5A7B0eBQ65KrwHdU3ctHSuSQhVISuZwk4BciYD/dQGG/3o0947VZ9A5UB8cAS Dkctnhj05YQX2sp1InbagJM/yvRxwKBLaQsk3KoU5BjH+AS2Sjrh/SYj3N+sxkdKVZDa SjLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KmFbyLEG; 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 g31si16038572pld.358.2019.02.04.03.07.38; Mon, 04 Feb 2019 03:07:54 -0800 (PST) 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=KmFbyLEG; 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 S1730703AbfBDKnR (ORCPT + 99 others); Mon, 4 Feb 2019 05:43:17 -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