Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
Merge more updates from Andrew Morton:
 "155 patches.

  Subsystems affected by this patch series: mm (dax, debug, thp,
  readahead, page-poison, util, memory-hotplug, zram, cleanups), misc,
  core-kernel, get_maintainer, MAINTAINERS, lib, bitops, checkpatch,
  binfmt, ramfs, autofs, nilfs, rapidio, panic, relay, kgdb, ubsan,
  romfs, and fault-injection"

* emailed patches from Andrew Morton <[email protected]>: (155 commits)
  lib, uaccess: add failure injection to usercopy functions
  lib, include/linux: add usercopy failure capability
  ROMFS: support inode blocks calculation
  ubsan: introduce CONFIG_UBSAN_LOCAL_BOUNDS for Clang
  sched.h: drop in_ubsan field when UBSAN is in trap mode
  scripts/gdb/tasks: add headers and improve spacing format
  scripts/gdb/proc: add struct mount & struct super_block addr in lx-mounts command
  kernel/relay.c: drop unneeded initialization
  panic: dump registers on panic_on_warn
  rapidio: fix the missed put_device() for rio_mport_add_riodev
  rapidio: fix error handling path
  nilfs2: fix some kernel-doc warnings for nilfs2
  autofs: harden ioctl table
  ramfs: fix nommu mmap with gaps in the page cache
  mm: remove the now-unnecessary mmget_still_valid() hack
  mm/gup: take mmap_lock in get_dump_page()
  binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot
  coredump: rework elf/elf_fdpic vma_dump_size() into common helper
  coredump: refactor page range dumping into common helper
  coredump: let dump_emit() bail out on short writes
  ...
  • Loading branch information
torvalds committed Oct 16, 2020
2 parents 9ff9b0d + 4d0e9df commit c4cf498
Show file tree
Hide file tree
Showing 161 changed files with 2,390 additions and 1,724 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ James Ketrenos <jketreno@io.(none)>
Jan Glauber <[email protected]> <[email protected]>
Jan Glauber <[email protected]> <[email protected]>
Jan Glauber <[email protected]> <[email protected]>
Jarkko Sakkinen <[email protected]> <[email protected]>
Jason Gunthorpe <[email protected]> <[email protected]>
Jason Gunthorpe <[email protected]> <[email protected]>
Jason Gunthorpe <[email protected]> <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,7 @@
current integrity status.

failslab=
fail_usercopy=
fail_page_alloc=
fail_make_request=[KNL]
General fault injection mechanism.
Expand Down
16 changes: 9 additions & 7 deletions Documentation/core-api/xarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,15 @@ or iterations will move the index to the first index in the range.
Each entry will only be returned once, no matter how many indices it
occupies.

Using xas_next() or xas_prev() with a multi-index xa_state
is not supported. Using either of these functions on a multi-index entry
will reveal sibling entries; these should be skipped over by the caller.

Storing ``NULL`` into any index of a multi-index entry will set the entry
at every index to ``NULL`` and dissolve the tie. Splitting a multi-index
entry into entries occupying smaller ranges is not yet supported.
Using xas_next() or xas_prev() with a multi-index xa_state is not
supported. Using either of these functions on a multi-index entry will
reveal sibling entries; these should be skipped over by the caller.

Storing ``NULL`` into any index of a multi-index entry will set the
entry at every index to ``NULL`` and dissolve the tie. A multi-index
entry can be split into entries occupying smaller ranges by calling
xas_split_alloc() without the xa_lock held, followed by taking the lock
and calling xas_split().

Functions and structures
========================
Expand Down
7 changes: 6 additions & 1 deletion Documentation/fault-injection/fault-injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Available fault injection capabilities

injects page allocation failures. (alloc_pages(), get_free_pages(), ...)

- fail_usercopy

injects failures in user memory access functions. (copy_from_user(), get_user(), ...)

- fail_futex

injects futex deadlock and uaddr fault errors.
Expand Down Expand Up @@ -177,6 +181,7 @@ use the boot option::

failslab=
fail_page_alloc=
fail_usercopy=
fail_make_request=
fail_futex=
mmc_core.fail_request=<interval>,<probability>,<space>,<times>
Expand Down Expand Up @@ -222,7 +227,7 @@ How to add new fault injection capability

- debugfs entries

failslab, fail_page_alloc, and fail_make_request use this way.
failslab, fail_page_alloc, fail_usercopy, and fail_make_request use this way.
Helper functions:

fault_create_debugfs_attr(name, parent, attr);
Expand Down
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9715,7 +9715,7 @@ F: security/keys/encrypted-keys/

KEYS-TRUSTED
M: James Bottomley <[email protected]>
M: Jarkko Sakkinen <jarkko[email protected]>
M: Jarkko Sakkinen <jarkko@kernel.org>
M: Mimi Zohar <[email protected]>
L: [email protected]
L: [email protected]
Expand All @@ -9727,7 +9727,7 @@ F: security/keys/trusted-keys/

