• Christoffer Dall's avatar
    KVM: arm64: Introduce framework for accessing deferred sysregs · d47533da
    Christoffer Dall authored
    We are about to defer saving and restoring some groups of system
    registers to vcpu_put and vcpu_load on supported systems.  This means
    that we need some infrastructure to access system registes which
    supports either accessing the memory backing of the register or directly
    accessing the system registers, depending on the state of the system
    when we access the register.
    
    We do this by defining read/write accessor functions, which can handle
    both "immediate" and "deferrable" system registers.  Immediate registers
    are always saved/restored in the world-switch path, but deferrable
    registers are only saved/restored in vcpu_put/vcpu_load when supported
    and sysregs_loaded_on_cpu will be set in that case.
    
    Note that we don't use the deferred mechanism yet in this patch, but only
    introduce infrastructure.  This is to improve convenience of review in
    the subsequent patches where it is clear which registers become
    deferred.
    Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
    Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    d47533da
sys_regs.c 66 KB