Skip to content

Commit c538944

Browse files
committed
Merge tag 'modules-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
Pull modules updates from Luis Chamberlain: "Nothing exciting at all for modules for v6.3. The biggest change is just the change of INSTALL_MOD_DIR from "extra" to "updates" which I found lingered for ages for no good reason while testing the CXL mock driver [0]. The CXL mock driver has no kconfig integration and requires building an external module... and re-building the *rest* of the production drivers. This mock driver when loaded but not the production ones will crash. All this can obviously be fixed by integrating kconfig semantics into such test module, however that's not desirable by the maintainer, and so sensible defaults must be used to ensure a default "make modules_install" will suffice for most distros which do not have a file like /etc/depmod.d/dist.conf with something like `search updates extra built-in`. Since most distros rely on kmod and since its inception the "updates" directory is always in the search path it makes more sense to use that than the "extra" which only *some* RH based systems rely on. All this stuff has been on linux-next for a while" [0] https://lkml.kernel.org/r/20221209062919.1096779-1-mcgrof@kernel.org * tag 'modules-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: Documentation: livepatch: module-elf-format: Remove local klp_modinfo definition module.h: Document klp_modinfo struct using kdoc module: Use kstrtobool() instead of strtobool() kernel/params.c: Use kstrtobool() instead of strtobool() test_kmod: stop kernel-doc warnings kbuild: Modify default INSTALL_MOD_DIR from extra to updates
2 parents 7dd86cf + f412eef commit c538944

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

Documentation/livepatch/module-elf-format.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,5 @@ A livepatch module's symbol table is accessible through module->symtab.
298298
Since apply_relocate_add() requires access to a module's section headers,
299299
symbol table, and relocation section indices, Elf information is preserved for
300300
livepatch modules and is made accessible by the module loader through
301-
module->klp_info, which is a klp_modinfo struct. When a livepatch module loads,
302-
this struct is filled in by the module loader. Its fields are documented below::
303-
304-
struct klp_modinfo {
305-
Elf_Ehdr hdr; /* Elf header */
306-
Elf_Shdr *sechdrs; /* Section header table */
307-
char *secstrings; /* String table for the section headers */
308-
unsigned int symndx; /* The symbol table section index */
309-
};
301+
module->klp_info, which is a :c:type:`klp_modinfo` struct. When a livepatch module
302+
loads, this struct is filled in by the module loader.

include/linux/module.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,14 @@ struct mod_kallsyms {
352352
};
353353

354354
#ifdef CONFIG_LIVEPATCH
355+
/**
356+
* struct klp_modinfo - Elf information preserved from the livepatch module
357+
*
358+
* @hdr: Elf header
359+
* @sechdrs: Section header table
360+
* @secstrings: String table for the section headers
361+
* @symndx: The symbol table section index
362+
*/
355363
struct klp_modinfo {
356364
Elf_Ehdr hdr;
357365
Elf_Shdr *sechdrs;

kernel/module/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/fs.h>
1818
#include <linux/kernel.h>
1919
#include <linux/kernel_read_file.h>
20+
#include <linux/kstrtox.h>
2021
#include <linux/slab.h>
2122
#include <linux/vmalloc.h>
2223
#include <linux/elf.h>
@@ -2675,7 +2676,7 @@ static int unknown_module_param_cb(char *param, char *val, const char *modname,
26752676
int ret;
26762677

26772678
if (strcmp(param, "async_probe") == 0) {
2678-
if (strtobool(val, &mod->async_probe_requested))
2679+
if (kstrtobool(val, &mod->async_probe_requested))
26792680
mod->async_probe_requested = true;
26802681
return 0;
26812682
}

kernel/params.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
*/
66
#include <linux/kernel.h>
7+
#include <linux/kstrtox.h>
78
#include <linux/string.h>
89
#include <linux/errno.h>
910
#include <linux/module.h>
@@ -310,7 +311,7 @@ int param_set_bool(const char *val, const struct kernel_param *kp)
310311
if (!val) val = "1";
311312

312313
/* One of =[yYnN01] */
313-
return strtobool(val, kp->arg);
314+
return kstrtobool(val, kp->arg);
314315
}
315316
EXPORT_SYMBOL(param_set_bool);
316317

lib/test_kmod.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ static int num_test_devs;
5151

5252
/**
5353
* enum kmod_test_case - linker table test case
54-
*
55-
* If you add a test case, please be sure to review if you need to se
56-
* @need_mod_put for your tests case.
57-
*
5854
* @TEST_KMOD_DRIVER: stress tests request_module()
5955
* @TEST_KMOD_FS_TYPE: stress tests get_fs_type()
56+
*
57+
* If you add a test case, please be sure to review if you need to set
58+
* @need_mod_put for your tests case.
6059
*/
6160
enum kmod_test_case {
6261
__TEST_KMOD_INVALID = 0,
@@ -78,7 +77,7 @@ struct test_config {
7877
struct kmod_test_device;
7978

8079
/**
81-
* kmod_test_device_info - thread info
80+
* struct kmod_test_device_info - thread info
8281
*
8382
* @ret_sync: return value if request_module() is used, sync request for
8483
* @TEST_KMOD_DRIVER
@@ -101,7 +100,7 @@ struct kmod_test_device_info {
101100
};
102101

103102
/**
104-
* kmod_test_device - test device to help test kmod
103+
* struct kmod_test_device - test device to help test kmod
105104
*
106105
* @dev_idx: unique ID for test device
107106
* @config: configuration for the test

scripts/Makefile.modinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ modules := $(call read-file, $(MODORDER))
1414
ifeq ($(KBUILD_EXTMOD),)
1515
dst := $(MODLIB)/kernel
1616
else
17-
INSTALL_MOD_DIR ?= extra
17+
INSTALL_MOD_DIR ?= updates
1818
dst := $(MODLIB)/$(INSTALL_MOD_DIR)
1919
endif
2020

0 commit comments

Comments
 (0)