Skip to content

Commit b439281

Browse files
Amit Machhiwalmaddy-kerneldev
authored andcommitted
KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests
Currently on book3s-hv, the capability KVM_CAP_SPAPR_TCE_VFIO is only available for KVM Guests running on PowerNV and not for the KVM guests running on pSeries hypervisors. This prevents a pSeries L2 guest from leveraging the in-kernel acceleration for H_PUT_TCE_INDIRECT and H_STUFF_TCE hcalls that results in slow startup times for large memory guests. Support for VFIO on pSeries was restored in commit f431a8c ("powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries"), making it possible to re-enable this capability on pSeries hosts. This change enables KVM_CAP_SPAPR_TCE_VFIO for nested PAPR guests on pSeries, while maintaining the existing behavior on PowerNV. Booting an L2 guest with 128GB of memory shows an average 11% improvement in startup time. Fixes: f431a8c ("powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries") Cc: stable@vger.kernel.org Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Amit Machhiwal <amachhiw@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250220070002.1478849-1-amachhiw@linux.ibm.com
1 parent 7e67ef8 commit b439281

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/powerpc/kvm/powerpc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
550550

551551
#ifdef CONFIG_PPC_BOOK3S_64
552552
case KVM_CAP_SPAPR_TCE:
553+
fallthrough;
553554
case KVM_CAP_SPAPR_TCE_64:
554-
r = 1;
555-
break;
556555
case KVM_CAP_SPAPR_TCE_VFIO:
557-
r = !!cpu_has_feature(CPU_FTR_HVMODE);
558-
break;
559556
case KVM_CAP_PPC_RTAS:
560557
case KVM_CAP_PPC_FIXUP_HCALL:
561558
case KVM_CAP_PPC_ENABLE_HCALL:

0 commit comments

Comments
 (0)