• Alex Bennée's avatar
    KVM: arm64: guest debug, add support for single-step · 337b99bf
    Alex Bennée authored
    This adds support for single-stepping the guest. To do this we need to
    manipulate the guests PSTATE.SS and MDSCR_EL1.SS bits to trigger
    stepping. We take care to preserve MDSCR_EL1 and trap access to it to
    ensure we don't affect the apparent state of the guest.
    
    As we have to enable trapping of all software debug exceptions we
    suppress the ability of the guest to single-step itself. If we didn't we
    would have to deal with the exception arriving while the guest was in
    kernelspace when the guest is expecting to single-step userspace. This
    is something we don't want to unwind in the kernel. Once the host is no
    longer debugging the guest its ability to single-step userspace is
    restored.
    Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
    Reviewed-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    337b99bf
kvm_host.h 6.5 KB