Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIG CLOUD 9] rebase custom changes to 5.14.0-503.22.1.el9_5 #101

Conversation

PlaidCat
Copy link
Collaborator

@PlaidCat PlaidCat commented Feb 3, 2025

Update process (This kernel CentOS base for 5.14.0-503)

  • Kernel History Rebuild Process for all src.rpms hosted by RESF
  • Create sig-cloud-9/ 5.14.0-503.22.1.el9_5 branch
  • Check if any maintained code is included in the new el release.
  • Cherry-pick all code from previous branch into new branch (skipping unneeded code)
    • Fix conflicts as they arise
  • Build and Test

Removed Patches

  • None

BUILD

[maple@r9-sigcloud-builder kernel-src-tree]$ ../kernel-src-tree-tools/kernel_build.sh
/mnt/code/kernel-src-tree
no .config file found, moving on
[TIMER]{MRPROPER}: 0s
x86_64 architecture detected, copying config
'configs/kernel-x86_64-rhel.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5"
Making olddefconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
Starting Build
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h

[SNIP]

  BTF [M] sound/x86/snd-hdmi-lpe-audio.ko
  LD [M]  sound/xen/snd_xen_front.ko
  BTF [M] sound/xen/snd_xen_front.ko
[TIMER]{BUILD}: 1659s
Making Modules
  INSTALL /lib/modules/5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+/kernel/arch/x86/crypto/blake2s-x86_64.ko
  STRIP   /lib/modules/5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+/kernel/arch/x86/crypto/blake2s-x86_64.ko
  SIGN    /lib/modules/5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+/kernel/arch/x86/crypto/blake2s-x86_64.ko

[SNIP]

  SIGN    /lib/modules/5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+/kernel/sound/xen/snd_xen_front.ko
  DEPMOD  /lib/modules/5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+
[TIMER]{MODULES}: 44s
Making Install
sh ./arch/x86/boot/install.sh 5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+ \
	arch/x86/boot/bzImage System.map "/boot"
[TIMER]{INSTALL}: 22s
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+ and Index to 0
The default is /boot/loader/entries/5782692e02ef46cfa05ffa287f90171c-5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+.conf with index 0 and kernel /boot/vmlinuz-5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+
The default is /boot/loader/entries/5782692e02ef46cfa05ffa287f90171c-5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+.conf with index 0 and kernel /boot/vmlinuz-5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 0s
[TIMER]{BUILD}: 1659s
[TIMER]{MODULES}: 44s
[TIMER]{INSTALL}: 22s
[TIMER]{TOTAL} 1731s
Rebooting in 10 seconds
[maple@r9-sigcloud-builder kernel-src-tree]$ Connection to 192.168.122.155 closed by remote host.
Connection to 192.168.122.155 closed.

Testing

Well this is less than usual but the two seem to be trading what works and what doesn't.
And this is consistent ... we'll see if there is a difference after the build via mock for the SIG-CLOUD-9 as this might be related to the local make build.

kernel_5.14.0-503.22.1.el9_5.x86_64_iteration_* vs kernel_5.14.0-_jmaple__sig-cloud-9_5.14.0-503.22.1.el9_5+_iteration_*
5 ok 3 selftests: bpf: test_maps                vs 5 not ok 3 selftests: bpf: test_maps # exit=255
18 ok 16 selftests: bpf: test_kmod.sh           vs 18 not ok 16 selftests: bpf: test_kmod.sh # exit=1
23 ok 21 selftests: bpf: test_offload.py        vs 23 not ok 21 selftests: bpf: test_offload.py # exit=1
All Live Patches failed                         vs All Live Patches Succeeded
74 not ok 10 selftests: net: test_bpf.sh # exit=1.       vs 74 ok 10 selftests: net: test_bpf.sh
97 not ok 33 selftests: net: l2tp.sh # exit=1.           vs 97 ok 33 selftests: net: l2tp.sh
56 not ok 3 selftests: net/mptcp: mptcp_join.sh # exit=1 vs 256 ok 3 selftests: net/mptcp: mptcp_join.sh

Screenshot 2025-02-04 at 1 17 32 PM

