]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Restore SPRG3 in kvmhv_p9_guest_entry()
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Thu, 30 May 2019 02:17:18 +0000 (12:17 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 30 May 2019 04:00:54 +0000 (14:00 +1000)
commit88848e9fa7a025e91691e10f686612684b29a100
treec863dd43c84579d853f3a2ae0ee6ead46c967703
parent78de35d2dea31f164afc95e11739800ef640084d
KVM: PPC: Book3S HV: Restore SPRG3 in kvmhv_p9_guest_entry()

The sprgs are a set of 4 general purpose sprs provided for software use.
SPRG3 is special in that it can also be read from userspace. Thus it is
used on linux to store the cpu and numa id of the process to speed up
syscall access to this information.

This register is overwritten with the guest value on kvm guest entry,
and so needs to be restored on exit again. Thus restore the value on
the guest exit path in kvmhv_p9_guest_entry().

Cc: stable@vger.kernel.org # v4.20+
Fixes: d826ada3e018e ("KVM: PPC: Book3S HV: Streamlined guest entry/exit path on P9 for radix guests")
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kvm/book3s_hv.c