• Christoffer Dall's avatar
    KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded · e761a927
    Christoffer Dall authored
    We have two ways to reset a vcpu:
    - either through VCPU_INIT
    - or through a PSCI_ON call
    
    The first one is easy to reason about. The second one is implemented
    in a more bizarre way, as it is the vcpu that handles PSCI_ON that
    resets the vcpu that is being powered-on. As we need to turn the logic
    around and have the target vcpu to reset itself, we must take some
    preliminary steps.
    
    Resetting the VCPU state modifies the system register state in memory,
    but this may interact with vcpu_load/vcpu_put if running with preemption
    disabled, which in turn may lead to corrupted system register state.
    
    Address this by disabling preemption and doing put/load if required
    around the reset logic.
    Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
    Signed-off-by: default avatarChristoffer Dall <christoffer.dall@arm.com>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    e761a927
reset.c 7.04 KB