From patchwork Tue May 22 09:55:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 10417797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 34CDF6016C for ; Tue, 22 May 2018 09:58:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2280E2237D for ; Tue, 22 May 2018 09:58:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1726927165; Tue, 22 May 2018 09:58:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9AB892237D for ; Tue, 22 May 2018 09:58:19 +0000 (UTC) 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:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nP0KVzphnrZSdbx3NI/qgPbx/dc64YheUfMmw+H2nLs=; b=ubIoBqimSk2wrF /eYgUUqmIOHTKfhknvAD2KnKUp+9y9HlVrtmNJfLDyvvUMsFCOJW6DZDEltUOpaW4DYbtMRX2hpEg HQCEUDUTAew12NhooQ2q9l/SJ3oKDc0VHuO9pox/meu9ErPMEYpWogdMeHkoT1uwXqoak1BH4/bof zj06ChUV9/shQfaauWiuDu12dNKkfKCJ+NV/3ibSnryHSmnG2q+GVFI4PgBd9rC1A8V1jp/hhAi7D kqZXKOKbOffTdnTjqaIo5sITpbF5Z4U+1JkURqjgNy6gUptKnxJly8/gnWFBah3Q+SrHwq43WIIdH PFZtMor+SSexQ6u4JOSg==; 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 1fL43b-0004md-HR; Tue, 22 May 2018 09:58:15 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fL43X-0004Go-PZ for linux-arm-kernel@lists.infradead.org; Tue, 22 May 2018 09:58:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2tauHeq9DRB34xSRdj+X7QfiBJge1xdt6SYWqEyfA2s=; b=W4PTZ4+mrNnb+tNWTXoMWIkSE K61zv+lafPeHt9130EO0BZcrSW53CHMkHx8WunBk76sBIjPw17SUKvgBH/tqjR18pEs5SJouZhYRP t1ZDHxhuAyBQDpxdsQxiDVQlvSdHHjMpUWwNJh/IaCIkB78dfWHiE/9nBtIqELlAQNpq8=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:44654) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fL40p-00035U-SD; Tue, 22 May 2018 10:55:24 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1fL40h-0005zv-7o; Tue, 22 May 2018 10:55:15 +0100 Date: Tue, 22 May 2018 10:55:06 +0100 From: Russell King - ARM Linux To: Florian Fainelli Subject: Re: [PATCH 06/14] ARM: spectre-v2: harden branch predictor on context switches Message-ID: <20180522095506.GQ17671@n2100.armlinux.org.uk> References: <20180521114238.GN17671@n2100.armlinux.org.uk> <61e24c59-9905-8524-92ba-98cdbadb3011@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <61e24c59-9905-8524-92ba-98cdbadb3011@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180522_025811_987835_57934368 X-CRM114-Status: GOOD ( 14.73 ) 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: Marc Zyngier , Christoffer Dall , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, May 21, 2018 at 08:21:58PM -0700, Florian Fainelli wrote: > > > On 05/21/2018 04:44 AM, Russell King wrote: > > Harden the branch predictor against Spectre v2 attacks on context > > switches for ARMv7 and later CPUs. We do this by: > > > > Cortex A9, A12, A17, A73, A75: invalidating the BTB. > > Cortex A15, Brahma B15: invalidating the instruction cache. > > > > Cortex A57 and Cortex A72 are not addressed in this patch. > > > > Cortex R7 and Cortex R8 are also not addressed as we do not enforce > > memory protection on these cores. > > > > Signed-off-by: Russell King > > Reviewed-by: Florian Fainelli It does need this additional patch to avoid some build errors - I'm surprised that my autobuilder found it before the 0-day builder... diff --git a/arch/arm/mm/proc-v7-bugs.c b/arch/arm/mm/proc-v7-bugs.c index 0c37e6a2830d..526d07ab6b7a 100644 --- a/arch/arm/mm/proc-v7-bugs.c +++ b/arch/arm/mm/proc-v7-bugs.c @@ -127,4 +127,8 @@ void cpu_v7_bugs_init(void) pr_info("CPU: Spectre v2: using %s workaround\n", spectre_v2_method); } +#else +void cpu_v7_bugs_init(void) +{ +} #endif