Thread (46 messages) 46 messages, 3 authors, 2015-06-11

[PATCH kernel] powerpc/powernv: Fix crash when CONFIG_IOMMU_API is off

From: Alexey Kardashevskiy <hidden>
Date: 2015-06-10 03:10:04
Also in: linuxppc-dev
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

The code introduced in
"[PATCH kernel v12 17/34]
powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group"
checks that an IOMMU group was registered for the specific
table group which is not true when CONFIG_IOMMU_API is off as
iommu_register_group() is a stub in this case.

This makes BUG_ON conditional.

Signed-off-by: Alexey Kardashevskiy <redacted>
---
 arch/powerpc/platforms/powernv/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 4b4c583..a57554a 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -624,8 +624,9 @@ long pnv_pci_link_table_and_group(int node, int num,
 
 	BUG_ON(!tbl);
 	BUG_ON(!table_group);
+#ifdef CONFIG_IOMMU_API
 	BUG_ON(!table_group->group);
-
+#endif
 	tgl = kzalloc_node(sizeof(struct iommu_table_group_link), GFP_KERNEL,
 			node);
 	if (!tgl)
-- 
2.4.0.rc3.8.gfb3e7d5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help