Merge tag 'kvm-ppc-next-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD
PPC KVM update for 5.2 * Support for guests to access the new POWER9 XIVE interrupt controller hardware directly, reducing interrupt latency and overhead for guests. * In-kernel implementation of the H_PAGE_INIT hypercall. * Reduce memory usage of sparsely-populated IOMMU tables. * Several bug fixes. Second PPC KVM update for 5.2 * Fix a bug, fix a spelling mistake, remove some useless code.
此提交包含在:
@@ -570,6 +570,16 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
|
||||
case KVM_CAP_PPC_GET_CPU_CHAR:
|
||||
r = 1;
|
||||
break;
|
||||
#ifdef CONFIG_KVM_XIVE
|
||||
case KVM_CAP_PPC_IRQ_XIVE:
|
||||
/*
|
||||
* We need XIVE to be enabled on the platform (implies
|
||||
* a POWER9 processor) and the PowerNV platform, as
|
||||
* nested is not yet supported.
|
||||
*/
|
||||
r = xive_enabled() && !!cpu_has_feature(CPU_FTR_HVMODE);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case KVM_CAP_PPC_ALLOC_HTAB:
|
||||
r = hv_enabled;
|
||||
@@ -750,6 +760,9 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
|
||||
else
|
||||
kvmppc_xics_free_icp(vcpu);
|
||||
break;
|
||||
case KVMPPC_IRQ_XIVE:
|
||||
kvmppc_xive_native_cleanup_vcpu(vcpu);
|
||||
break;
|
||||
}
|
||||
|
||||
kvmppc_core_vcpu_free(vcpu);
|
||||
@@ -1938,6 +1951,30 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
|
||||
break;
|
||||
}
|
||||
#endif /* CONFIG_KVM_XICS */
|
||||
#ifdef CONFIG_KVM_XIVE
|
||||
case KVM_CAP_PPC_IRQ_XIVE: {
|
||||
struct fd f;
|
||||
struct kvm_device *dev;
|
||||
|
||||
r = -EBADF;
|
||||
f = fdget(cap->args[0]);
|
||||
if (!f.file)
|
||||
break;
|
||||
|
||||
r = -ENXIO;
|
||||
if (!xive_enabled())
|
||||
break;
|
||||
|
||||
r = -EPERM;
|
||||
dev = kvm_device_from_filp(f.file);
|
||||
if (dev)
|
||||
r = kvmppc_xive_native_connect_vcpu(dev, vcpu,
|
||||
cap->args[1]);
|
||||
|
||||
fdput(f);
|
||||
break;
|
||||
}
|
||||
#endif /* CONFIG_KVM_XIVE */
|
||||
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
|
||||
case KVM_CAP_PPC_FWNMI:
|
||||
r = -EINVAL;
|
||||
|
新增問題並參考
封鎖使用者