projects/linux·commit c4cf498d

Merge branch 'akpm' (patches from Andrew)

c4cf498d · Linus Torvalds <[email protected]> · 2020-10-16 11:31:55 -07:00

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
  ...
Commit
c4cf498dc0241fa2d758dba177634268446afb06
Parents
9ff9b0d3 · 4d0e9df5

Merge commit. Changes below are compared with the first parent: 9ff9b0d3.

Changes

161 files changed · +2390 −1724

FileStatusAddDelContent
.mailmapmodified+1−0View file
Documentation/admin-guide/kernel-parameters.txtmodified+1−0View file
Documentation/core-api/xarray.rstmodified+9−7View file
Documentation/fault-injection/fault-injection.rstmodified+6−1View file
MAINTAINERSmodified+3−3View file
arch/ia64/mm/init.cmodified+2−2View file
arch/powerpc/include/asm/book3s/64/pgtable.hmodified+23−6View file
arch/powerpc/include/asm/nohash/pgtable.hmodified+0−5View file
arch/powerpc/mm/pgtable.cmodified+0−5View file
arch/powerpc/platforms/powernv/memtrace.cmodified+1−1View file
arch/powerpc/platforms/pseries/hotplug-memory.cmodified+1−1View file
drivers/acpi/acpi_memhotplug.cmodified+2−1View file
drivers/base/memory.cmodified+2−1View file
drivers/base/node.cmodified+21−12View file
drivers/block/zram/zram_drv.cmodified+1−1View file
drivers/dax/kmem.cmodified+35−15View file
drivers/hv/hv_balloon.cmodified+1−1View file
drivers/infiniband/core/uverbs_main.cmodified+0−3View file
drivers/rapidio/devices/rio_mport_cdev.cmodified+11−7View file
drivers/s390/char/sclp_cmd.cmodified+1−1View file
drivers/vfio/pci/vfio_pci.cmodified+18−20View file
drivers/virtio/virtio_mem.cmodified+2−1View file
drivers/xen/balloon.cmodified+1−1View file
fs/autofs/dev-ioctl.cmodified+6−2View file
fs/binfmt_elf.cmodified+47−216View file
fs/binfmt_elf_fdpic.cmodified+27−135View file
fs/configfs/dir.cmodified+1−1View file
fs/configfs/file.cmodified+1−1View file
fs/coredump.cmodified+225−11View file
fs/ext4/verity.cmodified+2−2View file
fs/f2fs/verity.cmodified+2−2View file
fs/inode.cmodified+2−0View file
fs/nilfs2/bmap.cmodified+1−1View file
fs/nilfs2/cpfile.cmodified+3−3View file
fs/nilfs2/page.cmodified+0−1View file
fs/nilfs2/sufile.cmodified+2−2View file
fs/proc/task_mmu.cmodified+0−18View file
fs/ramfs/file-nommu.cmodified+1−1View file
fs/romfs/super.cmodified+1−0View file
fs/userfaultfd.cmodified+9−19View file
include/linux/bitops.hmodified+4−9View file
include/linux/blkdev.hmodified+1−0View file
include/linux/bvec.hmodified+5−1View file
include/linux/coredump.hmodified+11−0View file
include/linux/fault-inject-usercopy.hadded+22−0View file
include/linux/fs.hmodified+1−27View file
include/linux/idr.hmodified+10−3View file
include/linux/ioport.hmodified+8−3View file
include/linux/jiffies.hmodified+2−1View file
include/linux/kernel.hmodified+1−149View file
include/linux/list.hmodified+19−10View file
include/linux/memory_hotplug.hmodified+26−16View file
include/linux/minmax.hadded+153−0View file
include/linux/mm.hmodified+2−3View file
include/linux/mmzone.hmodified+8−9View file
include/linux/node.hmodified+7−9View file
include/linux/nodemask.hmodified+1−1View file
include/linux/page-flags.hmodified+1−5View file
include/linux/page_owner.hmodified+3−3View file
include/linux/pagemap.hmodified+96−11View file
include/linux/sched.hmodified+1−1View file
include/linux/sched/mm.hmodified+0−25View file
include/linux/uaccess.hmodified+11−1View file
include/linux/vmstat.hmodified+1−1View file
include/linux/xarray.hmodified+22−0View file
include/ras/ras_event.hmodified+3−0View file
kernel/acct.cmodified+4−6View file
kernel/cgroup/cpuset.cmodified+1−1View file
kernel/dma/direct.cmodified+1−1View file
kernel/fork.cmodified+2−2View file
kernel/futex.cmodified+1−1View file
kernel/irq/timings.cmodified+1−1View file
kernel/jump_label.cmodified+1−1View file
kernel/kcsan/encoding.hmodified+1−1View file
kernel/kexec_core.cmodified+1−1View file
kernel/kexec_file.cmodified+1−1View file
kernel/kthread.cmodified+1−1View file
kernel/livepatch/state.cmodified+1−1View file
kernel/panic.cmodified+6−6View file
kernel/pid_namespace.cmodified+1−1View file
kernel/power/snapshot.cmodified+1−1View file
kernel/range.cmodified+2−1View file
kernel/relay.cmodified+1−1View file
kernel/resource.cmodified+88−22View file
kernel/smp.cmodified+1−1View file
kernel/sys.cmodified+1−1View file
kernel/user_namespace.cmodified+1−1View file
lib/Kconfig.debugmodified+7−0View file
lib/Kconfig.ubsanmodified+14−0View file
lib/Makefilemodified+1−0View file
lib/bitmap.cmodified+1−1View file
lib/crc32.cmodified+1−1View file
lib/decompress_bunzip2.cmodified+1−1View file
lib/dynamic_queue_limits.cmodified+2−2View file
lib/earlycpio.cmodified+1−1View file
lib/fault-inject-usercopy.cadded+39−0View file
lib/find_bit.cmodified+1−0View file
lib/hexdump.cmodified+1−0View file
lib/idr.cmodified+6−3View file
lib/iov_iter.cmodified+5−0View file
lib/libcrc32c.cmodified+1−1View file
lib/math/rational.cmodified+1−1View file
lib/math/reciprocal_div.cmodified+1−0View file
lib/mpi/mpi-bit.cmodified+1−1View file
lib/percpu_counter.cmodified+1−1View file
lib/radix-tree.cmodified+1−1View file
lib/scatterlist.cmodified+1−1View file
lib/strncpy_from_user.cmodified+3−0View file
lib/syscall.cmodified+1−1View file
lib/test_hmm.cmodified+1−1View file
lib/test_sysctl.cmodified+1−1View file
lib/test_xarray.cmodified+65−0View file
lib/usercopy.cmodified+4−1View file
lib/xarray.cmodified+199−9View file
mm/Kconfigmodified+1−1View file
mm/compaction.cmodified+3−3View file
mm/debug_vm_pgtable.cmodified+101−106View file
mm/filemap.cmodified+39−19View file
mm/gup.cmodified+32−29View file
mm/highmem.cmodified+2−2View file
mm/huge_memory.cmodified+24−21View file
mm/hwpoison-inject.cmodified+5−13View file
mm/internal.hmodified+11−16View file
mm/khugepaged.cmodified+1−1View file
mm/madvise.cmodified+13−39View file
mm/memory-failure.cmodified+143−168View file
mm/memory.cmodified+4−3View file
mm/memory_hotplug.cmodified+86−125View file
mm/memremap.cmodified+2−1View file
mm/migrate.cmodified+3−8View file
mm/mmap.cmodified+2−5View file
mm/mmu_notifier.cmodified+1−1View file
mm/page-writeback.cmodified+1−0View file
mm/page_alloc.cmodified+157−84View file
mm/page_isolation.cmodified+9−7View file
mm/page_owner.cmodified+5−5View file
mm/page_poison.cmodified+15−5View file
mm/page_reporting.cmodified+2−2View file
mm/readahead.cmodified+49−81View file
mm/rmap.cmodified+5−5View file
mm/shmem.cmodified+1−1View file
mm/shuffle.cmodified+1−1View file
mm/slab.cmodified+1−1View file
mm/slab.hmodified+0−1View file
mm/slub.cmodified+1−1View file
mm/sparse.cmodified+2−0View file
mm/swap_state.cmodified+1−1View file
mm/truncate.cmodified+3−3View file
mm/util.cmodified+2−1View file
mm/vmscan.cmodified+2−3View file
mm/vmstat.cmodified+4−4View file
mm/workingset.cmodified+1−1View file
scripts/Makefile.ubsanmodified+9−1View file
scripts/checkpatch.plmodified+178−60View file
scripts/const_structs.checkpatchmodified+3−0View file
scripts/gdb/linux/proc.pymodified+7−8View file
scripts/gdb/linux/tasks.pymodified+5−4View file
scripts/get_maintainer.plmodified+7−2View file
tools/testing/selftests/exec/.gitignoremodified+1−0View file
tools/testing/selftests/exec/Makefilemodified+7−2View file
tools/testing/selftests/exec/load_address.cadded+68−0View file

