Skip to content

Update kernel-module support to v6.8

Merge Request Required Information

Summary of Changes

RHIVOS is running into early mm init performance issues, and a long-term set of solutions is to improve the kernel linear map when kernel security is set to a max-level, a RHIVOS FuSa requirement, where all of memory is -not- read/writeable via the linear map (all of memory mapping from PAGE_OFFSET), but has strict execute-only, rodata, rw-data and no-execute pages. Although RHEL9 and upstream can support the latter functionally, it is a significant performance issue as page-level mapping of the kernel linear map has to be employed from the default huge-page mappings that the various arch's support. The boot kernel itself is relatively easy to know how to map for optimal page-mappings and protection, because it is the first to load and ELF sections can be scanned for needed info; the same can't be said for all the loadable kernel modules, which is the impetus for page-splitting of the linear map (on x86) and the per-page-mapping on ARM64, where page-splitting of the linear map is not supported, but is the long-term optimal solution. In order to make a step in this long-term effort, this patch series attempts to take the existing RHEL9 kernel module load support, which is barely 12 patches past the initial v5.14 base, and bring it up to a current, v6.8 version. Of course, such an update brings a lot of other needed backports to apply cleanly, if the goal is to get close to upstream, maintain RHEL kmod support, and not regress. Thus, this series results with major updates to dynamic-debug (since it involves modifying kernel module sections), kbuild, modpost, genksyms, and sprinkle an odd livepatch, fpatch, and BPF patch, although the latter were trimmed or dropped wherever possible.
The split is approximately 150 kernel-module, 30 dyndbg, 80 modpost, 15 kbuild, 3 livepatch, 3 ftrace, 2 bpf (one being a fix for earlier kernel commit). Note: modpost and related kbuild updates moved it to approximately v6.4. A full update to 6.8 wasn't deemed necessary, and was an additional 30+ commits, and more kbuild modifications. This effort was deemed sufficiently large and complete for the intended goal of making RHEL9 amenable to future updates to the kernel-module subsystem for posted patches on review now in linux-mm by Mike Rapaport. Those patches and expected follow-ons, will be backported to RHEL-9 when upstream settles on final updates in this area; these updates will make the kernel-load subsystem more common, and less arch-specific. One patch from v6.9-rc1 was taken, modules: wait do_free_init correctly, to repair a race seen in the module-load path on a RHIVOS platform, which needed to sit on top of this series for ease of backporting.

v1: Draft! This series has gone through some simple, preliminary testing, but it needs deep review by ftrace, BPF, livepatch, and rh-kabi support to ensure no regressions in these few, but corner kernel-modifying code paths. rh-kabi tooling is a bit unknown, as it isn't in the kernel, but there are RHEL-only patches in the kernel for it.
A patchreview run against the series was exed'd, and needed Fixes were added/included. The list of self-documented omissions is listed below. If new ones have popped in v6.9-rc, please forward them for addition. Bisectability: The series is has known bisectability (patch-ordering) issues at the moment, but plan to re-shuffle the patches in v2 to improve if not make it completely bisectable. Expected feedback will be incorporated in v2, and planned upgrade to full-MR/drop-Draft status.

Shut-out to Joe Lawrence who aided in debugging and providing fixes for well-hidden noarch build faiures around Documentation generation, as well as warning cleanups for EXPORT'd init-tagged functions, which the update checks for now. Joe was instrumental in finding key chunks of the modpost update that appears to have closed gaps in my original backport efforts.

Intentionally Omitted Fix: 0aa24a79ee3b603f kbuild: do not try to parse *.cmd files for objects provided by compiler -- for parisc & sky arch's, not needed in RHEL9

Intentionally Omitted Fix: f5983dab0ead modpost: define more R_ARM_* for old distributions For old releases not having R_ARM_* in arch/arm/include/asm/elf.h, which RHEL9 has

Intentionally Omitted Fix: 08700ec705043e linux/export: fix reference to exported functions for parisc64 -- no parisc64 support in RHEL9

Intentionally Omitted Fix: 86495af1171e1feec79f media: dvb: symbol fixup for dvb_attach() -- not included in this backport due to partner request not to include until RHEL-10

Intentionally Omitted Fix: d81f0d7b8 Subject: kunit: add KUNIT_INIT_TABLE to init link -- will let KUNIT update bring in and enable as needed

Approved Development Ticket

JIRA: https://issues.redhat.com/browse/RHEL-28063

Signed-off-by: Donald Dutile ddutile@redhat.com

Edited by Jarod Wilson

Merge request reports