• Suzuki K Poulose's avatar
    kvm: arm64: Configure VTCR_EL2.SL0 per VM · 7e813045
    Suzuki K Poulose authored
    VTCR_EL2 holds the following key stage2 translation table
    parameters:
      SL0  - Entry level in the page table lookup.
      T0SZ - Denotes the size of the memory addressed by the table.
    
    We have been using fixed values for the SL0 depending on the
    page size as we have a fixed IPA size. But since we are about
    to make it dynamic, we need to calculate the SL0 at runtime
    per VM. This patch adds a helper to compute the value of SL0
    for a VM based on the IPA size.
    
    Cc: Marc Zyngier <marc.zyngier@arm.com>
    Cc: Christoffer Dall <cdall@kernel.org>
    Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
    Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    7e813045
kvm_arm.h 11.4 KB