KEYS/KEYRINGS
M: David Howells <[email protected]>
M: Jarkko Sakkinen <jarkko[email protected]>
M: Jarkko Sakkinen <jarkko@kernel.org>
L: [email protected]
S: Maintained
F: Documentation/security/keys/core.rst
Expand Down Expand Up @@ -17717,7 +17717,7 @@ F: drivers/platform/x86/toshiba-wmi.c

TPM DEVICE DRIVER
M: Peter Huewe <[email protected]>
M: Jarkko Sakkinen <jarkko[email protected]>
M: Jarkko Sakkinen <jarkko@kernel.org>
R: Jason Gunthorpe <[email protected]>
L: [email protected]
S: Maintained
Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ virtual_memmap_init(u64 start, u64 end, void *arg)
if (map_start < map_end)
memmap_init_zone((unsigned long)(map_end - map_start),
args->nid, args->zone, page_to_pfn(map_start),
MEMINIT_EARLY, NULL);
MEMINIT_EARLY, NULL, MIGRATE_MOVABLE);
return 0;
}

Expand All @@ -547,7 +547,7 @@ memmap_init (unsigned long size, int nid, unsigned long zone,
{
if (!vmem_map) {
memmap_init_zone(size, nid, zone, start_pfn,
MEMINIT_EARLY, NULL);
MEMINIT_EARLY, NULL, MIGRATE_MOVABLE);
} else {
struct page *start;
struct memmap_init_callback_data args;
Expand Down
29 changes: 23 additions & 6 deletions arch/powerpc/include/asm/book3s/64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
VM_BUG_ON(pfn >> (64 - PAGE_SHIFT));
VM_BUG_ON((pfn << PAGE_SHIFT) & ~PTE_RPN_MASK);

return __pte(((pte_basic_t)pfn << PAGE_SHIFT) | pgprot_val(pgprot));
return __pte(((pte_basic_t)pfn << PAGE_SHIFT) | pgprot_val(pgprot) | _PAGE_PTE);
}

static inline unsigned long pte_pfn(pte_t pte)
Expand Down Expand Up @@ -651,11 +651,6 @@ static inline pte_t pte_mkexec(pte_t pte)
return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_EXEC));
}

static inline pte_t pte_mkpte(pte_t pte)
{
return __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_PTE));
}

static inline pte_t pte_mkwrite(pte_t pte)
{
/*
Expand Down Expand Up @@ -819,6 +814,14 @@ static inline int pte_none(pte_t pte)
static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pte, int percpu)
{

VM_WARN_ON(!(pte_raw(pte) & cpu_to_be64(_PAGE_PTE)));
/*
* Keep the _PAGE_PTE added till we are sure we handle _PAGE_PTE
* in all the callers.
*/
pte = __pte_raw(pte_raw(pte) | cpu_to_be64(_PAGE_PTE));

if (radix_enabled())
return radix__set_pte_at(mm, addr, ptep, pte, percpu);
return hash__set_pte_at(mm, addr, ptep, pte, percpu);
Expand Down Expand Up @@ -866,6 +869,13 @@ static inline bool pte_ci(pte_t pte)

static inline void pmd_clear(pmd_t *pmdp)
{
if (IS_ENABLED(CONFIG_DEBUG_VM) && !radix_enabled()) {
/*
* Don't use this if we can possibly have a hash page table
* entry mapping this.
*/
WARN_ON((pmd_val(*pmdp) & (H_PAGE_HASHPTE | _PAGE_PTE)) == (H_PAGE_HASHPTE | _PAGE_PTE));
}
*pmdp = __pmd(0);
}

Expand Down Expand Up @@ -914,6 +924,13 @@ static inline int pmd_bad(pmd_t pmd)

static inline void pud_clear(pud_t *pudp)
{
if (IS_ENABLED(CONFIG_DEBUG_VM) && !radix_enabled()) {
/*
* Don't use this if we can possibly have a hash page table
* entry mapping this.
*/
WARN_ON((pud_val(*pudp) & (H_PAGE_HASHPTE | _PAGE_PTE)) == (H_PAGE_HASHPTE | _PAGE_PTE));
}
*pudp = __pud(0);
}

Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/include/asm/nohash/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ static inline pte_t pte_mkold(pte_t pte)
return __pte(pte_val(pte) & ~_PAGE_ACCESSED);
}

static inline pte_t pte_mkpte(pte_t pte)
{
return pte;
}

static inline pte_t pte_mkspecial(pte_t pte)
{
return __pte(pte_val(pte) | _PAGE_SPECIAL);
Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
*/
VM_WARN_ON(pte_hw_valid(*ptep) && !pte_protnone(*ptep));

/* Add the pte bit when trying to set a pte */
pte = pte_mkpte(pte);

/* Note: mm->context.id might not yet have been assigned as
* this context might not have been activated yet when this
* is called.
Expand Down Expand Up @@ -275,8 +272,6 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_
*/
VM_WARN_ON(pte_hw_valid(*ptep) && !pte_protnone(*ptep));

pte = pte_mkpte(pte);

pte = set_pte_filter(pte);

val = pte_val(pte);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powernv/memtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static int memtrace_online(void)
ent->mem = 0;
}

