• Paul Mackerras's avatar
    KVM: PPC: Book3S HV: Save/restore host values of debug registers · fcd35f5a
    Paul Mackerras authored
    commit 7ceaa6dc 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: b005255e ("KVM: PPC: Book3S HV: Context-switch new POWER8 SPRs", 2014-01-08)
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    fcd35f5a
book3s_hv_rmhandlers.S 65.6 KB