History

Merge tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc updates from Andrew Morton: "Updates to various subsystems which I help look after. lib, ocfs2, fatfs, autofs, squashfs, procfs, etc. A relatively small amount of material this time" * tag 'mm-nonmm-stable-2022-08-06-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits) scripts/gdb: ensure the absolute path is generated on initial source MAINTAINERS: kunit: add David Gow as a maintainer of KUnit mailmap: add linux.dev alias for Brendan Higgins mailmap: update Kirill's email profile: setup_profiling_timer() is moslty not implemented ocfs2: fix a typo in a comment ocfs2: use the bitmap API to simplify code ocfs2: remove some useless functions lib/mpi: fix typo 'the the' in comment proc: add some (hopefully) insightful comments bdi: remove enum wb_congested_state kernel/hung_task: fix address space of proc_dohung_task_timeout_secs lib/lzo/lzo1x_compress.c: replace ternary operator with min() and min_t() squashfs: support reading fragments in readahead call squashfs: implement readahead squashfs: always build "file direct" version of page actor Revert "squashfs: provide backing_dev_info in order to disable read-ahead" fs/ocfs2: Fix spelling typo in comment ia64: old_rr4 added under CONFIG_HUGETLB_PAGE proc: fix test for "vsyscall=xonly" boot option ...

Linus Torvalds committed 4 years ago

Commit eb5699b2 parents b5a8466 b996955102 files · +1313 −724Browse files

Showing the changes to kernel (6 of 102 files). Show all

Unified · Split

6 files
  1. kernel/crash_core.c +26 −2
  2. kernel/hung_task.c +1 −1
  3. kernel/kallsyms.c +1 −22
  4. kernel/kallsyms_internal.h +30 −0
  5. kernel/kexec_file.c +7 −3
  6. kernel/profile.c +13 −2