Only the first 600 diff lines are shown. Download the complete patch.

.mailmap

View file
diff --git a/.mailmap b/.mailmap
index e4ccac4..1e14566 100644
--- a/.mailmap
+++ b/.mailmap
@@ -133,6 +133,7 @@ James Ketrenos <jketreno@io.(none)>

Documentation/admin-guide/kernel-parameters.txt

View file
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0f1fb7e..d246ad4 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1343,6 +1343,7 @@
current integrity status.
failslab=
+ fail_usercopy=
fail_page_alloc=
fail_make_request=[KNL]
General fault injection mechanism.

Documentation/core-api/xarray.rst

View file
diff --git a/Documentation/core-api/xarray.rst b/Documentation/core-api/xarray.rst
index 640934b..a137a0e 100644
--- a/Documentation/core-api/xarray.rst
+++ b/Documentation/core-api/xarray.rst
@@ -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
========================

Documentation/fault-injection/fault-injection.rst

View file
diff --git a/Documentation/fault-injection/fault-injection.rst b/Documentation/fault-injection/fault-injection.rst
index f850ad0..31ecfe4 100644
--- a/Documentation/fault-injection/fault-injection.rst
+++ b/Documentation/fault-injection/fault-injection.rst
@@ -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.
@@ -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>
@@ -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);

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 0f59b04..2c31900 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9715,7 +9715,7 @@ F: security/keys/encrypted-keys/
KEYS-TRUSTED
M: James Bottomley <[email protected]>
-M: Jarkko Sakkinen <[email protected]>
+M: Jarkko Sakkinen <[email protected]>
M: Mimi Zohar <[email protected]>
@@ -9727,7 +9727,7 @@ F: security/keys/trusted-keys/
KEYS/KEYRINGS
M: David Howells <[email protected]>
-M: Jarkko Sakkinen <[email protected]>
+M: Jarkko Sakkinen <[email protected]>
S: Maintained
F: Documentation/security/keys/core.rst
@@ -17717,7 +17717,7 @@ F: drivers/platform/x86/toshiba-wmi.c
TPM DEVICE DRIVER
M: Peter Huewe <[email protected]>
-M: Jarkko Sakkinen <[email protected]>
+M: Jarkko Sakkinen <[email protected]>
R: Jason Gunthorpe <[email protected]>
S: Maintained

