KVM: Fix signature of kvm_iommu_map_pages stub
PATCH 1/1 KVM: Fix signature of kvm_iommu_map_pages stub
Breaks otherwise if CONFIG_IOMMU_API is not set.
--- include/linux/kvm_host.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
include/linux/kvm_host.h +1 -2
@@ -483,8 +483,7 @@ int kvm_deassign_device(struct kvm *kvm, struct kvm_assigned_dev_kernel *assigned_dev);#else /* CONFIG_IOMMU_API */ static inline int kvm_iommu_map_pages (struct kvm *kvm, -gfn_t base_gfn, -unsigned long npages) +struct kvm_memory_slot *slot) {return 0 ; }
Signature · 1 line
1.7.1
Quoted 1 line · Jan Kiszka
Breaks otherwise if
CONFIG_IOMMU_APIis not set.
Actually, it only broke a special local version. It doesn't break with current KVM due to
[__kvm_set_memory_region:]
#ifdef CONFIG_DMAR
/* map the pages in iommu page table */
if (npages) {
r = kvm_iommu_map_pages(kvm, &new);
if (r)
goto out_free;
}#endif
And CONFIG_IOMMU_API is set when CONFIG_DMAR is enabled. But do we only need this call on Intel?
Jan
Quoted 20 lines
Signed-off-by Jan Kiszka <[email protected]>--- include/linux/kvm_host.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)include/linux/kvm_host.h +1
-2@@ -483,8 +483,7 @@ int kvm_deassign_device(struct kvm *kvm, struct kvm_assigned_dev_kernel *assigned_dev);#else /* CONFIG_IOMMU_API */ static inline int kvm_iommu_map_pages (struct kvm *kvm, -gfn_t base_gfn, -unsigned long npages) +struct kvm_memory_slot *slot) {return 0 ; }
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 14 lines · Jan Kiszka
Quoted 1 line · Jan Kiszka
Breaks otherwise if
CONFIG_IOMMU_APIis not set.Actually, it only broke a special local version. It doesn't break with current KVM due to
[
__kvm_set_memory_region:]#ifdef CONFIG_DMAR /* map the pages in iommu page table */ if (npages) { r = kvm_iommu_map_pages(kvm, &new); if (r) goto out_free; }
Quoted 4 lines
#endif
And
CONFIG_IOMMU_APIis set whenCONFIG_DMARis enabled. But do we only need this call on Intel?
On CONFIG_AMD_IOMMU too. It should be conditional on CONFIG_IOMMU_API.
Quoted 17 lines · Marcelo Tosatti
Quoted 16 lines · Jan Kiszka
Quoted 1 line · Jan Kiszka
Breaks otherwise if
CONFIG_IOMMU_APIis not set.Actually, it only broke a special local version. It doesn't break with current KVM due to
[
__kvm_set_memory_region:]#ifdef CONFIG_DMAR /* map the pages in iommu page table */ if (npages) { r = kvm_iommu_map_pages(kvm, &new); if (r) goto out_free; }#endif
Quoted 5 lines
Quoted 2 lines
And
CONFIG_IOMMU_APIis set whenCONFIG_DMARis enabled. But do we only need this call on Intel?On
CONFIG_AMD_IOMMUtoo. It should be conditional onCONFIG_IOMMU_API.
Then we can simply drop the #ifdef here as kvm_iommu_map_pages is stubbed for !CONFIG_IOMMU_API.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux