[PATCH 05/15] arm/xen: don't check for xen_initial_domain() in xen_create_contiguous_region
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
- Subject: [PATCH 05/15] arm/xen: don't check for xen_initial_domain() in xen_create_contiguous_region
- From: Christoph Hellwig <hch@xxxxxx>
- Date: Mon, 4 Apr 2022 07:05:49 +0200
- Cc: x86@xxxxxxxxxx, Anshuman Khandual <anshuman.khandual@xxxxxxx>, Tom Lendacky <thomas.lendacky@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Joerg Roedel <joro@xxxxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, tboot-devel@xxxxxxxxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
- In-reply-to: <20220404050559.132378-1-hch@lst.de>
- References: <20220404050559.132378-1-hch@lst.de>
From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
It used to be that Linux enabled swiotlb-xen when running a dom0 on ARM.
Since f5079a9a2a31 "xen/arm: introduce XENFEAT_direct_mapped and
XENFEAT_not_direct_mapped", Linux detects whether to enable or disable
swiotlb-xen based on the new feature flags: XENFEAT_direct_mapped and
XENFEAT_not_direct_mapped.
However, there is still a leftover xen_initial_domain() check in
xen_create_contiguous_region. Remove the check as
xen_create_contiguous_region is only called by swiotlb-xen during
initialization. If xen_create_contiguous_region is called, we know Linux
is running 1:1 mapped so there is no need for additional checks.
Also update the in-code comment.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
arch/arm/xen/mm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index a7e54a087b802..28c2070602535 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -122,10 +122,7 @@ int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
unsigned int address_bits,
dma_addr_t *dma_handle)
{
- if (!xen_initial_domain())
- return -EINVAL;
-
- /* we assume that dom0 is mapped 1:1 for now */
+ /* the domain is 1:1 mapped to use swiotlb-xen */
*dma_handle = pstart;
return 0;
}
--
2.30.2
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]