From owner-svn-src-all@freebsd.org Fri Jan 12 14:54:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F7C8E69455 for ; Fri, 12 Jan 2018 14:54:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3D746E678 for ; Fri, 12 Jan 2018 14:54:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id p139so9384147itb.1 for ; Fri, 12 Jan 2018 06:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Go4lAj5ElGPELLGX4kIGa4LVnPjIn6Fsn267DIqUfyk=; b=rpG9IP5WD5KDJDM1l3ludSYp0oQbHGfeG+wJTbvDzi0uicZ0UakNOvKV3unuzzwbja JjlL2cq2TDzpYG4cgK49sNVOUiC028CkaQ9fe674KX2aODXO7R2jf0Y1CX65JE2cbX4i zsoT0zzucUddfqheyS4KPl4Uovy6KRfXZaIkNKo1w0/VKSAZuioV/ag62Lflrf1O4iEk eeQtrBZwNTagigUeKWqQ+z9rZjROheQuzrsbsY1daj2zCsMSzNSAgOlfHeBcxUjOyL4K vNJoUlYR4XSpAYWZwBczHUT/cc+9wlN2gDiuYUhAtZXiPdw37y5bCvXmWtE696ypy8TA mdGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Go4lAj5ElGPELLGX4kIGa4LVnPjIn6Fsn267DIqUfyk=; b=RyFBi8/YEtWQkaLcx8Y3pyd4mOpSYAJZH55fM7Ob244Bx91FhN1hARINLqXSLSOcs9 ojc9kOSxQheYIcU23cev9kiVn0TckTAYOh/8SVnhPR8rFb0FhmCDsHhA7CSX+KRKsXzA oyw/XVp9zBTwNPZgLXDnnZj7voX2TeAUrCjj9a2iLBzlSE2ph8l4mVTROTyQgg9b70NH AckWn9ue3e1LEJHtmPhGN+kqzAYLfvjZTltQerTG9u2dCX52QudGGwBMr8iotpxpjxf8 cqw3HEYw1UHGfJTO0TrFNRMfwnvO6Hbrzfo+UL5/MhLTLaOB+IVCXAowbu0gglKIFQqf lyeg== X-Gm-Message-State: AKwxyteTbQNSW2R2GMGA3fJ6ajtyumAphtwfofreY/G/BuS9nofjZ1pM 64IxCidVX8aFwB/7xACLxd2GaEJsWXvyExBWrkPbrg== X-Google-Smtp-Source: ACJfBovSN5WTvV+TkdaaydXOA/T6OVABP4/3XPKmgUQZe+kXJqfUBAOsG9XH71xnzzw5o/M/hIVy3OuVpzR74EeL9mg= X-Received: by 10.36.74.200 with SMTP id k191mr5591757itb.69.1515768853896; Fri, 12 Jan 2018 06:54:13 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.199.131 with HTTP; Fri, 12 Jan 2018 06:54:13 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: References: <201801121401.w0CE1cW4058239@repo.freebsd.org> From: Warner Losh Date: Fri, 12 Jan 2018 07:54:13 -0700 X-Google-Sender-Auth: g-YYfWiOWKOJyn_T8lpRWwR4YUQ Message-ID: Subject: Re: svn commit: r327876 - in head/sys/arm64: arm64 include To: Andrew Turner Cc: Marcin Wojtas , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jan 2018 14:54:15 -0000 On Fri, Jan 12, 2018 at 7:52 AM, Andrew Turner wrote: > > > On 12 Jan 2018, at 14:37, Warner Losh wrote: > > > > On Fri, Jan 12, 2018 at 7:15 AM, Andrew Turner wrote: > >> >> >> On 12 Jan 2018, at 14:10, Marcin Wojtas wrote: >> >> Hi Andrew, >> >> >> >> 2018-01-12 15:01 GMT+01:00 Andrew Turner : >> >> Author: andrew >> Date: Fri Jan 12 14:01:38 2018 >> New Revision: 327876 >> URL: https://svnweb.freebsd.org/changeset/base/327876 >> >> Log: >> Workaround Spectre Variant 2 on arm64. >> >> We need to handle two cases: >> >> 1. One process attacking another process. >> 2. A process attacking the kernel. >> >> For the first case we clear the branch predictor state on context switch >> between different processes. For the second we do this when taking an >> instruction abort on a non-userspace address. >> >> To clear the branch predictor state a per-CPU function pointer has been >> added. This is set by the new cpu errata code based on if the CPU is >> known to be affected. >> >> On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as newer >> versions of this will clear the branch predictor state for us. >> >> It has been reported the ThunderX is unaffected, however the ThunderX2 is >> vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD doesn't >> yet run on the ThunderX2 or Falkor no workaround is included for these >> CPUs. >> >> >> Regardless ThunderX2 / Falkor work-arounds, do I understand correctly >> that pure CA72 machines, such as Marvell Armada 7k/8k are immune to >> Variant 2 now? >> >> >> It is my understanding that the A72 will be immune with this patch and an >> updated Arm Trusted Firmware as documented in [1]. >> >> Andrew >> >> [1] https://github.com/ARM-software/arm-trusted-firmware/wik >> i/ARM-Trusted-Firmware-Security-Advisory-TFV-6 >> > > Are you also working on aarch32 mitigation? > > > No. I think a similar technique could be used, however as aarch32 has > instructions to invalidate the branch predictor these can be used directly. > That's my reading as well. It looks fairly easy to do it always, but I've not researched it sufficiently. Warner