• Christoffer Dall's avatar
    KVM: arm64: Change 32-bit handling of VM system registers · 52f6c4f0
    Christoffer Dall authored
    We currently handle 32-bit accesses to trapped VM system registers using
    the 32-bit index into the coproc array on the vcpu structure, which is a
    union of the coproc array and the sysreg array.
    
    Since all the 32-bit coproc indices are created to correspond to the
    architectural mapping between 64-bit system registers and 32-bit
    coprocessor registers, and because the AArch64 system registers are the
    double in size of the AArch32 coprocessor registers, we can always find
    the system register entry that we must update by dividing the 32-bit
    coproc index by 2.
    
    This is going to make our lives much easier when we have to start
    accessing system registers that use deferred save/restore and might
    have to be read directly from the physical CPU.
    Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
    Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    52f6c4f0
kvm_host.h 14.3 KB