Skip to content

Commit 794d5b8

Browse files
jbeulichjgross1
authored andcommitted
swiotlb-xen: this is PV-only on x86
The code is unreachable for HVM or PVH, and it also makes little sense in auto-translated environments. On Arm, with xen_{create,destroy}_contiguous_region() both being stubs, I have a hard time seeing what good the Xen specific variant does - the generic one ought to be fine for all purposes there. Still Arm code explicitly references symbols here, so the code will continue to be included there. Instead of making PCI_XEN's "select" conditional, simply drop it - SWIOTLB_XEN will be available unconditionally in the PV case anyway, and is - as explained above - dead code in non-PV environments. This in turn allows dropping the stubs for xen_{create,destroy}_contiguous_region(), the former of which was broken anyway - it failed to set the DMA handle output. Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Stefano Stabellini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent 8e1034a commit 794d5b8

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

arch/x86/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2605,7 +2605,6 @@ config PCI_OLPC
26052605
config PCI_XEN
26062606
def_bool y
26072607
depends on PCI && XEN
2608-
select SWIOTLB_XEN
26092608

26102609
config MMCONF_FAM10H
26112610
def_bool y

drivers/xen/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ config XEN_GRANT_DMA_ALLOC
177177

178178
config SWIOTLB_XEN
179179
def_bool y
180+
depends on XEN_PV || ARM || ARM64
180181
select DMA_OPS
181182
select SWIOTLB
182183

include/xen/xen-ops.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,7 @@ extern unsigned long *xen_contiguous_bitmap;
4646
int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
4747
unsigned int address_bits,
4848
dma_addr_t *dma_handle);
49-
5049
void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
51-
#else
52-
static inline int xen_create_contiguous_region(phys_addr_t pstart,
53-
unsigned int order,
54-
unsigned int address_bits,
55-
dma_addr_t *dma_handle)
56-
{
57-
return 0;
58-
}
59-
60-
static inline void xen_destroy_contiguous_region(phys_addr_t pstart,
61-
unsigned int order) { }
6250
#endif
6351

6452
#if defined(CONFIG_XEN_PV)

0 commit comments

Comments
 (0)