Skip to content

Commit

Permalink
arm/xen: don't check for xen_initial_domain() in xen_create_contiguou…
Browse files Browse the repository at this point in the history
…s_region

It used to be that Linux enabled swiotlb-xen when running a dom0 on ARM.
Since f5079a9 "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@xilinx.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Stefano Stabellini authored and Christoph Hellwig committed Apr 18, 2022
1 parent 0d5ffd9 commit 9bbe7a7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/arm/xen/mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9bbe7a7

Please sign in to comment.