Skip to contentSkip to conversation

KVM: Fix signature of kvm_iommu_map_pages stub

PATCH In review Jan Kiszka 2 participants 4 messages Oct 14, 2010 – Oct 18, 2010 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

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
index 0b89d00..866ed30 100644
@@ -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
author
#1 lore raw
Quoted 1 line · Jan Kiszka

Breaks otherwise if CONFIG_IOMMU_API is 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
---
 include/linux/kvm_host.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
include/linux/kvm_host.h +1 -2
index 0b89d00..866ed30 100644
@@ -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
#2 lore raw
Quoted 14 lines · Jan Kiszka
Quoted 1 line · Jan Kiszka

Breaks otherwise if CONFIG_IOMMU_API is 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_API is set when CONFIG_DMAR is enabled. But do we only need this call on Intel?

On CONFIG_AMD_IOMMU too. It should be conditional on CONFIG_IOMMU_API.

author
#3 lore raw
Quoted 17 lines · Marcelo Tosatti
Quoted 16 lines · Jan Kiszka
Quoted 1 line · Jan Kiszka

Breaks otherwise if CONFIG_IOMMU_API is 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_API is set when CONFIG_DMAR is enabled. But do we only need this call on Intel?

On CONFIG_AMD_IOMMU too. It should be conditional on CONFIG_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