]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: PPC: Book3S HV: Sanitize special-purpose register values on guest exit
authorPaul Mackerras <paulus@samba.org>
Sat, 5 Mar 2016 08:34:39 +0000 (19:34 +1100)
committerLuis Henriques <luis.henriques@canonical.com>
Thu, 24 Mar 2016 10:01:11 +0000 (10:01 +0000)
commitea51a643e950c2b51f9afcd6b72c586bcf8ccdf0
tree24bf94ccba057e9ffa860e3a80f13714a5d36599
parent9fffcd9565c16cf1e4277f81cfd11300e881c3b8
KVM: PPC: Book3S HV: Sanitize special-purpose register values on guest exit

commit ccec44563b18a0ce90e2d4f332784b3cb25c8e9c upstream.

Thomas Huth discovered that a guest could cause a hard hang of a
host CPU by setting the Instruction Authority Mask Register (IAMR)
to a suitable value.  It turns out that this is because when the
code was added to context-switch the new special-purpose registers
(SPRs) that were added in POWER8, we forgot to add code to ensure
that they were restored to a sane value on guest exit.

This adds code to set those registers where a bad value could
compromise the execution of the host kernel to a suitable neutral
value on guest exit.

Fixes: b005255e12a3
Reported-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
arch/powerpc/kvm/book3s_hv_rmhandlers.S