From: Tianyu Lan <ltykernel@gmail.com>
To: hch@infradead.org, m.szyprowski@samsung.com,
robin.murphy@arm.com, michael.h.kelley@microsoft.com,
kys@microsoft.com
Cc: parri.andrea@gmail.com, thomas.lendacky@amd.com,
wei.liu@kernel.org, Tianyu Lan <Tianyu.Lan@microsoft.com>,
kernel test robot <lkp@intel.com>,
konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, brijesh.singh@amd.com,
vkuznets@redhat.com, hch@lst.de
Subject: [PATCH] Swiotlb: Add CONFIG_HAS_IOMEM check around memremap() in the swiotlb_mem_remap()
Date: Fri, 31 Dec 2021 11:56:40 -0500 [thread overview]
Message-ID: <20211231165640.1245751-1-ltykernel@gmail.com> (raw)
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
next reply other threads:[~2021-12-31 16:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-31 16:56 Tianyu Lan [this message]
2022-01-02 16:23 ` [PATCH] Swiotlb: Add CONFIG_HAS_IOMEM check around memremap() in the swiotlb_mem_remap() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211231165640.1245751-1-ltykernel@gmail.com \
--to=ltykernel@gmail.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=brijesh.singh@amd.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=konrad.wilk@oracle.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=m.szyprowski@samsung.com \
--cc=michael.h.kelley@microsoft.com \
--cc=parri.andrea@gmail.com \
--cc=robin.murphy@arm.com \
--cc=thomas.lendacky@amd.com \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox