From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga02-in.huawei.com ([119.145.14.65]:64859 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbcBOBnx (ORCPT ); Sun, 14 Feb 2016 20:43:53 -0500 Subject: Re: [PATCH 3/3] arm64: mm: ensure patched kernel text is fetched from PoU To: Greg KH References: <1454386007-11860-1-git-send-email-guohanjun@huawei.com> <1454386007-11860-4-git-send-email-guohanjun@huawei.com> <20160214210026.GB10498@kroah.com> CC: , , From: Hanjun Guo Message-ID: <56C12D47.1060703@huawei.com> Date: Mon, 15 Feb 2016 09:43:35 +0800 MIME-Version: 1.0 In-Reply-To: <20160214210026.GB10498@kroah.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 2016/2/15 5:00, Greg KH wrote: > On Tue, Feb 02, 2016 at 12:06:47PM +0800, Hanjun Guo wrote: >> From: Will Deacon >> >> The arm64 booting document requires that the bootloader has cleaned the >> kernel image to the PoC. However, when a CPU re-enters the kernel due to >> either a CPU hotplug "on" event or resuming from a low-power state (e.g. >> cpuidle), the kernel text may in-fact be dirty at the PoU due to things >> like alternative patching or even module loading. >> >> Thanks to I-cache speculation with the MMU off, stale instructions could >> be fetched prior to enabling the MMU, potentially leading to crashes >> when executing regions of code that have been modified at runtime. >> >> This patch addresses the issue by ensuring that the local I-cache is >> invalidated immediately after a CPU has enabled its MMU but before >> jumping out of the identity mapping. Any stale instructions fetched from >> the PoC will then be discarded and refetched correctly from the PoU. >> Patching kernel text executed prior to the MMU being enabled is >> prohibited, so the early entry code will always be clean. >> >> Reviewed-by: Mark Rutland >> Tested-by: Mark Rutland >> Signed-off-by: Will Deacon >> Signed-off-by: Hanjun Guo >> --- >> arch/arm64/kernel/head.S | 8 ++++++++ >> arch/arm64/kernel/sleep.S | 8 ++++++++ >> arch/arm64/mm/proc.S | 1 - >> 3 files changed, 16 insertions(+), 1 deletion(-) > You forgot to say what the upstream git commit id is for this :( > Sorry, it's 8ec41987436d566f7c4559c6871738b869f7ef07. Thanks Hanjun