@@ -40,6 +40,7 @@ menuconfig KVM
select SCHED_INFO
select GUEST_PERF_EVENTS if PERF_EVENTS
select XARRAY_MULTI
+ select HAVE_KVM_PINNED_VMID
help
Support hosting virtualized guest machines.
@@ -711,6 +711,20 @@ int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu)
return ret;
}
+int kvm_arch_pinned_vmid_get(struct kvm *kvm)
+{
+ int vmid;
+
+ vmid = kvm_arm_pinned_vmid_get(&kvm->arch.mmu.vmid);
+
+ return (vmid == 0) ? -EINVAL : vmid;
+}
+
+void kvm_arch_pinned_vmid_put(struct kvm *kvm)
+{
+ kvm_arm_pinned_vmid_put(&kvm->arch.mmu.vmid);
+}
+
bool kvm_arch_intc_initialized(struct kvm *kvm)
{
return vgic_initialized(kvm);
Provide interfaces to get/put pinned VMIDs from KVM VMID allocator. This will be used by SMMUv3 driver in subsequent patch. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> --- arch/arm64/kvm/Kconfig | 1 + arch/arm64/kvm/arm.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+)