Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2445428yba; Mon, 15 Apr 2019 11:47:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzW7Iv8uomoPRt2W4UW8reJj2LNQuiV/8o44mf3ziQOhR1ceahwX1p9wO8I1pyrslt0bx0A X-Received: by 2002:a17:902:7794:: with SMTP id o20mr75690266pll.189.1555354044514; Mon, 15 Apr 2019 11:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354044; cv=none; d=google.com; s=arc-20160816; b=VP2eNnH3Z7Q/EdRnrlzgVzZq5SyatBgdILJ10O+IaeusB8fsVP8d8HqzmD+7EnOuga BreOuRYGqIlSrc6gd6sFhpRjF+NaOClbEqYHxrYM4qz0v8aKmOlCHruSakbHcG2vJ3tE zeAaGXfstJQFAupL6on5o3KDFqXOUTh2D0obHnW2H3PUlyOWjcjy3wS9pIOOqqhZxweA Z5MY/rp1X/VOwSXxy4KCWg94jA3SfAjpG84StQ1fp8sdqSkvIz4kch/+MIakvLjtobUK MZM4a5elnoJEKHnaJerjNdH27eA9v0UNABSkRJn7UkC0TwK8myIq9j1x5Mjt4ofnuevn 2qKQ== 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=NcnkaqTf8EChj7vegksGwYHKP8bpzGvzQPZ7mdUt7FM=; b=pGluaL3fdozG6AyB2JDLW2AXxDV9+B0MaCX5eslyUcr+0/z10NlE6F5BkisH/+uZWy F+xddgkvmwXQ9AEX+WUgM8vYG6Q2eAnORbm22TAksGIsPUCSRkj9bjOnztfsGxSBe2YY 2FZsLA0ZelouxFnzQ43rbEzlbq+8D9C2gVk8ehU3jqrX+773pBAe/62KEFGIY49eT0xc c7YnuA3Wn/nBtUMrWfmkVQYLevy+pDoXo9IHXCech25DCvUfXZS51UE5pRnjFV1DGNYW azhCZMLVJTZGe6WQIKLqcyp/0JymB1Dj4PLYlhETTog2NYnsHqlVicilHeSngU+pRFIS 6r0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q0OueHx/"; 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 72si12344792plb.165.2019.04.15.11.47.08; Mon, 15 Apr 2019 11:47:24 -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="Q0OueHx/"; 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 S1728519AbfDOSqF (ORCPT + 99 others); Mon, 15 Apr 2019 14:46:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:48668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbfDOSqE (ORCPT ); Mon, 15 Apr 2019 14:46:04 -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 1A2AB2073F; Mon, 15 Apr 2019 18:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353963; bh=YG0VZ+yPFu5nd+JhkVja/Kkw7vW8e/8Nq5N8KNPsWTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q0OueHx/p9yMdXZ54poeSCFFUVOVy5VWknVngcABTd5AE7ucJMufg1MiBPBN/Gn7N 5mG67Ozx83RtK7/XXcR5cAqTWKi0yL7xr9StBxQGT6tgxw5INLwxBgNo6EfSjaL2SL hel09FBacGwfeXgbl7HhF+32+YaI3G6geaLwUsLw= 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 35/76] powerpc/fsl: Emulate SPRN_BUCSR register Date: Mon, 15 Apr 2019 20:43:59 +0200 Message-Id: <20190415183716.840557689@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 98518c4d8728656db349f875fcbbc7c126d4c973 upstream. In order to flush the branch predictor the guest kernel performs writes to the BUCSR register which is hypervisor privilleged. However, the branch predictor is flushed at each KVM entry, so the branch predictor has been already flushed, so just return as soon as possible to guest. Signed-off-by: Diana Craciun [mpe: Tweak comment formatting] Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kvm/e500_emulate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c index 990db69a1d0b..fa88f641ac03 100644 --- a/arch/powerpc/kvm/e500_emulate.c +++ b/arch/powerpc/kvm/e500_emulate.c @@ -277,6 +277,13 @@ int kvmppc_core_emulate_mtspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong spr_va vcpu->arch.pwrmgtcr0 = spr_val; break; + case SPRN_BUCSR: + /* + * If we are here, it means that we have already flushed the + * branch predictor, so just return to guest. + */ + break; + /* extra exceptions */ #ifdef CONFIG_SPE_POSSIBLE case SPRN_IVOR32: -- 2.19.1