• James Hogan's avatar
    KVM: MIPS: Add VZ & TE capabilities · a8a3c426
    James Hogan authored
    Add new KVM_CAP_MIPS_VZ and KVM_CAP_MIPS_TE capabilities, and in order
    to allow MIPS KVM to support VZ without confusing old users (which
    expect the trap & emulate implementation), define and start checking
    KVM_CREATE_VM type codes.
    
    The codes available are:
    
     - KVM_VM_MIPS_TE = 0
    
       This is the current value expected from the user, and will create a
       VM using trap & emulate in user mode, confined to the user mode
       address space. This may in future become unavailable if the kernel is
       only configured to support VZ, in which case the EINVAL error will be
       returned and KVM_CAP_MIPS_TE won't be available even though
       KVM_CAP_MIPS_VZ is.
    
     - KVM_VM_MIPS_VZ = 1
    
       This can be provided when the KVM_CAP_MIPS_VZ capability is available
       to create a VM using VZ, with a fully virtualized guest virtual
       address space. If VZ support is unavailable in the kernel, the EINVAL
       error will be returned (although old kernels without the
       KVM_CAP_MIPS_VZ capability may well succeed and create a trap &
       emulate VM).
    
    This is designed to allow the desired implementation (T&E vs VZ) to be
    potentially chosen at runtime rather than being fixed in the kernel
    configuration.
    Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: "Radim Krčmář" <rkrcmar@redhat.com>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: linux-mips@linux-mips.org
    Cc: kvm@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    a8a3c426
mips.c 41 KB