Commit 46e80e6c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Ingo Molnar:
 "A handful of cleanups: dma-ops cleanups, missing boot time kcalloc()
  check, a Sparse fix and use struct_size() to simplify a vzalloc()
  call"

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/pci: Clean up usage of X86_DEV_DMA_OPS
  x86/Kconfig: Remove the unused X86_DMA_REMAP KConfig symbol
  x86/kexec/crash: Use struct_size() in vzalloc()
  x86/mm/tlb: Define LOADED_MM_SWITCHING with pointer-sized number
  x86/platform/uv: Fix missing checks of kcalloc() return values
parents 82ac4043 15854edd
...@@ -28,7 +28,6 @@ config X86_64 ...@@ -28,7 +28,6 @@ config X86_64
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select NEED_DMA_MAP_STATE select NEED_DMA_MAP_STATE
select SWIOTLB select SWIOTLB
select X86_DEV_DMA_OPS
select ARCH_HAS_SYSCALL_WRAPPER select ARCH_HAS_SYSCALL_WRAPPER
# #
...@@ -700,8 +699,6 @@ config STA2X11 ...@@ -700,8 +699,6 @@ config STA2X11
bool "STA2X11 Companion Chip Support" bool "STA2X11 Companion Chip Support"
depends on X86_32_NON_STANDARD && PCI depends on X86_32_NON_STANDARD && PCI
select ARCH_HAS_PHYS_TO_DMA select ARCH_HAS_PHYS_TO_DMA
select X86_DEV_DMA_OPS
select X86_DMA_REMAP
select SWIOTLB select SWIOTLB
select MFD_STA2X11 select MFD_STA2X11
select GPIOLIB select GPIOLIB
...@@ -2867,11 +2864,6 @@ config HAVE_ATOMIC_IOMAP ...@@ -2867,11 +2864,6 @@ config HAVE_ATOMIC_IOMAP
config X86_DEV_DMA_OPS config X86_DEV_DMA_OPS
bool bool
depends on X86_64 || STA2X11
config X86_DMA_REMAP
bool
depends on STA2X11
config HAVE_GENERIC_GUP config HAVE_GENERIC_GUP
def_bool y def_bool y
......
...@@ -167,7 +167,7 @@ struct tlb_state { ...@@ -167,7 +167,7 @@ struct tlb_state {
*/ */
struct mm_struct *loaded_mm; struct mm_struct *loaded_mm;
#define LOADED_MM_SWITCHING ((struct mm_struct *)1) #define LOADED_MM_SWITCHING ((struct mm_struct *)1UL)
/* Last user mm for optimizing IBPB */ /* Last user mm for optimizing IBPB */
union { union {
......
...@@ -204,8 +204,7 @@ static struct crash_mem *fill_up_crash_elf_data(void) ...@@ -204,8 +204,7 @@ static struct crash_mem *fill_up_crash_elf_data(void)
* another range split. So add extra two slots here. * another range split. So add extra two slots here.
*/ */
nr_ranges += 2; nr_ranges += 2;
cmem = vzalloc(sizeof(struct crash_mem) + cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
sizeof(struct crash_mem_range) * nr_ranges);
if (!cmem) if (!cmem)
return NULL; return NULL;
......
...@@ -2133,14 +2133,19 @@ static int __init summarize_uvhub_sockets(int nuvhubs, ...@@ -2133,14 +2133,19 @@ static int __init summarize_uvhub_sockets(int nuvhubs,
*/ */
static int __init init_per_cpu(int nuvhubs, int base_part_pnode) static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
{ {
unsigned char *uvhub_mask;
struct uvhub_desc *uvhub_descs; struct uvhub_desc *uvhub_descs;
unsigned char *uvhub_mask = NULL;
if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub()) if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub())
timeout_us = calculate_destination_timeout(); timeout_us = calculate_destination_timeout();
uvhub_descs = kcalloc(nuvhubs, sizeof(struct uvhub_desc), GFP_KERNEL); uvhub_descs = kcalloc(nuvhubs, sizeof(struct uvhub_desc), GFP_KERNEL);
if (!uvhub_descs)
goto fail;
uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL); uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL);
if (!uvhub_mask)
goto fail;
if (get_cpu_topology(base_part_pnode, uvhub_descs, uvhub_mask)) if (get_cpu_topology(base_part_pnode, uvhub_descs, uvhub_mask))
goto fail; goto fail;
......
...@@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver" ...@@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver"
config INTEL_MIC_BUS config INTEL_MIC_BUS
tristate "Intel MIC Bus Driver" tristate "Intel MIC Bus Driver"
depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS depends on 64BIT && PCI && X86
help help
This option is selected by any driver which registers a This option is selected by any driver which registers a
device or driver on the MIC Bus, such as CONFIG_INTEL_MIC_HOST, device or driver on the MIC Bus, such as CONFIG_INTEL_MIC_HOST,
...@@ -21,7 +21,7 @@ comment "SCIF Bus Driver" ...@@ -21,7 +21,7 @@ comment "SCIF Bus Driver"
config SCIF_BUS config SCIF_BUS
tristate "SCIF Bus Driver" tristate "SCIF Bus Driver"
depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS depends on 64BIT && PCI && X86
help help
This option is selected by any driver which registers a This option is selected by any driver which registers a
device or driver on the SCIF Bus, such as CONFIG_INTEL_MIC_HOST device or driver on the SCIF Bus, such as CONFIG_INTEL_MIC_HOST
......
...@@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759 ...@@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759
config VMD config VMD
depends on PCI_MSI && X86_64 && SRCU depends on PCI_MSI && X86_64 && SRCU
select X86_DEV_DMA_OPS
tristate "Intel Volume Management Device Driver" tristate "Intel Volume Management Device Driver"
---help--- ---help---
Adds support for the Intel Volume Management Device (VMD). VMD is a Adds support for the Intel Volume Management Device (VMD). VMD is a
......
...@@ -95,10 +95,8 @@ struct vmd_dev { ...@@ -95,10 +95,8 @@ struct vmd_dev {
struct irq_domain *irq_domain; struct irq_domain *irq_domain;
struct pci_bus *bus; struct pci_bus *bus;
#ifdef CONFIG_X86_DEV_DMA_OPS
struct dma_map_ops dma_ops; struct dma_map_ops dma_ops;
struct dma_domain dma_domain; struct dma_domain dma_domain;
#endif
}; };
static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus) static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus)
...@@ -293,7 +291,6 @@ static struct msi_domain_info vmd_msi_domain_info = { ...@@ -293,7 +291,6 @@ static struct msi_domain_info vmd_msi_domain_info = {
.chip = &vmd_msi_controller, .chip = &vmd_msi_controller,
}; };
#ifdef CONFIG_X86_DEV_DMA_OPS
/* /*
* VMD replaces the requester ID with its own. DMA mappings for devices in a * VMD replaces the requester ID with its own. DMA mappings for devices in a
* VMD domain need to be mapped for the VMD, not the device requiring * VMD domain need to be mapped for the VMD, not the device requiring
...@@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd) ...@@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
add_dma_domain(domain); add_dma_domain(domain);
} }
#undef ASSIGN_VMD_DMA_OPS #undef ASSIGN_VMD_DMA_OPS
#else
static void vmd_teardown_dma_ops(struct vmd_dev *vmd) {}
static void vmd_setup_dma_ops(struct vmd_dev *vmd) {}
#endif
static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus, static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
unsigned int devfn, int reg, int len) unsigned int devfn, int reg, int len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment