Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2449840yba; Mon, 15 Apr 2019 11:53:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrBEJpWUGVmSmGl8FyQAAxsHjhqoOmdHpU55WM78UhJLKhiDCW8dDdLLw2HnVJ2xkYOJ8L X-Received: by 2002:aa7:8e04:: with SMTP id c4mr41824456pfr.48.1555354418012; Mon, 15 Apr 2019 11:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354418; cv=none; d=google.com; s=arc-20160816; b=0MQQvApbuQwbeLqBUs7q/gjBQwokji++7FdJTGrizF6YYzwMyTGZomjf+fxDS3N2vd vRN6zX08I09oKraXZQDzMMOMaC1oQKq/M4TyD0ww/0hp5VXNs75HYAc56NmdlU/F0TeL LAUbynAD8howAGqjJBRRETPt5wpviqZY2DBA4C2eJW1NDE4E8xarqcYin9Zd1J+uCW/h OMIlHcLQ/SgaRwGeT5ObcoJeMZoiaA8vDE54O2OuZ6SUAbKAQiYgioBftt8e3NN2/c6d EfC/9NXtWYpmDKWS4ihhJvi+acTIY+w7P5J5uBYl6eU36xB4LUd5mXt4sHThtnXVKpX6 P1fQ== 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=94qUmI7C4TCFE76CQb0hRcYe5dDypOo9PWIwqpbgCis=; b=lQAn5vk13cMpiPDZvmzJzjPtPDLIVYqbzLaiTJ1QkTzluazGE+/0AlR41tWjzaM/YE bdTHA2LICUG/CdR664bnZhiyo05yM7Wwzz6VJpGczLW7iRalNCkA6mxHIgQiz9Bs6FbZ 4vj3aONPkbetZEGHT98mFGTMtKNcZE10Sd7Vq0hKMVZaA0Zktr5Dqk+AOpIMnMcnC13Z P4cpJziJsX04r0GkpBNdp+Ukc3EkIDtAnJAaE7npVCgBLbqAkAIJwgS01lW6+Heb9Hr+ XxHUBYiBAfpRy7FmOvKPx1EXxZ8tixxAbORrHsbLSf2Pu4/nymxJ8P6KvN/BrhzNkthG en+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="y/OhqItL"; 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 5si31236045plc.425.2019.04.15.11.53.21; Mon, 15 Apr 2019 11:53:38 -0700 (PDT) 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="y/OhqItL"; 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 S1728658AbfDOSu6 (ORCPT + 99 others); Mon, 15 Apr 2019 14:50:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:48958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728220AbfDOSqO (ORCPT ); Mon, 15 Apr 2019 14:46:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 BF3E7218D3; Mon, 15 Apr 2019 18:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353974; bh=4GBuBPB77KQs7W0AjAGn6yo+ryMFRVsWoWXtaraMY7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y/OhqItL0Po61uvvfnOQONxqppNsEieWsNCXmCelFQjaJ1/KQXM1lcc0naVhbG4Lo WX0E0uaeNohbGOdRe7Oybu+wF2WbgNj+NUvaduHO9cB/BpEACbkc18QSewppJST/ur maW8eTR3Kf9yMtjB32kP1Kqd+ysQ8aFnreuQmt/c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Diana Craciun , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 39/76] powerpc/fsl: Flush branch predictor when entering KVM Date: Mon, 15 Apr 2019 20:44:03 +0200 Message-Id: <20190415183717.789327618@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 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 commit e7aa61f47b23afbec41031bc47ca8d6cb6516abc upstream. Switching from the guest to host is another place where the speculative accesses can be exploited. Flush the branch predictor when entering KVM. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kvm/bookehv_interrupts.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S index 81bd8a07aa51..612b7f6a887f 100644 --- a/arch/powerpc/kvm/bookehv_interrupts.S +++ b/arch/powerpc/kvm/bookehv_interrupts.S @@ -75,6 +75,10 @@ PPC_LL r1, VCPU_HOST_STACK(r4) PPC_LL r2, HOST_R2(r1) +START_BTB_FLUSH_SECTION + BTB_FLUSH(r10) +END_BTB_FLUSH_SECTION + mfspr r10, SPRN_PID lwz r8, VCPU_HOST_PID(r4) PPC_LL r11, VCPU_SHARED(r4) -- 2.19.1