Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH] Swiotlb: Add CONFIG_HAS_IOMEM check around memremap() in the swiotlb_mem_remap()
@ 2021-12-31 16:56 Tianyu Lan
  2022-01-02 16:23 ` Wei Liu
  2022-01-03  7:54 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Tianyu Lan @ 2021-12-31 16:56 UTC (permalink / raw)
  To: hch, m.szyprowski, robin.murphy, michael.h.kelley, kys
  Cc: parri.andrea, thomas.lendacky, wei.liu, Tianyu Lan,
	kernel test robot, konrad.wilk, linux-kernel, iommu,
	brijesh.singh, vkuznets, hch

From: Tianyu Lan <Tianyu.Lan@microsoft.com>

HAS_IOMEM option may not be selected on some platforms(e.g, s390) and this
will cause compile error due to miss memremap() implementation. Fix it via
adding HAS_IOMEM check around memremap() in the swiotlb.c.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
---
 kernel/dma/swiotlb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index b36c1cdd0c4f..3de651ba38cc 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -167,6 +167,7 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
 {
 	void *vaddr = NULL;
 
+#ifdef CONFIG_HAS_IOMEM
 	if (swiotlb_unencrypted_base) {
 		phys_addr_t paddr = mem->start + swiotlb_unencrypted_base;
 
@@ -175,6 +176,7 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
 			pr_err("Failed to map the unencrypted memory %pa size %lx.\n",
 			       &paddr, bytes);
 	}
+#endif
 
 	return vaddr;
 }
-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-04 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-31 16:56 [PATCH] Swiotlb: Add CONFIG_HAS_IOMEM check around memremap() in the swiotlb_mem_remap() Tianyu Lan
2022-01-02 16:23 ` Wei Liu
2022-01-03  7:54 ` Christoph Hellwig
2022-01-04 14:51   ` Wei Liu
2022-01-04 15:03     ` Christoph Hellwig
2022-01-04 16:10       ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox