From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52107 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbdHCR5M (ORCPT ); Thu, 3 Aug 2017 13:57:12 -0400 Date: Thu, 3 Aug 2017 10:57:08 -0700 From: Greg KH To: Paul Mackerras Cc: stable@vger.kernel.org Subject: Re: [PATCH 3.18.x] KVM: PPC: Book3S HV: Restore critical SPRs to host values on guest exit Message-ID: <20170803175708.GG13298@kroah.com> References: <20170726053342.j7pyql3myonh7aoz@oak.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170726053342.j7pyql3myonh7aoz@oak.ozlabs.ibm.com> Sender: stable-owner@vger.kernel.org List-ID: On Wed, Jul 26, 2017 at 03:33:42PM +1000, Paul Mackerras wrote: > commit 4c3bb4ccd074e1a0552078c0bf94c662367a1658 upstream. > > This restores several special-purpose registers (SPRs) to sane values > on guest exit that were missed before. > > TAR and VRSAVE are readable and writable by userspace, and we need to > save and restore them to prevent the guest from potentially affecting > userspace execution (not that TAR or VRSAVE are used by any known > program that run uses the KVM_RUN ioctl). We save/restore these > in kvmppc_vcpu_run_hv() rather than on every guest entry/exit. > > FSCR affects userspace execution in that it can prohibit access to > certain facilities by userspace. We save/restore it like we do > for TAR and VRSAVE. > > PSPB is normally 0. We restore it to 0 on guest exit to prevent > userspace taking advantage of the guest having set it non-zero > (which would allow userspace to set its SMT priority to high). > > UAMOR is normally 0. We restore it to 0 on guest exit to prevent > the AMR from being used as a covert channel between userspace > processes, since the AMR is not context-switched at present. > > [paulus@ozlabs.org - removed IAMR bits that are only needed on POWER9; > adjusted FSCR save/restore for lack of fscr field in thread_struct.] > > Fixes: b005255e12a3 ("KVM: PPC: Book3S HV: Context-switch new POWER8 SPRs", 2014-01-08) > Cc: stable@vger.kernel.org # v3.14+ > Signed-off-by: Paul Mackerras > --- > arch/powerpc/kvm/book3s_hv.c | 13 +++++++++++-- > arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 ++ > 2 files changed, 13 insertions(+), 2 deletions(-) Now applied, thanks. greg k-h