Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: "A few little subsystems and a start of a lot of MM patches. Subsystems affected by this patch series: squashfs, ocfs2, parisc, vfs. With mm subsystems: slab-generic, slub, debug, pagecache, gup, swap, memcg, pagemap, memory-failure, vmalloc, kasan" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (128 commits) kasan: move kasan_report() into report.c mm/mm_init.c: report kasan-tag information stored in page->flags ubsan: entirely disable alignment checks under UBSAN_TRAP kasan: fix clang compilation warning due to stack protector x86/mm: remove vmalloc faulting mm: remove vmalloc_sync_(un)mappings() x86/mm/32: implement arch_sync_kernel_mappings() x86/mm/64: implement arch_sync_kernel_mappings() mm/ioremap: track which page-table levels were modified mm/vmalloc: track which page-table levels were modified mm: add functions to track page directory modifications s390: use __vmalloc_node in stack_alloc powerpc: use __vmalloc_node in alloc_vm_stack arm64: use __vmalloc_node in arch_alloc_vmap_stack mm: remove vmalloc_user_node_flags mm: switch the test_vmalloc module to use __vmalloc_node mm: remove __vmalloc_node_flags_caller mm: remove both instances of __vmalloc_node_flags mm: remove the prot argument to __vmalloc_node mm: remove the pgprot argument to __vmalloc ...
This commit is contained in:
@@ -748,9 +748,8 @@ void do_IRQ(struct pt_regs *regs)
|
||||
|
||||
static void *__init alloc_vm_stack(void)
|
||||
{
|
||||
return __vmalloc_node_range(THREAD_SIZE, THREAD_ALIGN, VMALLOC_START,
|
||||
VMALLOC_END, THREADINFO_GFP, PAGE_KERNEL,
|
||||
0, NUMA_NO_NODE, (void*)_RET_IP_);
|
||||
return __vmalloc_node(THREAD_SIZE, THREAD_ALIGN, THREADINFO_GFP,
|
||||
NUMA_NO_NODE, (void *)_RET_IP_);
|
||||
}
|
||||
|
||||
static void __init vmap_irqstack_init(void)
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/io.h>
|
||||
@@ -38,6 +39,22 @@ EXPORT_SYMBOL_GPL(isa_bridge_pcidev);
|
||||
#define ISA_SPACE_MASK 0x1
|
||||
#define ISA_SPACE_IO 0x1
|
||||
|
||||
static void remap_isa_base(phys_addr_t pa, unsigned long size)
|
||||
{
|
||||
WARN_ON_ONCE(ISA_IO_BASE & ~PAGE_MASK);
|
||||
WARN_ON_ONCE(pa & ~PAGE_MASK);
|
||||
WARN_ON_ONCE(size & ~PAGE_MASK);
|
||||
|
||||
if (slab_is_available()) {
|
||||
if (ioremap_page_range(ISA_IO_BASE, ISA_IO_BASE + size, pa,
|
||||
pgprot_noncached(PAGE_KERNEL)))
|
||||
unmap_kernel_range(ISA_IO_BASE, size);
|
||||
} else {
|
||||
early_ioremap_range(ISA_IO_BASE, pa, size,
|
||||
pgprot_noncached(PAGE_KERNEL));
|
||||
}
|
||||
}
|
||||
|
||||
static void pci_process_ISA_OF_ranges(struct device_node *isa_node,
|
||||
unsigned long phb_io_base_phys)
|
||||
{
|
||||
@@ -105,15 +122,13 @@ static void pci_process_ISA_OF_ranges(struct device_node *isa_node,
|
||||
if (size > 0x10000)
|
||||
size = 0x10000;
|
||||
|
||||
__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
|
||||
size, pgprot_noncached(PAGE_KERNEL));
|
||||
remap_isa_base(phb_io_base_phys, size);
|
||||
return;
|
||||
|
||||
inval_range:
|
||||
printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
|
||||
"mapping 64k\n");
|
||||
__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
|
||||
0x10000, pgprot_noncached(PAGE_KERNEL));
|
||||
remap_isa_base(phb_io_base_phys, 0x10000);
|
||||
}
|
||||
|
||||
|
||||
@@ -248,8 +263,7 @@ void __init isa_bridge_init_non_pci(struct device_node *np)
|
||||
* and map it
|
||||
*/
|
||||
isa_io_base = ISA_IO_BASE;
|
||||
__ioremap_at(pbase, (void *)ISA_IO_BASE,
|
||||
size, pgprot_noncached(PAGE_KERNEL));
|
||||
remap_isa_base(pbase, size);
|
||||
|
||||
pr_debug("ISA: Non-PCI bridge is %pOF\n", np);
|
||||
}
|
||||
@@ -297,7 +311,7 @@ static void isa_bridge_remove(void)
|
||||
isa_bridge_pcidev = NULL;
|
||||
|
||||
/* Unmap the ISA area */
|
||||
__iounmap_at((void *)ISA_IO_BASE, 0x10000);
|
||||
unmap_kernel_range(ISA_IO_BASE, 0x10000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -109,23 +109,47 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
|
||||
/* Get the host bridge */
|
||||
hose = pci_bus_to_host(bus);
|
||||
|
||||
/* Check if we have IOs allocated */
|
||||
if (hose->io_base_alloc == NULL)
|
||||
return 0;
|
||||
|
||||
pr_debug("IO unmapping for PHB %pOF\n", hose->dn);
|
||||
pr_debug(" alloc=0x%p\n", hose->io_base_alloc);
|
||||
|
||||
/* This is a PHB, we fully unmap the IO area */
|
||||
vunmap(hose->io_base_alloc);
|
||||
|
||||
iounmap(hose->io_base_alloc);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pcibios_unmap_io_space);
|
||||
|
||||
static int pcibios_map_phb_io_space(struct pci_controller *hose)
|
||||
void __iomem *ioremap_phb(phys_addr_t paddr, unsigned long size)
|
||||
{
|
||||
struct vm_struct *area;
|
||||
unsigned long addr;
|
||||
|
||||
WARN_ON_ONCE(paddr & ~PAGE_MASK);
|
||||
WARN_ON_ONCE(size & ~PAGE_MASK);
|
||||
|
||||
/*
|
||||
* Let's allocate some IO space for that guy. We don't pass VM_IOREMAP
|
||||
* because we don't care about alignment tricks that the core does in
|
||||
* that case. Maybe we should due to stupid card with incomplete
|
||||
* address decoding but I'd rather not deal with those outside of the
|
||||
* reserved 64K legacy region.
|
||||
*/
|
||||
area = __get_vm_area_caller(size, 0, PHB_IO_BASE, PHB_IO_END,
|
||||
__builtin_return_address(0));
|
||||
if (!area)
|
||||
return NULL;
|
||||
|
||||
addr = (unsigned long)area->addr;
|
||||
if (ioremap_page_range(addr, addr + size, paddr,
|
||||
pgprot_noncached(PAGE_KERNEL))) {
|
||||
unmap_kernel_range(addr, size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (void __iomem *)addr;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ioremap_phb);
|
||||
|
||||
static int pcibios_map_phb_io_space(struct pci_controller *hose)
|
||||
{
|
||||
unsigned long phys_page;
|
||||
unsigned long size_page;
|
||||
unsigned long io_virt_offset;
|
||||
@@ -146,12 +170,11 @@ static int pcibios_map_phb_io_space(struct pci_controller *hose)
|
||||
* with incomplete address decoding but I'd rather not deal with
|
||||
* those outside of the reserved 64K legacy region.
|
||||
*/
|
||||
area = __get_vm_area(size_page, 0, PHB_IO_BASE, PHB_IO_END);
|
||||
if (area == NULL)
|
||||
hose->io_base_alloc = ioremap_phb(phys_page, size_page);
|
||||
if (!hose->io_base_alloc)
|
||||
return -ENOMEM;
|
||||
hose->io_base_alloc = area->addr;
|
||||
hose->io_base_virt = (void __iomem *)(area->addr +
|
||||
hose->io_base_phys - phys_page);
|
||||
hose->io_base_virt = hose->io_base_alloc +
|
||||
hose->io_base_phys - phys_page;
|
||||
|
||||
pr_debug("IO mapping for PHB %pOF\n", hose->dn);
|
||||
pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n",
|
||||
@@ -159,11 +182,6 @@ static int pcibios_map_phb_io_space(struct pci_controller *hose)
|
||||
pr_debug(" size=0x%016llx (alloc=0x%016lx)\n",
|
||||
hose->pci_io_size, size_page);
|
||||
|
||||
/* Establish the mapping */
|
||||
if (__ioremap_at(phys_page, area->addr, size_page,
|
||||
pgprot_noncached(PAGE_KERNEL)) == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Fixup hose IO resource */
|
||||
io_virt_offset = pcibios_io_space_offset(hose);
|
||||
hose->io_resource.start += io_virt_offset;
|
||||
|
Reference in New Issue
Block a user