arch/ia64/mm/init.c

View file
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index d8686bf..ef12e09 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -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;
}
@@ -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;

arch/powerpc/include/asm/book3s/64/pgtable.h

View file
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 495fc0c..f6d2c44 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -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)
@@ -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)
{
/*
@@ -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);
@@ -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);
}
@@ -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);
}

arch/powerpc/include/asm/nohash/pgtable.h

View file
diff --git a/arch/powerpc/include/asm/nohash/pgtable.h b/arch/powerpc/include/asm/nohash/pgtable.h
index 4b7c347..6277e75 100644
--- a/arch/powerpc/include/asm/nohash/pgtable.h
+++ b/arch/powerpc/include/asm/nohash/pgtable.h
@@ -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);

arch/powerpc/mm/pgtable.c

View file
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index 9c0547d..ab57b07 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -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.
@@ -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);

arch/powerpc/platforms/powernv/memtrace.c

View file
diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index 13b369d..6828108 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -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;

arch/powerpc/platforms/pseries/hotplug-memory.c

View file
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 5d545b7..d8bbf0c 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -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;

drivers/acpi/acpi_memhotplug.c

View file
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index ad6e90f..b02fd51 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -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()

drivers/base/memory.c

View file
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index adf828d..eef4ffb 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -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;

drivers/base/node.c

View file
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 43d21f9..6ffa470 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -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;
@@ -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 */
@@ -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;
@@ -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;
}
/*
@@ -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;
@@ -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

drivers/block/zram/zram_drv.c

View file
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index bff3d40..029403c 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -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;

drivers/dax/kmem.c

View file
diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c
index 6c933f2..b4368c5 100644
--- a/drivers/dax/kmem.c
+++ b/drivers/dax/kmem.c
@@ -35,11 +35,17 @@ static int dax_kmem_range(struct dev_dax *dev_dax, int i, struct range *r)
return 0;
}
+struct dax_kmem_data {
+ const char *res_name;
+ struct resource *res[];
+};
+
static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
{
struct device *dev = &dev_dax->dev;
+ struct dax_kmem_data *data;
+ int rc = -ENOMEM;
int i, mapped = 0;
- char *res_name;
int numa_node;
/*
@@ -55,14 +61,17 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
return -EINVAL;
}
- res_name = kstrdup(dev_name(dev), GFP_KERNEL);
- if (!res_name)
+ data = kzalloc(sizeof(*data) + sizeof(struct resource *) * dev_dax->nr_range, GFP_KERNEL);
+ if (!data)
return -ENOMEM;
+ data->res_name = kstrdup(dev_name(dev), GFP_KERNEL);
+ if (!data->res_name)
+ goto err_res_name;
+
for (i = 0; i < dev_dax->nr_range; i++) {
struct resource *res;
struct range range;
- int rc;
rc = dax_kmem_range(dev_dax, i, &range);
if (rc) {
@@ -72,7 +81,7 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
}
/* Region is permanently reserved if hotremove fails. */
- res = request_mem_region(range.start, range_len(&range), res_name);
+ res = request_mem_region(range.start, range_len(&range), data->res_name);
if (!res) {
dev_warn(dev, "mapping%d: %#llx-%#llx could not reserve region\n",
i, range.start, range.end);
@@ -82,9 +91,10 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
*/
if (mapped)
continue;
- kfree(res_name);
- return -EBUSY;
+ rc = -EBUSY;
+ goto err_request_mem;
}
+ data->res[i] = res;
/*
* Set flags appropriate for System RAM. Leave ..._BUSY clear
@@ -99,23 +109,30 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
* this as RAM automatically.
*/
rc = add_memory_driver_managed(numa_node, range.start,
- range_len(&range), kmem_name);
+ range_len(&range), kmem_name, MHP_NONE);
if (rc) {
dev_warn(dev, "mapping%d: %#llx-%#llx memory add failed\n",
i, range.start, range.end);
- release_mem_region(range.start, range_len(&range));
+ release_resource(res);
+ kfree(res);
+ data->res[i] = NULL;
if (mapped)
continue;
- kfree(res_name);
- return rc;
+ goto err_request_mem;
}
mapped++;
}
- dev_set_drvdata(dev, res_name);
+ dev_set_drvdata(dev, data);
return 0;
+
+err_request_mem:
+ kfree(data->res_name);
+err_res_name:
+ kfree(data);
+ return rc;
}
#ifdef CONFIG_MEMORY_HOTREMOVE
@@ -123,7 +140,7 @@ static int dev_dax_kmem_remove(struct dev_dax *dev_dax)
{
int i, success = 0;
struct device *dev = &dev_dax->dev;
- const char *res_name = dev_get_drvdata(dev);
+ struct dax_kmem_data *data = dev_get_drvdata(dev);
/*
* We have one shot for removing memory, if some memory blocks were not
@@ -142,7 +159,9 @@ static int dev_dax_kmem_remove(struct dev_dax *dev_dax)
rc = remove_memory(dev_dax->target_node, range.start,
range_len(&range));
if (rc == 0) {
- release_mem_region(range.start, range_len(&range));
+ release_resource(data->res[i]);
+ kfree(data->res[i]);
+ data->res[i] = NULL;
success++;
continue;
}
@@ -153,7 +172,8 @@ static int dev_dax_kmem_remove(struct dev_dax *dev_dax)
}
if (success >= dev_dax->nr_range) {
- kfree(res_name);
+ kfree(data->res_name);
+ kfree(data);
dev_set_drvdata(dev, NULL);
}

drivers/hv/hv_balloon.c

View file
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 32e3bc0..b64d2ef 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -726,7 +726,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn));
ret = add_memory(nid, PFN_PHYS((start_pfn)),
- (HA_CHUNK << PAGE_SHIFT));
+ (HA_CHUNK << PAGE_SHIFT), MEMHP_MERGE_RESOURCE);
if (ret) {
pr_err("hot_add memory failed error is %d\n", ret);

drivers/infiniband/core/uverbs_main.c

View file
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 37794d8..a4ba0b8 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -845,8 +845,6 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
* will only be one mm, so no big deal.
*/
mmap_read_lock(mm);
- if (!mmget_still_valid(mm))
- goto skip_mm;
mutex_lock(&ufile->umap_lock);
list_for_each_entry_safe (priv, next_priv, &ufile->umaps,
list) {
@@ -865,7 +863,6 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile)
}
}
mutex_unlock(&ufile->umap_lock);
- skip_mm:
mmap_read_unlock(mm);
mmput(mm);
}

