]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
KVM: PPC: Book3S HV: Save/restore host values of debug registers
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 16 Jun 2017 01:53:19 +0000 (11:53 +1000)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 22 Aug 2017 09:57:59 +0000 (06:57 -0300)
commitaea0b34def1e4129de0605bea7e20978d1150b4e
tree382936631efda754e57fd1f356b04873196649b2
parent25e07202d5a7a3aa7a34e406ff93a617000cdc13
KVM: PPC: Book3S HV: Save/restore host values of debug registers

BugLink: http://bugs.launchpad.net/bugs/1710646
commit 7ceaa6dcd8c6f59588428cec37f3c8093dd1011f upstream.

At present, HV KVM on POWER8 and POWER9 machines loses any instruction
or data breakpoint set in the host whenever a guest is run.
Instruction breakpoints are currently only used by xmon, but ptrace
and the perf_event subsystem can set data breakpoints as well as xmon.

To fix this, we save the host values of the debug registers (CIABR,
DAWR and DAWRX) before entering the guest and restore them on exit.
To provide space to save them in the stack frame, we expand the stack
frame allocated by kvmppc_hv_entry() from 112 to 144 bytes.

[paulus@ozlabs.org - Adjusted stack offsets since we aren't saving
 POWER9-specific registers.]

Fixes: b005255e12a3 ("KVM: PPC: Book3S HV: Context-switch new POWER8 SPRs", 2014-01-08)
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_rmhandlers.S