ia64: rework iommu probing
ia64 currently organizes the iommu probing along machves, which isn't very helpful. Instead just try to probe for Intel IOMMUs in mem_init as they are properly described in ACPI and if none was found initialize the swiotlb buffer. The HP SBA handling is then only done delayed when the actual hardware is probed. Only in the case that we actually found usable IOMMUs we then set up the DMA ops and free the not needed swiotlb buffer. This scheme gets rid of the need for the dma_init machvec operation, and the dig_vtd machvec. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lkml.kernel.org/r/20190813072514.23299-24-hch@lst.de Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:

committed by
Tony Luck

parent
16567ca85f
commit
974f83ec1e
@@ -43,8 +43,6 @@ static inline const char *acpi_get_sysname (void)
|
||||
return "uv";
|
||||
# elif defined (CONFIG_IA64_DIG)
|
||||
return "dig";
|
||||
# elif defined(CONFIG_IA64_DIG_VTD)
|
||||
return "dig_vtd";
|
||||
# else
|
||||
# error Unknown platform. Fix acpi.c.
|
||||
# endif
|
||||
|
@@ -16,14 +16,11 @@
|
||||
struct device;
|
||||
|
||||
typedef void ia64_mv_setup_t (char **);
|
||||
typedef void ia64_mv_dma_init (void);
|
||||
|
||||
extern void machvec_setup (char **);
|
||||
|
||||
# if defined (CONFIG_IA64_DIG)
|
||||
# include <asm/machvec_dig.h>
|
||||
# elif defined(CONFIG_IA64_DIG_VTD)
|
||||
# include <asm/machvec_dig_vtd.h>
|
||||
# elif defined (CONFIG_IA64_HP_ZX1)
|
||||
# include <asm/machvec_hpzx1.h>
|
||||
# elif defined (CONFIG_IA64_SGI_UV)
|
||||
@@ -35,7 +32,6 @@ extern void machvec_setup (char **);
|
||||
# else
|
||||
# define ia64_platform_name ia64_mv.name
|
||||
# define platform_setup ia64_mv.setup
|
||||
# define platform_dma_init ia64_mv.dma_init
|
||||
# endif
|
||||
|
||||
/* __attribute__((__aligned__(16))) is required to make size of the
|
||||
@@ -46,14 +42,12 @@ extern void machvec_setup (char **);
|
||||
struct ia64_machine_vector {
|
||||
const char *name;
|
||||
ia64_mv_setup_t *setup;
|
||||
ia64_mv_dma_init *dma_init;
|
||||
} __attribute__((__aligned__(16))); /* align attrib? see above comment */
|
||||
|
||||
#define MACHVEC_INIT(name) \
|
||||
{ \
|
||||
#name, \
|
||||
platform_setup, \
|
||||
platform_dma_init, \
|
||||
}
|
||||
|
||||
extern struct ia64_machine_vector ia64_mv;
|
||||
@@ -64,8 +58,6 @@ extern void machvec_init_from_cmdline(const char *cmdline);
|
||||
# error Unknown configuration. Update arch/ia64/include/asm/machvec.h.
|
||||
# endif /* CONFIG_IA64_GENERIC */
|
||||
|
||||
extern void swiotlb_dma_init(void);
|
||||
|
||||
/*
|
||||
* Define default versions so we can extend machvec for new platforms without having
|
||||
* to update the machvec files for all existing platforms.
|
||||
@@ -73,8 +65,5 @@ extern void swiotlb_dma_init(void);
|
||||
#ifndef platform_setup
|
||||
# define platform_setup machvec_setup
|
||||
#endif
|
||||
#ifndef platform_dma_init
|
||||
# define platform_dma_init swiotlb_dma_init
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_H */
|
||||
|
@@ -1,19 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _ASM_IA64_MACHVEC_DIG_VTD_h
|
||||
#define _ASM_IA64_MACHVEC_DIG_VTD_h
|
||||
|
||||
extern ia64_mv_setup_t dig_setup;
|
||||
extern ia64_mv_dma_init pci_iommu_alloc;
|
||||
|
||||
/*
|
||||
* This stuff has dual use!
|
||||
*
|
||||
* For a generic kernel, the macros are used to initialize the
|
||||
* platform's machvec structure. When compiling a non-generic kernel,
|
||||
* the macros are used directly.
|
||||
*/
|
||||
#define ia64_platform_name "dig_vtd"
|
||||
#define platform_setup dig_setup
|
||||
#define platform_dma_init pci_iommu_alloc
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_DIG_VTD_h */
|
@@ -3,7 +3,6 @@
|
||||
#define _ASM_IA64_MACHVEC_HPZX1_h
|
||||
|
||||
extern ia64_mv_setup_t dig_setup;
|
||||
extern ia64_mv_dma_init sba_dma_init;
|
||||
|
||||
/*
|
||||
* This stuff has dual use!
|
||||
@@ -14,6 +13,5 @@ extern ia64_mv_dma_init sba_dma_init;
|
||||
*/
|
||||
#define ia64_platform_name "hpzx1"
|
||||
#define platform_setup dig_setup
|
||||
#define platform_dma_init sba_dma_init
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_HPZX1_h */
|
||||
|
@@ -69,7 +69,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
||||
return channel ? isa_irq_to_vector(15) : isa_irq_to_vector(14);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INTEL_IOMMU
|
||||
extern void pci_iommu_alloc(void);
|
||||
#endif
|
||||
#endif /* _ASM_IA64_PCI_H */
|
||||
|
Reference in New Issue
Block a user