@PlaidCat PlaidCat self-assigned this Feb 4, 2025
@PlaidCat PlaidCat marked this pull request as ready for review February 4, 2025 18:32
Copy link
Collaborator

@gvrose8192 gvrose8192 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor spelling nit - otherwise LGTM. Thanks!

jira SECO-170

In Rocky9 if you run ./run_vmtests.sh -t hmm it will fail and cause an
infinite loop on ASSERTs in FIXTURE_TEARDOWN()
This temporary fix is based on the discussion here
https://patchwork.kernel.org/project/linux-kselftest/patch/[email protected]/#25046055

We will investigate further kselftest updates that will resolve the root
causes of this.

Signed-off-by: Jonathan Maple <[email protected]>
jira SECO-170
bugfix cuda hangs
commit-author Thomas Gleixner <[email protected]>
commit ea72ce5
upstream-diff Missing CONFIG_KMSAN commits in
arch/x86/include/asm/pgtable_64_types.h

iounmap() on x86 occasionally fails to unmap because the provided valid
ioremap address is not below high_memory. It turned out that this
happens due to KASLR.

KASLR uses the full address space between PAGE_OFFSET and vaddr_end to
randomize the starting points of the direct map, vmalloc and vmemmap
regions.  It thereby limits the size of the direct map by using the
installed memory size plus an extra configurable margin for hot-plug
memory.  This limitation is done to gain more randomization space
because otherwise only the holes between the direct map, vmalloc,
vmemmap and vaddr_end would be usable for randomizing.

The limited direct map size is not exposed to the rest of the kernel, so
the memory hot-plug and resource management related code paths still
operate under the assumption that the available address space can be
determined with MAX_PHYSMEM_BITS.

request_free_mem_region() allocates from (1 << MAX_PHYSMEM_BITS) - 1
downwards.  That means the first allocation happens past the end of the
direct map and if unlucky this address is in the vmalloc space, which
causes high_memory to become greater than VMALLOC_START and consequently
causes iounmap() to fail for valid ioremap addresses.

MAX_PHYSMEM_BITS cannot be changed for that because the randomization
does not align with address bit boundaries and there are other places
which actually require to know the maximum number of address bits.  All
remaining usage sites of MAX_PHYSMEM_BITS have been analyzed and found
to be correct.

Cure this by exposing the end of the direct map via PHYSMEM_END and use
that for the memory hot-plug and resource management related places
instead of relying on MAX_PHYSMEM_BITS. In the KASLR case PHYSMEM_END
maps to a variable which is initialized by the KASLR initialization and
otherwise it is based on MAX_PHYSMEM_BITS as before.

To prevent future hickups add a check into add_pages() to catch callers
trying to add memory above PHYSMEM_END.

Fixes: 0483e1f ("x86/mm: Implement ASLR for kernel memory regions")
	Reported-by: Max Ramanouski <[email protected]>
	Reported-by: Alistair Popple <[email protected]>
	Signed-off-by: Thomas Gleixner <[email protected]>
Tested-By: Max Ramanouski <[email protected]>
	Tested-by: Alistair Popple <[email protected]>
	Reviewed-by: Dan Williams <[email protected]>
	Reviewed-by: Alistair Popple <[email protected]>
	Reviewed-by: Kees Cook <[email protected]>
	Cc: [email protected]
Link: https://lore.kernel.org/all/87ed6soy3z.ffs@tglx
(cherry picked from commit ea72ce5)
	Signed-off-by: Jonathan Maple <[email protected]>
Signed-off-by: Jonathan Maple <[email protected]>
@PlaidCat PlaidCat force-pushed the {jmaple}_sig-cloud-9/5.14.0-503.22.1.el9_5 branch from e5bec33 to 77cd727 Compare February 4, 2025 19:37
Copy link
Collaborator

@bmastbergen bmastbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@PlaidCat PlaidCat merged commit 77cd727 into sig-cloud-9/5.14.0-503.22.1.el9_5 Feb 4, 2025
4 checks passed
@PlaidCat PlaidCat deleted the {jmaple}_sig-cloud-9/5.14.0-503.22.1.el9_5 branch February 4, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants