Skip to contentSkip to conversation

KVM: Drop CONFIG_DMAR dependency around kvm_iommu_map_pages

PATCH Applied Jan Kiszka 3 participants 5 messages Oct 18, 2010 – Oct 19, 2010 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 KVM: Drop CONFIG_DMAR dependency around kvm_iommu_map_pages

We also have to call kvm_iommu_map_pages for CONFIG_AMD_IOMMU. So drop the dependency on Intel IOMMU, kvm_iommu_map_pages will be a nop anyway if CONFIG_IOMMU_API is not defined.

---
 virt/kvm/kvm_main.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
virt/kvm/kvm_main.c +0 -2
index 1aeeb7f..ac326de 100644
@@ -705,14 +705,12 @@ skip_lpage:
 	if (r)
 		goto out_free;
 
-#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
 
 	r = -ENOMEM;
 	slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jan Kiszka

We also have to call kvm_iommu_map_pages for CONFIG_AMD_IOMMU. So drop the dependency on Intel IOMMU, kvm_iommu_map_pages will be a nop anyway if CONFIG_IOMMU_API is not defined.

Is this also a -stable candidate?

Quoted 26 lines
---
 virt/kvm/kvm_main.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
virt/kvm/kvm_main.c +0 -2
index 1aeeb7f..ac326de 100644
@@ -705,14 +705,12 @@ skip_lpage:
 	if (r)
 		goto out_free;
 
-#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
 
 	r = -ENOMEM;
 	slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
Signature · 1 line
1.7.1
Signature · 5 lines
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
author
#2 lore raw
Quoted 10 lines · Joerg
Quoted 5 lines · Jan Kiszka

We also have to call kvm_iommu_map_pages for CONFIG_AMD_IOMMU. So drop the dependency on Intel IOMMU, kvm_iommu_map_pages will be a nop anyway if CONFIG_IOMMU_API is not defined.

Is this also a -stable candidate?

I can't seriously judge as I was not able to test its effect on real hardware.

The patch seems to apply (with mechanical adjustments) down to 2.6.32. If it is considered for stable, it will also take [1] to avoid build breakage without CONFIG_IOMMU_API.

Jan

[1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/60954

Quoted 28 lines
Quoted 27 lines
---
 virt/kvm/kvm_main.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
virt/kvm/kvm_main.c +0 -2
index 1aeeb7f..ac326de 100644
@@ -705,14 +705,12 @@ skip_lpage:
 	if (r)
 		goto out_free;
 
-#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
 
 	r = -ENOMEM;
 	slots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
Signature · 1 line
1.7.1
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 15 lines · Jan Kiszka
Quoted 10 lines · Joerg
Quoted 5 lines · Jan Kiszka

We also have to call kvm_iommu_map_pages for CONFIG_AMD_IOMMU. So drop the dependency on Intel IOMMU, kvm_iommu_map_pages will be a nop anyway if CONFIG_IOMMU_API is not defined.

Is this also a -stable candidate?

I can't seriously judge as I was not able to test its effect on real hardware.

Quoted 7 lines

The patch seems to apply (with mechanical adjustments) down to 2.6.32. If it is considered for stable, it will also take [1] to avoid build breakage without CONFIG_IOMMU_API.

Jan

[1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/60954

Looks trivial enough. I would consider both patches as -stable material.

Joerg

Signature · 5 lines
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
#4 lore raw
Quoted 20 lines · Joerg
Quoted 19 lines · Jan Kiszka
Quoted 10 lines · Joerg
Quoted 5 lines · Jan Kiszka

We also have to call kvm_iommu_map_pages for CONFIG_AMD_IOMMU. So drop the dependency on Intel IOMMU, kvm_iommu_map_pages will be a nop anyway if CONFIG_IOMMU_API is not defined.

Is this also a -stable candidate?

I can't seriously judge as I was not able to test its effect on real hardware.

The patch seems to apply (with mechanical adjustments) down to 2.6.32. If it is considered for stable, it will also take [1] to avoid build breakage without CONFIG_IOMMU_API.

Quoted 7 lines
Quoted 3 lines

Jan

[1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/60954

Looks trivial enough. I would consider both patches as -stable material.

Joerg

Applied both with stable tag, thanks Jan.