if (add_memory(ent->nid, ent->start, ent->size)) {
if (add_memory(ent->nid, ent->start, ent->size, MHP_NONE)) {
pr_err("Failed to add trace memory to node %d\n",
ent->nid);
ret += 1;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb)
block_sz = memory_block_size_bytes();

/* Add the memory */
rc = __add_memory(lmb->nid, lmb->base_addr, block_sz);
rc = __add_memory(lmb->nid, lmb->base_addr, block_sz, MHP_NONE);
if (rc) {
invalidate_lmb_associativity_index(lmb);
return rc;
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
if (node < 0)
node = memory_add_physaddr_to_nid(info->start_addr);

result = __add_memory(node, info->start_addr, info->length);
result = __add_memory(node, info->start_addr, info->length,
MHP_NONE);

/*
* If the memory block has been used by the kernel, add_memory()
Expand Down
3 changes: 2 additions & 1 deletion drivers/base/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr,

nid = memory_add_physaddr_to_nid(phys_addr);
ret = __add_memory(nid, phys_addr,
MIN_MEMORY_BLOCK_SIZE * sections_per_block);
MIN_MEMORY_BLOCK_SIZE * sections_per_block,
MHP_NONE);

if (ret)
goto out;
Expand Down
33 changes: 21 additions & 12 deletions drivers/base/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,8 @@ static int __ref get_nid_for_pfn(unsigned long pfn)
return pfn_to_nid(pfn);
}

static int do_register_memory_block_under_node(int nid,
struct memory_block *mem_blk)
static void do_register_memory_block_under_node(int nid,
struct memory_block *mem_blk)
{
int ret;

Expand All @@ -786,12 +786,19 @@ static int do_register_memory_block_under_node(int nid,
ret = sysfs_create_link_nowarn(&node_devices[nid]->dev.kobj,
&mem_blk->dev.kobj,
kobject_name(&mem_blk->dev.kobj));
if (ret)
return ret;
if (ret && ret != -EEXIST)
dev_err_ratelimited(&node_devices[nid]->dev,
"can't create link to %s in sysfs (%d)\n",
kobject_name(&mem_blk->dev.kobj), ret);

return sysfs_create_link_nowarn(&mem_blk->dev.kobj,
ret = sysfs_create_link_nowarn(&mem_blk->dev.kobj,
&node_devices[nid]->dev.kobj,
kobject_name(&node_devices[nid]->dev.kobj));
if (ret && ret != -EEXIST)
dev_err_ratelimited(&mem_blk->dev,
"can't create link to %s in sysfs (%d)\n",
kobject_name(&node_devices[nid]->dev.kobj),
ret);
}

/* register memory section under specified node if it spans that node */
Expand Down Expand Up @@ -827,7 +834,8 @@ static int register_mem_block_under_node_early(struct memory_block *mem_blk,
if (page_nid != nid)
continue;

return do_register_memory_block_under_node(nid, mem_blk);
do_register_memory_block_under_node(nid, mem_blk);
return 0;
}
/* mem section does not span the specified node */
return 0;
Expand All @@ -842,7 +850,8 @@ static int register_mem_block_under_node_hotplug(struct memory_block *mem_blk,
{
int nid = *(int *)arg;

return do_register_memory_block_under_node(nid, mem_blk);
do_register_memory_block_under_node(nid, mem_blk);
return 0;
}

/*
Expand All @@ -860,8 +869,8 @@ void unregister_memory_block_under_nodes(struct memory_block *mem_blk)
kobject_name(&node_devices[mem_blk->nid]->dev.kobj));
}

int link_mem_sections(int nid, unsigned long start_pfn, unsigned long end_pfn,
enum meminit_context context)
void link_mem_sections(int nid, unsigned long start_pfn, unsigned long end_pfn,
enum meminit_context context)
{
walk_memory_blocks_func_t func;

Expand All @@ -870,9 +879,9 @@ int link_mem_sections(int nid, unsigned long start_pfn, unsigned long end_pfn,
else
func = register_mem_block_under_node_early;

return walk_memory_blocks(PFN_PHYS(start_pfn),
PFN_PHYS(end_pfn - start_pfn), (void *)&nid,
func);
walk_memory_blocks(PFN_PHYS(start_pfn), PFN_PHYS(end_pfn - start_pfn),
(void *)&nid, func);
return;
}

#ifdef CONFIG_HUGETLBFS
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index,
zram_slot_unlock(zram, index);

/* Should NEVER happen. Return bio error if it does. */
if (unlikely(ret))
if (WARN_ON(ret))
pr_err("Decompression failed! err=%d, page=%u\n", ret, index);

return ret;
Expand Down
Loading

0 comments on commit c4cf498

Please sign in to comment.