kernel/crash_core.c+26−2
@@ -9,12 +9,15 @@ · 8 unmodified lines
9#include <linux/init.h>9#include <linux/init.h>
10#include <linux/utsname.h>10#include <linux/utsname.h>
11#include <linux/vmalloc.h>11#include <linux/vmalloc.h>
12#include <linux/sizes.h>
12 13
13#include <asm/page.h>14#include <asm/page.h>
14#include <asm/sections.h>15#include <asm/sections.h>
15 16
16#include <crypto/sha1.h>17#include <crypto/sha1.h>
17 18
19#include "kallsyms_internal.h"
20
18/* vmcoreinfo stuff */21/* vmcoreinfo stuff */
19unsigned char *vmcoreinfo_data;22unsigned char *vmcoreinfo_data;
20size_t vmcoreinfo_size;23size_t vmcoreinfo_size;
@@ -43,6 +46,15 @@ static int __init parse_crashkernel_mem(char *cmdline, · 22 unmodified lines
43 unsigned long long *crash_base)46 unsigned long long *crash_base)
44{47{
45 char *cur = cmdline, *tmp;48 char *cur = cmdline, *tmp;
49 unsigned long long total_mem = system_ram;
50
51 /*
52 * Firmware sometimes reserves some memory regions for its own use,
53 * so the system memory size is less than the actual physical memory
54 * size. Work around this by rounding up the total size to 128M,
55 * which is enough for most test cases.
56 */
57 total_mem = roundup(total_mem, SZ_128M);
46 58
47 /* for each entry of the comma-separated list */59 /* for each entry of the comma-separated list */
48 do {60 do {
@@ -87,13 +99,13 @@ static int __init parse_crashkernel_mem(char *cmdline, · 38 unmodified lines
87 return -EINVAL;99 return -EINVAL;
88 }100 }
89 cur = tmp;101 cur = tmp;
90 if (size >= system_ram) {102 if (size >= total_mem) {
91 pr_warn("crashkernel: invalid size\n");103 pr_warn("crashkernel: invalid size\n");
92 return -EINVAL;104 return -EINVAL;
93 }105 }
94 106
95 /* match ? */107 /* match ? */
96 if (system_ram >= start && system_ram < end) {108 if (total_mem >= start && total_mem < end) {
97 *crash_size = size;109 *crash_size = size;
98 break;110 break;
99 }111 }
@@ -480,6 +492,18 @@ static int __init crash_save_vmcoreinfo_init(void) · 380 unmodified lines
480 VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE);492 VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE);
481#endif493#endif
482 494
495#ifdef CONFIG_KALLSYMS
496 VMCOREINFO_SYMBOL(kallsyms_names);
497 VMCOREINFO_SYMBOL(kallsyms_token_table);
498 VMCOREINFO_SYMBOL(kallsyms_token_index);
499#ifdef CONFIG_KALLSYMS_BASE_RELATIVE
500 VMCOREINFO_SYMBOL(kallsyms_offsets);
501 VMCOREINFO_SYMBOL(kallsyms_relative_base);
502#else
503 VMCOREINFO_SYMBOL(kallsyms_addresses);
504#endif /* CONFIG_KALLSYMS_BASE_RELATIVE */
505#endif /* CONFIG_KALLSYMS */
506
483 arch_crash_save_vmcoreinfo();507 arch_crash_save_vmcoreinfo();
484 update_vmcoreinfo_note();508 update_vmcoreinfo_note();
485 509
kernel/hung_task.c+1−1
@@ -229,7 +229,7 @@ static long hung_timeout_jiffies(unsigned long last_checked, · 228 unmodified lines
229 * Process updating of timeout sysctl229 * Process updating of timeout sysctl
230 */230 */
231static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,231static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
232 void __user *buffer,232 void *buffer,
233 size_t *lenp, loff_t *ppos)233 size_t *lenp, loff_t *ppos)
234{234{
235 int ret;235 int ret;
kernel/kallsyms.c+1−22
@@ -32,28 +32,7 @@ · 31 unmodified lines
32#include <linux/bsearch.h>32#include <linux/bsearch.h>
33#include <linux/btf_ids.h>33#include <linux/btf_ids.h>
34 34
35/*35#include "kallsyms_internal.h"
36 * These will be re-linked against their real values
37 * during the second link stage.
38 */
39extern const unsigned long kallsyms_addresses[] __weak;
40extern const int kallsyms_offsets[] __weak;
41extern const u8 kallsyms_names[] __weak;
42
43/*
44 * Tell the compiler that the count isn't in the small data section if the arch
45 * has one (eg: FRV).
46 */
47extern const unsigned int kallsyms_num_syms
48__section(".rodata") __attribute__((weak));
49
50extern const unsigned long kallsyms_relative_base
51__section(".rodata") __attribute__((weak));
52
53extern const char kallsyms_token_table[] __weak;
54extern const u16 kallsyms_token_index[] __weak;
55
56extern const unsigned int kallsyms_markers[] __weak;
57 36
58/*37/*
59 * Expand a compressed symbol data into the resulting uncompressed string,38 * Expand a compressed symbol data into the resulting uncompressed string,
kernel/kallsyms_internal.h+30−0
@@ -0,0 +1,30 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2#ifndef LINUX_KALLSYMS_INTERNAL_H_
3#define LINUX_KALLSYMS_INTERNAL_H_
4
5#include <linux/types.h>
6
7/*
8 * These will be re-linked against their real values
9 * during the second link stage.
10 */
11extern const unsigned long kallsyms_addresses[] __weak;
12extern const int kallsyms_offsets[] __weak;
13extern const u8 kallsyms_names[] __weak;
14
15/*
16 * Tell the compiler that the count isn't in the small data section if the arch
17 * has one (eg: FRV).
18 */
19extern const unsigned int kallsyms_num_syms
20__section(".rodata") __attribute__((weak));
21
22extern const unsigned long kallsyms_relative_base
23__section(".rodata") __attribute__((weak));
24
25extern const char kallsyms_token_table[] __weak;
26extern const u16 kallsyms_token_index[] __weak;
27
28extern const unsigned int kallsyms_markers[] __weak;
29
30#endif // LINUX_KALLSYMS_INTERNAL_H_
kernel/kexec_file.c+7−3
@@ -40,6 +40,9 @@ void set_kexec_sig_enforced(void) · 39 unmodified lines
40 40
41static int kexec_calculate_store_digests(struct kimage *image);41static int kexec_calculate_store_digests(struct kimage *image);
42 42
43/* Maximum size in bytes for kernel/initrd files. */
44#define KEXEC_FILE_SIZE_MAX min_t(s64, 4LL << 30, SSIZE_MAX)
45
43/*46/*
44 * Currently this is the only default function that is exported as some47 * Currently this is the only default function that is exported as some
45 * architectures need it to do additional handlings.48 * architectures need it to do additional handlings.
@@ -190,11 +193,12 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, · 144 unmodified lines
190 const char __user *cmdline_ptr,193 const char __user *cmdline_ptr,
191 unsigned long cmdline_len, unsigned flags)194 unsigned long cmdline_len, unsigned flags)
192{195{
193 int ret;196 ssize_t ret;
194 void *ldata;197 void *ldata;
195 198
196 ret = kernel_read_file_from_fd(kernel_fd, 0, &image->kernel_buf,199 ret = kernel_read_file_from_fd(kernel_fd, 0, &image->kernel_buf,
197 INT_MAX, NULL, READING_KEXEC_IMAGE);200 KEXEC_FILE_SIZE_MAX, NULL,
201 READING_KEXEC_IMAGE);
198 if (ret < 0)202 if (ret < 0)
199 return ret;203 return ret;
200 image->kernel_buf_len = ret;204 image->kernel_buf_len = ret;
@@ -214,7 +218,7 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd, · 13 unmodified lines
214 /* It is possible that there no initramfs is being loaded */218 /* It is possible that there no initramfs is being loaded */
215 if (!(flags & KEXEC_FILE_NO_INITRAMFS)) {219 if (!(flags & KEXEC_FILE_NO_INITRAMFS)) {
216 ret = kernel_read_file_from_fd(initrd_fd, 0, &image->initrd_buf,220 ret = kernel_read_file_from_fd(initrd_fd, 0, &image->initrd_buf,
217 INT_MAX, NULL,221 KEXEC_FILE_SIZE_MAX, NULL,
218 READING_KEXEC_INITRAMFS);222 READING_KEXEC_INITRAMFS);
219 if (ret < 0)223 if (ret < 0)
220 goto out;224 goto out;
kernel/profile.c+13−2
@@ -109,6 +109,13 @@ int __ref profile_init(void) · 108 unmodified lines
109 109
110 /* only text is profiled */110 /* only text is profiled */
111 prof_len = (_etext - _stext) >> prof_shift;111 prof_len = (_etext - _stext) >> prof_shift;
112
113 if (!prof_len) {
114 pr_warn("profiling shift: %u too large\n", prof_shift);
115 prof_on = 0;
116 return -EINVAL;
117 }
118
112 buffer_bytes = prof_len*sizeof(atomic_t);119 buffer_bytes = prof_len*sizeof(atomic_t);
113 120
114 if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL))121 if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL))
@@ -418,6 +425,12 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos) · 303 unmodified lines
418 return read;425 return read;
419}426}
420 427
428/* default is to not implement this call */
429int __weak setup_profiling_timer(unsigned mult)
430{
431 return -EINVAL;
432}
433
421/*434/*
422 * Writing to /proc/profile resets the counters435 * Writing to /proc/profile resets the counters
423 *436 *
@@ -428,8 +441,6 @@ static ssize_t write_profile(struct file *file, const char __user *buf, · 4 unmodified lines
428 size_t count, loff_t *ppos)441 size_t count, loff_t *ppos)
429{442{
430#ifdef CONFIG_SMP443#ifdef CONFIG_SMP
431 extern int setup_profiling_timer(unsigned int multiplier);
432
433 if (count == sizeof(int)) {444 if (count == sizeof(int)) {
434 unsigned int multiplier;445 unsigned int multiplier;
435 446