• Suzuki K Poulose's avatar
    kvm: arm64: Allow tuning the physical address size for VM · 233a7cb2
    Suzuki K Poulose authored
    Allow specifying the physical address size limit for a new
    VM via the kvm_type argument for the KVM_CREATE_VM ioctl. This
    allows us to finalise the stage2 page table as early as possible
    and hence perform the right checks on the memory slots
    without complication. The size is encoded as Log2(PA_Size) in
    bits[7:0] of the type field. For backward compatibility the
    value 0 is reserved and implies 40bits. Also, lift the limit
    of the IPA to host limit and allow lower IPA sizes (e.g, 32).
    
    The userspace could check the extension KVM_CAP_ARM_VM_IPA_SIZE
    for the availability of this feature. The cap check returns the
    maximum limit for the physical address shift supported by the host.
    
    Cc: Marc Zyngier <marc.zyngier@arm.com>
    Cc: Christoffer Dall <cdall@kernel.org>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    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>
    233a7cb2
stage2_pgtable.h 6.83 KB