drivers/rapidio/devices/rio_mport_cdev.c

View file
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index a303429..94331d9 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -871,15 +871,16 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode,
rmcd_error("pin_user_pages_fast err=%ld",
pinned);
nr_pages = 0;
- } else
+ } else {
rmcd_error("pinned %ld out of %ld pages",
pinned, nr_pages);
+ /*
+ * Set nr_pages up to mean "how many pages to unpin, in
+ * the error handler:
+ */
+ nr_pages = pinned;
+ }
ret = -EFAULT;
- /*
- * Set nr_pages up to mean "how many pages to unpin, in
- * the error handler:
- */
- nr_pages = pinned;
goto err_pg;
}
@@ -1679,6 +1680,7 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
struct rio_dev *rdev;
struct rio_switch *rswitch = NULL;
struct rio_mport *mport;
+ struct device *dev;
size_t size;
u32 rval;
u32 swpinfo = 0;
@@ -1693,8 +1695,10 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
rmcd_debug(RDEV, "name:%s ct:0x%x did:0x%x hc:0x%x", dev_info.name,
dev_info.comptag, dev_info.destid, dev_info.hopcount);
- if (bus_find_device_by_name(&rio_bus_type, NULL, dev_info.name)) {
+ dev = bus_find_device_by_name(&rio_bus_type, NULL, dev_info.name);
+ if (dev) {

This diff is incomplete. Download the complete patch.

drivers/s390/char/sclp_cmd.c

View file

This diff is incomplete. Download the complete patch.

drivers/vfio/pci/vfio_pci.c

View file

This diff is incomplete. Download the complete patch.

drivers/virtio/virtio_mem.c

View file

This diff is incomplete. Download the complete patch.

drivers/xen/balloon.c

View file

This diff is incomplete. Download the complete patch.

fs/autofs/dev-ioctl.c

View file

This diff is incomplete. Download the complete patch.

fs/binfmt_elf.c

View file

This diff is incomplete. Download the complete patch.

fs/binfmt_elf_fdpic.c

View file

This diff is incomplete. Download the complete patch.

fs/configfs/dir.c

View file

This diff is incomplete. Download the complete patch.

fs/configfs/file.c

View file

This diff is incomplete. Download the complete patch.

fs/coredump.c

View file

This diff is incomplete. Download the complete patch.

fs/ext4/verity.c

View file

This diff is incomplete. Download the complete patch.

fs/f2fs/verity.c

View file

This diff is incomplete. Download the complete patch.

fs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/bmap.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/cpfile.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/page.c

View file

This diff is incomplete. Download the complete patch.

fs/nilfs2/sufile.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/task_mmu.c

View file

This diff is incomplete. Download the complete patch.

fs/ramfs/file-nommu.c

View file

This diff is incomplete. Download the complete patch.

fs/romfs/super.c

View file

This diff is incomplete. Download the complete patch.

fs/userfaultfd.c

View file

This diff is incomplete. Download the complete patch.

include/linux/bitops.h

View file

This diff is incomplete. Download the complete patch.

include/linux/blkdev.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bvec.h

View file

This diff is incomplete. Download the complete patch.

include/linux/coredump.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fault-inject-usercopy.h

View file

This diff is incomplete. Download the complete patch.

include/linux/fs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/idr.h

View file

This diff is incomplete. Download the complete patch.

include/linux/ioport.h

View file

This diff is incomplete. Download the complete patch.

include/linux/jiffies.h

View file

This diff is incomplete. Download the complete patch.

include/linux/kernel.h

View file

This diff is incomplete. Download the complete patch.

include/linux/list.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memory_hotplug.h

View file

This diff is incomplete. Download the complete patch.

include/linux/minmax.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmzone.h

View file

This diff is incomplete. Download the complete patch.

include/linux/node.h

View file

This diff is incomplete. Download the complete patch.

include/linux/nodemask.h

View file

This diff is incomplete. Download the complete patch.

include/linux/page-flags.h

View file

This diff is incomplete. Download the complete patch.

include/linux/page_owner.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pagemap.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched/mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/uaccess.h

View file

This diff is incomplete. Download the complete patch.

include/linux/vmstat.h

View file

This diff is incomplete. Download the complete patch.

include/linux/xarray.h

View file

This diff is incomplete. Download the complete patch.

include/ras/ras_event.h

View file

This diff is incomplete. Download the complete patch.

kernel/acct.c

View file

This diff is incomplete. Download the complete patch.

kernel/cgroup/cpuset.c

View file

This diff is incomplete. Download the complete patch.

kernel/dma/direct.c

View file

This diff is incomplete. Download the complete patch.

kernel/fork.c

View file

This diff is incomplete. Download the complete patch.

kernel/futex.c

View file

This diff is incomplete. Download the complete patch.

kernel/irq/timings.c

View file

This diff is incomplete. Download the complete patch.

kernel/jump_label.c

View file

This diff is incomplete. Download the complete patch.

kernel/kcsan/encoding.h

View file

This diff is incomplete. Download the complete patch.

kernel/kexec_core.c

View file

This diff is incomplete. Download the complete patch.

kernel/kexec_file.c

View file

This diff is incomplete. Download the complete patch.

kernel/kthread.c

View file

This diff is incomplete. Download the complete patch.

kernel/livepatch/state.c

View file

This diff is incomplete. Download the complete patch.

kernel/panic.c

View file

This diff is incomplete. Download the complete patch.

kernel/pid_namespace.c

View file

This diff is incomplete. Download the complete patch.

kernel/power/snapshot.c

View file

This diff is incomplete. Download the complete patch.

kernel/range.c

View file

This diff is incomplete. Download the complete patch.

kernel/relay.c

View file

This diff is incomplete. Download the complete patch.

kernel/resource.c

View file

This diff is incomplete. Download the complete patch.

kernel/smp.c

View file

This diff is incomplete. Download the complete patch.

kernel/sys.c

View file

This diff is incomplete. Download the complete patch.

kernel/user_namespace.c

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.debug

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.ubsan

View file

This diff is incomplete. Download the complete patch.

lib/Makefile

View file

This diff is incomplete. Download the complete patch.

lib/bitmap.c

View file

This diff is incomplete. Download the complete patch.

lib/crc32.c

View file

This diff is incomplete. Download the complete patch.

lib/decompress_bunzip2.c

View file

This diff is incomplete. Download the complete patch.

lib/dynamic_queue_limits.c

View file

This diff is incomplete. Download the complete patch.

lib/earlycpio.c

View file

This diff is incomplete. Download the complete patch.

lib/fault-inject-usercopy.c

View file

This diff is incomplete. Download the complete patch.

lib/find_bit.c

View file

This diff is incomplete. Download the complete patch.

lib/hexdump.c

View file

This diff is incomplete. Download the complete patch.

lib/idr.c

View file

This diff is incomplete. Download the complete patch.

lib/iov_iter.c

View file

This diff is incomplete. Download the complete patch.

lib/libcrc32c.c

View file

This diff is incomplete. Download the complete patch.

lib/math/rational.c

View file

This diff is incomplete. Download the complete patch.

lib/math/reciprocal_div.c

View file

This diff is incomplete. Download the complete patch.

lib/mpi/mpi-bit.c

View file

This diff is incomplete. Download the complete patch.

lib/percpu_counter.c

View file

This diff is incomplete. Download the complete patch.

lib/radix-tree.c

View file

This diff is incomplete. Download the complete patch.

lib/scatterlist.c

View file

This diff is incomplete. Download the complete patch.

lib/strncpy_from_user.c

View file

This diff is incomplete. Download the complete patch.

lib/syscall.c

View file

This diff is incomplete. Download the complete patch.

lib/test_hmm.c

View file

This diff is incomplete. Download the complete patch.

lib/test_sysctl.c

View file

This diff is incomplete. Download the complete patch.

lib/test_xarray.c

View file

This diff is incomplete. Download the complete patch.

lib/usercopy.c

View file

This diff is incomplete. Download the complete patch.

lib/xarray.c

View file

This diff is incomplete. Download the complete patch.

mm/Kconfig

View file

This diff is incomplete. Download the complete patch.

mm/compaction.c

View file

This diff is incomplete. Download the complete patch.

mm/debug_vm_pgtable.c

View file

This diff is incomplete. Download the complete patch.

mm/filemap.c

View file

This diff is incomplete. Download the complete patch.

mm/gup.c

View file

This diff is incomplete. Download the complete patch.

mm/highmem.c

View file

This diff is incomplete. Download the complete patch.

mm/huge_memory.c

View file

This diff is incomplete. Download the complete patch.

mm/hwpoison-inject.c

View file

This diff is incomplete. Download the complete patch.

mm/internal.h

View file

This diff is incomplete. Download the complete patch.

mm/khugepaged.c

View file

This diff is incomplete. Download the complete patch.

mm/madvise.c

View file

This diff is incomplete. Download the complete patch.

mm/memory-failure.c

View file

This diff is incomplete. Download the complete patch.

mm/memory.c

View file

This diff is incomplete. Download the complete patch.

mm/memory_hotplug.c

View file

This diff is incomplete. Download the complete patch.

mm/memremap.c

View file

This diff is incomplete. Download the complete patch.

mm/migrate.c

View file

This diff is incomplete. Download the complete patch.

mm/mmap.c

View file

This diff is incomplete. Download the complete patch.

mm/mmu_notifier.c

View file

This diff is incomplete. Download the complete patch.

mm/page-writeback.c

View file

This diff is incomplete. Download the complete patch.

mm/page_alloc.c

View file

This diff is incomplete. Download the complete patch.

mm/page_isolation.c

View file

This diff is incomplete. Download the complete patch.

mm/page_owner.c

View file

This diff is incomplete. Download the complete patch.

mm/page_poison.c

View file

This diff is incomplete. Download the complete patch.

mm/page_reporting.c

View file

This diff is incomplete. Download the complete patch.

mm/readahead.c

View file

This diff is incomplete. Download the complete patch.

mm/rmap.c

View file

This diff is incomplete. Download the complete patch.

mm/shmem.c

View file

This diff is incomplete. Download the complete patch.

mm/shuffle.c

View file

This diff is incomplete. Download the complete patch.

mm/slab.c

View file

This diff is incomplete. Download the complete patch.

mm/slab.h

View file

This diff is incomplete. Download the complete patch.

mm/slub.c

View file

This diff is incomplete. Download the complete patch.

mm/sparse.c

View file

This diff is incomplete. Download the complete patch.

mm/swap_state.c

View file

This diff is incomplete. Download the complete patch.

mm/truncate.c

View file

This diff is incomplete. Download the complete patch.

mm/util.c

View file

This diff is incomplete. Download the complete patch.

mm/vmscan.c

View file

This diff is incomplete. Download the complete patch.

mm/vmstat.c

View file

This diff is incomplete. Download the complete patch.

mm/workingset.c

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.ubsan

View file

This diff is incomplete. Download the complete patch.

scripts/checkpatch.pl

View file

This diff is incomplete. Download the complete patch.

scripts/const_structs.checkpatch

View file

This diff is incomplete. Download the complete patch.

scripts/gdb/linux/proc.py

View file

This diff is incomplete. Download the complete patch.

scripts/gdb/linux/tasks.py

View file

This diff is incomplete. Download the complete patch.

scripts/get_maintainer.pl

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/exec/.gitignore

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/exec/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/exec/load_address.c

View file

This diff is incomplete. Download the complete patch.