Commit 2deb55d9 authored by Wei Liu's avatar Wei Liu

swiotlb: Add CONFIG_HAS_IOMEM check around swiotlb_mem_remap()

HAS_IOMEM option may not be selected on some platforms (e.g, s390) and
this will cause compilation failure due to missing memremap()
implementation.

Fix it by stubbing out swiotlb_mem_remap when CONFIG_HAS_IOMEM is not
set.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarTianyu Lan <Tianyu.Lan@microsoft.com>
Acked-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
parent e1878402
...@@ -163,6 +163,7 @@ static inline unsigned long nr_slots(u64 val) ...@@ -163,6 +163,7 @@ static inline unsigned long nr_slots(u64 val)
* when swiotlb_unencrypted_base is set. (e.g. for Hyper-V AMD SEV-SNP * when swiotlb_unencrypted_base is set. (e.g. for Hyper-V AMD SEV-SNP
* Isolation VMs). * Isolation VMs).
*/ */
#ifdef CONFIG_HAS_IOMEM
static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
{ {
void *vaddr = NULL; void *vaddr = NULL;
...@@ -178,6 +179,12 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) ...@@ -178,6 +179,12 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
return vaddr; return vaddr;
} }
#else
static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
{
return NULL;
}
#endif
/* /*
* Early SWIOTLB allocation may be too early to allow an architecture to * Early SWIOTLB allocation may be too early to allow an architecture to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment