]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
KVM: PPC: Book3S HV: Reload HTM registers explicitly
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 31 Jul 2017 00:43:37 +0000 (10:43 +1000)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 22 Aug 2017 09:57:59 +0000 (06:57 -0300)
commit25e07202d5a7a3aa7a34e406ff93a617000cdc13
treefc9310b33f41457c8eb7bd76a676ac9fda72ae29
parent32752e59e15ac6aba46faf45acfe7925124ad3bc
KVM: PPC: Book3S HV: Reload HTM registers explicitly

BugLink: http://bugs.launchpad.net/bugs/1710646
Commit 46a704f8409f ("KVM: PPC: Book3S HV: Preserve userspace HTM
state properly", 2017-06-15) added code which assumes that the kernel
is able to handle a TM (transactional memory) unavailable interrupt
from userspace by reloading the TM-related registers and enabling TM
for the process.  That ability was added in the 4.9 kernel; earlier
kernel versions simply panic on getting the TM unavailable interrupt.

Since commit 46a704f8409f has been backported to the 4.4 stable tree
as commit 824b9506e4f2, 4.4.75 and subsequent versions are vulnerable
to a userspace-triggerable panic.

This patch fixes the problem by explicitly reloading the TM-related
registers before returning to userspace, rather than disabling TM
for the process.

Commit 46a704f8409f also failed to enable TM for the kernel, leading
to a TM unavailable interrupt in the kernel, causing an oops.  This
fixes that problem too, by enabling TM before accessing the TM
registers.  That problem is fixed upstream by the patch "KVM: PPC:
Book3S HV: Enable TM before accessing TM registers".

Fixes: 824b9506e4f2 ("KVM: PPC: Book3S HV: Preserve userspace HTM state properly")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
arch/powerpc/kvm/book3s_hv.c