]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
KVM: PPC: Book3S HV: Do SLB load/unload with guest LPCR value loaded
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 11 Jan 2018 03:51:02 +0000 (14:51 +1100)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 27 Mar 2018 20:54:37 +0000 (15:54 -0500)
commit8445b62ef87d857b71e6d40670ba641ea73e4706
tree34f6986f1cffa214480a5e8c4fda426d81428dc3
parent37321174b776c96346b72a8498533d9df0e85a68
KVM: PPC: Book3S HV: Do SLB load/unload with guest LPCR value loaded

BugLink: http://bugs.launchpad.net/bugs/1759045
This moves the code that loads and unloads the guest SLB values so that
it is done while the guest LPCR value is loaded in the LPCR register.
The reason for doing this is that on POWER9, the behaviour of the
slbmte instruction depends on the LPCR[UPRT] bit.  If UPRT is 1, as
it is for a radix host (or guest), the SLB index is truncated to
2 bits.  This means that for a HPT guest on a radix host, the SLB
was not being loaded correctly, causing the guest to crash.

The SLB is now loaded much later in the guest entry path, after the
LPCR is loaded, which for a secondary thread is after it sees that
the primary thread has switched the MMU to the guest.  The loop that
waits for the primary thread has a branch out to the exit code that
is taken if it sees that other threads have commenced exiting the
guest.  Since we have now not loaded the SLB at this point, we make
this path branch to a new label 'guest_bypass' and we move the SLB
unload code to before this label.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
(cherry picked from commit 6964e6a4e4894c707e42d51d9d30683c57f43201)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/kvm/book3s_hv_rmhandlers.S