Giter Site home page Giter Site logo

kernel-patches's Introduction

CachyOS logo

CachyOS

Custom Linux Kernel Patches for CachyOS

This repository contains custom patches for the Linux kernel that are being used in CachyOS Kernels. These patches may provide additional features, bug fixes, or performance enhancements that are not included in the upstream Linux kernel.

Contributions

If you have created a custom patch for the Linux kernel that you would like to contribute to this repository, please fork this repository and submit a pull request with your patch. Please be sure to include a brief description of the changes that your patch introduces.

kernel-patches's People

Contributors

1naim avatar lseman avatar michaeldeets avatar ptr1337 avatar sirlucjan avatar ventureoo avatar xeome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kernel-patches's Issues

Info gcc-lto patches

Hi,

I was wondering why gcc-lto patches are no longer present in version 6.4

Thank you for your work.

BBR2 patch fails

Hello.

Here's a strange error that I've been getting with the most recent https://github.com/CachyOS/kernel-patches/blob/master/6.1/0001-bbr2.patch

net/ipv4/tcp_bbr2.c:538:11: error: no member named 'skc_v6_daddr' in 'struct sock_common'; did you mean 'skc_daddr'?
                                 &sk->sk_v6_daddr, dport);
                                      ^
./include/net/sock.h:386:34: note: expanded from macro 'sk_v6_daddr'
#define sk_v6_daddr             __sk_common.skc_v6_daddr
                                            ^
./include/net/sock.h:167:11: note: 'skc_daddr' declared here
                        __be32  skc_daddr;
                                ^
1 error generated.
make[3]: *** [scripts/Makefile.build:250: net/ipv4/tcp_bbr2.o] Error 1
make[2]: *** [scripts/Makefile.build:500: net/ipv4] Error 2
make[1]: *** [scripts/Makefile.build:500: net] Error 2
make: *** [Makefile:1992: .] Error 2

Though, I was able to fix this by changing skc_v6_daddr in tcp_bbr2.c to sk_daddr

AMDGPU HDR patch causes issues, possibly involving my VRR display

I have a Radeon RX 6700-XT, and two monitors: An LG 24UD58-B, which is 3840x2160 panel that supports up to 60Hz and supports optional VRR range of 40-60Hz, and a Dell P2414H, a 1920x1080 panel that supports up to 60Hz and no VRR.

The issue presents regardless of whether I enable VRR support in the monitor, though. It causes, for example, kmscube to redraw at half the monitor's refresh rate. It also causes redrawing on Wayfire to operate at 30Hz, and almost immediately promote to 60Hz when I move windows to the secondary display.

Both monitors report max_bpc of 8 without the patch. The patch exposes a configuration option related to the Steam Deck, which shows a default choice of N, which I left as N each time I built during my unfortunate attempt at bisecting rc4 to rc5. Turns out I didn't even know I was hit by this patch, since the rc4 I experienced was with a fairly default Linux-TkG configuration, which doesn't include the HDR patch set.

Edit: Upon further reflection, I noted that it didn't break with kernel 6.6. I compared the HDR patch between the two, and noted that the 6.7 patch force enables VRR for page flipping. My compositor does not have support for VRR at all. This is probably bad for scenarios where VRR has been force enabled.

is there gcc-lto patch for 6.6 or latest?

i checked in cachyos repo have lto kernels but i didn't see any patch for lto in 6.6 or 6.8 and 6.9
is now cachyos lto kernel build by clang? or just patch is not public or is an error in cachyos's repo

build error on gcc-13 linux 6.6.20

  AR      net/rfkill/built-in.a
In file included from ./include/linux/list.h:9,
                 from ./include/linux/swait.h:5,
                 from ./include/linux/completion.h:12,
                 from ./include/linux/crypto.h:15,
                 from ./include/crypto/hash.h:12,
                 from net/ipv4/tcp.c:246:
net/ipv4/tcp.c: In function ‘tcp_get_info’:
net/ipv4/tcp.c:3792:47: error: implicit declaration of function ‘tcp_delack_max’ [-Werror=implicit-function-declaration]
 3792 |                                               tcp_delack_max(sk)));
      |                                               ^~~~~~~~~~~~~~
./include/linux/const.h:12:55: note: in definition of macro ‘__is_constexpr’
   12 |         (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
      |                                                       ^
./include/linux/minmax.h:85:25: note: in expansion of macro ‘__careful_cmp’
   85 | #define min(x, y)       __careful_cmp(min, x, y)
      |                         ^~~~~~~~~~~~~
net/ipv4/tcp.c:3791:43: note: in expansion of macro ‘min’
 3791 |         info->tcpi_ato = jiffies_to_usecs(min(icsk->icsk_ack.ato,
      |                                           ^~~
In file included from ./include/linux/atomic/atomic-instrumented.h:15,
                 from ./include/linux/atomic.h:82,
                 from ./include/crypto/hash.h:11:
./include/linux/build_bug.h:78:41: error: static assertion failed: "min(icsk->icsk_ack.ato, tcp_delack_max(sk)) signedness error, fix types or consider umin() before min_t()"
   78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
      |                                         ^~~~~~~~~~~~~~
./include/linux/build_bug.h:77:34: note: in expansion of macro ‘__static_assert’
   77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
      |                                  ^~~~~~~~~~~~~~~
./include/linux/minmax.h:51:9: note: in expansion of macro ‘static_assert’
   51 |         static_assert(__types_ok(x, y),                 \
      |         ^~~~~~~~~~~~~
./include/linux/minmax.h:58:17: note: in expansion of macro ‘__cmp_once’
   58 |                 __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
      |                 ^~~~~~~~~~
./include/linux/minmax.h:85:25: note: in expansion of macro ‘__careful_cmp’
   85 | #define min(x, y)       __careful_cmp(min, x, y)
      |                         ^~~~~~~~~~~~~
net/ipv4/tcp.c:3791:43: note: in expansion of macro ‘min’
 3791 |         info->tcpi_ato = jiffies_to_usecs(min(icsk->icsk_ack.ato,
      |                                           ^~~
  CC [M]  net/rose/rose_in.o
  CC [M]  net/netrom/nr_out.o
  CC [M]  net/tls/tls_device_fallback.o
  CC [M]  net/bluetooth/bnep/sock.o
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:243: net/ipv4/tcp.o] Error 1

problem compiling 6.6.20

Gentoo use here, try to compile 6.6.20 from genkernel patches + cachyos patches, it fails with:

In file included from ./include/linux/list.h:9,
                 from ./include/linux/swait.h:5,
                 from ./include/linux/completion.h:12,
                 from ./include/linux/crypto.h:15,
                 from ./include/crypto/hash.h:12,
                 from net/ipv4/tcp.c:246:
net/ipv4/tcp.c: In function 'tcp_get_info':
net/ipv4/tcp.c:3792:47: error: implicit declaration of function 'tcp_delack_max' [-Werror=implicit-function-declaration]
 3792 |                                               tcp_delack_max(sk)));
      |                                               ^~~~~~~~~~~~~~
./include/linux/const.h:12:55: note: in definition of macro '__is_constexpr'
   12 |         (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
      |                                                       ^
./include/linux/minmax.h:85:25: note: in expansion of macro '__careful_cmp'
   85 | #define min(x, y)       __careful_cmp(min, x, y)
      |                         ^~~~~~~~~~~~~
net/ipv4/tcp.c:3791:43: note: in expansion of macro 'min'
 3791 |         info->tcpi_ato = jiffies_to_usecs(min(icsk->icsk_ack.ato,
      |                                           ^~~
In file included from ./include/linux/atomic/atomic-instrumented.h:15,
                 from ./include/linux/atomic.h:82,
                 from ./include/crypto/hash.h:11:
./include/linux/build_bug.h:78:41: error: static assertion failed: "min(icsk->icsk_ack.ato, tcp_delack_max(sk)) signedness error, fix types or consider umin() before min_t()"
   78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
      |                                         ^~~~~~~~~~~~~~
./include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
   77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
      |                                  ^~~~~~~~~~~~~~~
./include/linux/minmax.h:51:9: note: in expansion of macro 'static_assert'
   51 |         static_assert(__types_ok(x, y),                 \
      |         ^~~~~~~~~~~~~
./include/linux/minmax.h:58:17: note: in expansion of macro '__cmp_once'
   58 |                 __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
      |                 ^~~~~~~~~~
./include/linux/minmax.h:85:25: note: in expansion of macro '__careful_cmp'
   85 | #define min(x, y)       __careful_cmp(min, x, y)
      |                         ^~~~~~~~~~~~~
net/ipv4/tcp.c:3791:43: note: in expansion of macro 'min'
 3791 |         info->tcpi_ato = jiffies_to_usecs(min(icsk->icsk_ack.ato,
      |                                           ^~~
  CC      lib/sg_pool.o
cc1: some warnings being treated as errors

I think this patch line is to blame:

https://github.com/CachyOS/kernel-patches/blob/c3f02a81e5f68c62958237e6cbc336f31dbd3c71/6.6/all/0001-cachyos-base-all.patch#L3865

Relavant code in tcp.c after patching:

        if (tp->rx_opt.tstamp_ok)
                info->tcpi_options |= TCPI_OPT_TIMESTAMPS;
        if (tcp_is_sack(tp))
                info->tcpi_options |= TCPI_OPT_SACK;
        if (tp->rx_opt.wscale_ok) {
                info->tcpi_options |= TCPI_OPT_WSCALE;
                info->tcpi_snd_wscale = tp->rx_opt.snd_wscale;
                info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale;
        }

        if (tp->ecn_flags & TCP_ECN_OK)
                info->tcpi_options |= TCPI_OPT_ECN;
        if (tp->ecn_flags & TCP_ECN_SEEN)
                info->tcpi_options |= TCPI_OPT_ECN_SEEN;
        if (tp->ecn_flags & TCP_ECN_LOW)
                info->tcpi_options |= TCPI_OPT_ECN_LOW;
        if (tp->syn_data_acked)
                info->tcpi_options |= TCPI_OPT_SYN_DATA;

        info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto);
        info->tcpi_ato = jiffies_to_usecs(min(icsk->icsk_ack.ato,
                                              tcp_delack_max(sk)));
        info->tcpi_snd_mss = tp->mss_cache;
        info->tcpi_rcv_mss = icsk->icsk_ack.rcv_mss;

        info->tcpi_unacked = tp->packets_out;
        info->tcpi_sacked = tp->sacked_out;

5.19.5 5.19.6 5.19.7 random freezes

Hello,

I am facing issues with mentioned versions of the patch which leads to the following.

rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { 13-... } 29636 jiffies s: 713 root: 0x1/.                                                                                                                                      
[  285.718017] rcu: blocking rcu_node structures (internal RCU debug): l=1:0-15:0x2000/.                                                                                                                                                                        
[  285.718019] Task dump for CPU 13:                                                                                                                                                                                                                            
[  285.718019] task:swapper/13      state:R  running task     stack:0     pid:0     ppid:1      flags:0x00004008                                                                                                                                                
[  285.718020] Call Trace:                                                                                                                                                                                                                                      
[  285.718021]  <TASK>                                                                                                                                                                                                                                          
[  285.718022]  ? cpuidle_enter_state+0xbe/0x280                                                                                                                                                                                                                
[  285.718024]  ? cpuidle_enter+0x24/0x40                                                                                                                                                                                                                       
[  285.718026]  ? do_idle+0x1e2/0x260                                                                                                                                                                                                                           
[  285.718027]  ? cpu_startup_entry+0x14/0x20                                                                                                                                                                                                                   
[  285.718028]  ? start_secondary+0x10f/0x130                                                                                                                                                                                                                   
[  285.718029]  ? secondary_startup_64_no_verify+0xe5/0xeb                                                                                                                                                                                                      
[  285.718031]  </TASK>                                                                                     

Latest version which works is 5.19.4

Optimization question

Hi, found this repo interesting, will this work with LLVM? Or it will be useless with already defined -march=whatever? Also I noticed that there was a discussion about PGO from your patches, does it still exist here?
Thanks

high-hz patch on kernel >= 6.6.x

I have tested the previous high-hz patch on kernel 6.6.1
There is an error about zcrypt_cex2c.c
Strangely that file in last kernel is empty.

I have removed the relevant section

`674a675,690

diff --git a/drivers/s390/crypto/zcrypt_cex2c.c b/drivers/s390/crypto/zcrypt_cex2c.c
index 251b5bd3d19c28..022cbae929a9d0 100644
--- a/drivers/s390/crypto/zcrypt_cex2c.c
+++ b/drivers/s390/crypto/zcrypt_cex2c.c
@@ -211,7 +211,11 @@ static int zcrypt_cex2c_rng_supported(struct ap_queue *aq)

  /* Wait for the test message to complete. */
  for (i = 0; i < 2 * HZ; i++) {

+#if HZ >= 1000

  •         msleep(1);
    

+#else
msleep(1000 / HZ);
+#endif
rc = ap_recv(aq->qid, &psmid, ap_msg.msg, ap_msg.bufsize);
if (rc == 0 && psmid == 0x0102030405060708UL)
break;
`

and now is applying fine. Kernel is booting without problems.
Not sure that some other modifications are necessary.

Do you plan to release an updated patch?

Problem compiling 6.9.4

I get the following error:

make[2]: *** [scripts/Makefile.modfinal:56: fs/nls/nls_ucs2_utils.ko] Error 139
make[2]: *** Deleting file 'fs/nls/nls_ucs2_utils.ko'
make[2]: *** Waiting for unfinished jobs....

with LTO turned on. Haven't tried LTO off yet.

LLVM 18 - linking vmlimuz.o failed

Using your latest patches in the latest stable (6.7.6) and 6.7.5 when using ld.lld as the linker. vmzlinux fails:

 LD      vmlinux.o
ld.lld: /var/tmp/portage/sys-devel/llvm-18.1.0_rc3/work/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:9845: SDValue llvm::SelectionDAG::getNode(unsigned int, const SDLoc &, SDVTList, ArrayRef<SDValue>, const SDNodeFlags): Assertion `Op.getOpcode() != ISD::DELETED_NODE && "Operand is DELETED_NODE!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: ld.lld -m elf_x86_64 -mllvm -import-instr-limit=5 -z noexecstack -r -o vmlinux.o -T .tmp_initcalls.lds --whole-archive vmlinux.a --no-whole-archive --start-group --end-group
1.	Running pass 'Function Pass Manager' on module 'ld-temp.o'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@ip6_rcv_core'
 #0 0x00007f0171a0a7f6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x480a7f6)
 #1 0x00007f0171a07c20 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x4807c20)
 #2 0x00007f0171a0b03e (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x480b03e)
 #3 0x00007f016cf60d30 (/usr/lib64/libc.so.6+0x3bd30)
 #4 0x00007f016cfb118c (/usr/lib64/libc.so.6+0x8c18c)
 #5 0x00007f016cf60c82 raise (/usr/lib64/libc.so.6+0x3bc82)
 #6 0x00007f016cf494ed abort (/usr/lib64/libc.so.6+0x244ed)
 #7 0x00007f016cf49415 (/usr/lib64/libc.so.6+0x24415)
 #8 0x00007f016cf595d2 (/usr/lib64/libc.so.6+0x345d2)
 #9 0x00007f01727dde7c llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc const&, llvm::SDVTList, llvm::ArrayRef<llvm::SDValue>, llvm::SDNodeFlags) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x55dde7c)
#10 0x00007f01728113c1 llvm::SelectionDAGISel::Select_INLINEASM(llvm::SDNode*) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x56113c1)
#11 0x00007f01762b3662 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x90b3662)
#12 0x00007f017280ad18 llvm::SelectionDAGISel::DoInstructionSelection() (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x560ad18)
#13 0x00007f01728093ab llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x56093ab)
#14 0x00007f0172805abf llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x5605abf)
#15 0x00007f0172801ce6 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x5601ce6)
#16 0x00007f01762a580e (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x90a580e)
#17 0x00007f01720511d9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x4e511d9)
#18 0x00007f0171c15b2b llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x4a15b2b)
#19 0x00007f0171c20652 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x4a20652)
#20 0x00007f0171c1683f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x4a1683f)
#21 0x00007f0173e35963 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x6c35963)
#22 0x00007f0173e3467c llvm::lto::backend(llvm::lto::Config const&, std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x6c3467c)
#23 0x00007f0173e23193 llvm::lto::LTO::runRegularLTO(std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x6c23193)
#24 0x00007f0173e21fd1 llvm::lto::LTO::run(std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::__1::function<llvm::Expected<std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>> (unsigned int, llvm::StringRef, llvm::Twine const&)>) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+libcxx+0x6c21fd1)
#25 0x00007f0177417b40 lld::elf::BitcodeCompiler::compile() (/usr/lib/llvm/18/bin/../lib64/liblldELF.so.18.1+libcxx+0x217b40)
#26 0x00007f017737410a lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/usr/lib/llvm/18/bin/../lib64/liblldELF.so.18.1+libcxx+0x17410a)
#27 0x00007f017735e2dd lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/usr/lib/llvm/18/bin/../lib64/liblldELF.so.18.1+libcxx+0x15e2dd)
#28 0x00007f017735c870 lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/usr/lib/llvm/18/bin/../lib64/liblldELF.so.18.1+libcxx+0x15c870)
#29 0x00007f0176fc53ee lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/usr/lib/llvm/18/bin/../lib64/liblldCommon.so.18.1+libcxx+0x133ee)
#30 0x000055734dd0b428 lld_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm/18/bin/ld.lld+0x4428)
#31 0x000055734dd0bd9e main (/usr/lib/llvm/18/bin/ld.lld+0x4d9e)
#32 0x00007f016cf4aeea (/usr/lib64/libc.so.6+0x25eea)
#33 0x00007f016cf4afa5 __libc_start_main (/usr/lib64/libc.so.6+0x25fa5)
#34 0x000055734dd0b1f1 _start (/usr/lib/llvm/18/bin/ld.lld+0x41f1)
make[2]: *** [scripts/Makefile.vmlinux_o:62: vmlinux.o] Error 134
make[1]: *** [/usr/src/linux-6.7.6-gentoo/Makefile:1293: vmlinux_o] Error 2
make: *** [Makefile:234: __sub-make] Error 2
Install Modules
  SYMLINK /lib/modules/6.7.6-gentoo-x86_64/build
  INSTALL /lib/modules/6.7.6-gentoo-x86_64/modules.order
make[2]: *** No rule to make target 'modules.builtin', needed by '/lib/modules/6.7.6-gentoo-x86_64/modules.builtin'.  Stop.
make[1]: *** [/usr/src/linux-6.7.6-gentoo/Makefile:1977: modules_install] Error 2
make: *** [Makefile:234: __sub-make] Error 2

If you need more info you also have this issue: llvm/llvm-project#82896

kernel 6.4 bcachefs patch is not working

I am compiling linux-cachyos-tt with bcachefs support enabled, however the patch don't seem to apply successfully. mm/slab.h.rej indicates that this hunk fails to apply:

@@ -684,6 +828,7 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s,
 					unsigned int orig_size)
 {
 	unsigned int zero_size = s->object_size;
+	struct slabobj_ext *obj_exts;
 	size_t i;

after searching the source code, this hunk seems to be missing one line:

bool kasan_init = init;

it probably should be like this:

@@ -684,6 +828,7 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s,
 					unsigned int orig_size)
 {
 	unsigned int zero_size = s->object_size;
+	struct slabobj_ext *obj_exts;
 	bool kasan_init = init;
 	size_t i;

NEST patch kernel traceback

Hello, is it normal behavior to have traceback spam on tty and dmesg with NEST patch?

   1   │ [  441.495221] Hardware name: Micro-Star International Co., Ltd. MS-7C37/MPG X570 GAMING PLUS (MS-7C37), BIOS A.H0 05/19/2022
   2   │ [  441.495221] Call Trace:
   3   │ [  441.495222]  <TASK>
   4   │ [  441.495223]  dump_stack_lvl+0x45/0x5e
   5   │ [  441.495225]  check_preemption_disabled+0xe0/0xf0
   6   │ [  441.495226]  wake_up_new_task+0x2b/0x2c0
   7   │ [  441.495227]  kernel_clone+0xd6/0x390
   8   │ [  441.495228]  ? fpregs_assert_state_consistent+0x1d/0x50
   9   │ [  441.495230]  ? exit_to_user_mode_prepare+0x3b/0x150
  10   │ [  441.495231]  __do_sys_clone+0x66/0x90
  11   │ [  441.495233]  do_syscall_64+0x5c/0x90
  12   │ [  441.495234]  ? fpregs_assert_state_consistent+0x1d/0x50
  13   │ [  441.495235]  ? exit_to_user_mode_prepare+0x3b/0x150
  14   │ [  441.495237]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
  15   │ [  441.495238] RIP: 0033:0x7f4a6b249e73
  16   │ [  441.495239] Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 41 89 c0 85 c0 75 2a 64 48 8b 04 25 10 00
  17   │ [  441.495239] RSP: 002b:00007ffd94119598 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
  18   │ [  441.495240] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f4a6b249e73
  19   │ [  441.495241] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
  20   │ [  441.495242] RBP: 00007ffd941196f0 R08: 0000000000000000 R09: 0000000000000030
  21   │ [  441.495243] R10: 00007f4a6b13ae50 R11: 0000000000000246 R12: 00000000ffffffff
  22   │ [  441.495244] R13: 00007ffd941197f0 R14: 000055bbd1baf936 R15: 0000000000000000
  23   │ [  441.495246]  </TASK>
  24   │ [  441.495340] BUG: using smp_processor_id() in preemptible [00000000] code: sh/29851
  25   │ [  441.495343] caller is wake_up_new_task+0x2b/0x2c0
  26   │ [  441.495345] CPU: 1 PID: 29851 Comm: sh Tainted: G           OE      6.0.0-gentoo #2

It's possible to have a CachyOS version macro

We have a building issue due to a change in function prototype of cpufreq_unregister_driver

Do you have or could you provide a macro like LINUX_VERSION_CODE is to test what CachyOS a kernel module is building with ?

Something like CACHYOS_VERSION

Regards

Authorship of patches

Hi,

I don't use CachyOS or its kernel and just stumbled upon these patchfiles by curiosity.

I would like to know whether you could keep the original authorship of the patches you use (ideally with the original commit messages), instead of concatenating them and signing off.

It is very hard to track where all this stuff comes from (and I do see some fragments of my own stuff).

Cheers

BcacheFS patch failed

I got that

Applying patch 0001-bcachefs.patch...
patching file Documentation/core-api/printk-formats.rst
patching file MAINTAINERS
patching file arch/powerpc/kernel/process.c
patching file arch/powerpc/kernel/security.c
patching file arch/powerpc/platforms/pseries/papr_scm.c
patching file arch/x86/kernel/cpu/resctrl/rdtgroup.c
patching file block/bio.c
patching file block/blk-core.c
patching file block/blk.h
patching file drivers/acpi/apei/erst-dbg.c
patching file drivers/block/loop.c
patching file drivers/clk/tegra/clk-bpmp.c
patching file drivers/input/joystick/analog.c
patching file drivers/md/bcache/Kconfig
patching file drivers/md/bcache/Makefile
patching file drivers/md/bcache/bcache.h
patching file drivers/md/bcache/super.c
patching file drivers/md/bcache/util.h
patching file drivers/pci/p2pdma.c
patching file fs/Kconfig
patching file fs/Makefile
patching file fs/bcachefs/Kconfig
patching file fs/bcachefs/Makefile
patching file fs/bcachefs/acl.c
patching file fs/bcachefs/acl.h
patching file fs/bcachefs/alloc_background.c
patching file fs/bcachefs/alloc_background.h
patching file fs/bcachefs/alloc_foreground.c
patching file fs/bcachefs/alloc_foreground.h
patching file fs/bcachefs/alloc_types.h
patching file fs/bcachefs/backpointers.c
patching file fs/bcachefs/backpointers.h
patching file fs/bcachefs/bbpos.h
patching file fs/bcachefs/bcachefs.h
patching file fs/bcachefs/bcachefs_format.h
patching file fs/bcachefs/bcachefs_ioctl.h
patching file fs/bcachefs/bkey.c
patching file fs/bcachefs/bkey.h
patching file fs/bcachefs/bkey_buf.h
patching file fs/bcachefs/bkey_cmp.h
patching file fs/bcachefs/bkey_methods.c
patching file fs/bcachefs/bkey_methods.h
patching file fs/bcachefs/bkey_sort.c
patching file fs/bcachefs/bkey_sort.h
patching file fs/bcachefs/bset.c
patching file fs/bcachefs/bset.h
patching file fs/bcachefs/btree_cache.c
patching file fs/bcachefs/btree_cache.h
patching file fs/bcachefs/btree_gc.c
patching file fs/bcachefs/btree_gc.h
patching file fs/bcachefs/btree_io.c
patching file fs/bcachefs/btree_io.h
patching file fs/bcachefs/btree_iter.c
patching file fs/bcachefs/btree_iter.h
patching file fs/bcachefs/btree_key_cache.c
patching file fs/bcachefs/btree_key_cache.h
patching file fs/bcachefs/btree_locking.c
patching file fs/bcachefs/btree_locking.h
patching file fs/bcachefs/btree_types.h
patching file fs/bcachefs/btree_update.h
patching file fs/bcachefs/btree_update_interior.c
patching file fs/bcachefs/btree_update_interior.h
patching file fs/bcachefs/btree_update_leaf.c
patching file fs/bcachefs/buckets.c
patching file fs/bcachefs/buckets.h
patching file fs/bcachefs/buckets_types.h
patching file fs/bcachefs/buckets_waiting_for_journal.c
patching file fs/bcachefs/buckets_waiting_for_journal.h
patching file fs/bcachefs/buckets_waiting_for_journal_types.h
patching file fs/bcachefs/chardev.c
patching file fs/bcachefs/chardev.h
patching file fs/bcachefs/checksum.c
patching file fs/bcachefs/checksum.h
patching file fs/bcachefs/clock.c
patching file fs/bcachefs/clock.h
patching file fs/bcachefs/clock_types.h
patching file fs/bcachefs/compress.c
patching file fs/bcachefs/compress.h
patching file fs/bcachefs/counters.c
patching file fs/bcachefs/counters.h
patching file fs/bcachefs/darray.h
patching file fs/bcachefs/data_update.c
patching file fs/bcachefs/data_update.h
patching file fs/bcachefs/debug.c
patching file fs/bcachefs/debug.h
patching file fs/bcachefs/dirent.c
patching file fs/bcachefs/dirent.h
patching file fs/bcachefs/disk_groups.c
patching file fs/bcachefs/disk_groups.h
patching file fs/bcachefs/ec.c
patching file fs/bcachefs/ec.h
patching file fs/bcachefs/ec_types.h
patching file fs/bcachefs/errcode.c
patching file fs/bcachefs/errcode.h
patching file fs/bcachefs/error.c
patching file fs/bcachefs/error.h
patching file fs/bcachefs/extent_update.c
patching file fs/bcachefs/extent_update.h
patching file fs/bcachefs/extents.c
patching file fs/bcachefs/extents.h
patching file fs/bcachefs/extents_types.h
patching file fs/bcachefs/eytzinger.h
patching file fs/bcachefs/fifo.h
patching file fs/bcachefs/fs-common.c
patching file fs/bcachefs/fs-common.h
patching file fs/bcachefs/fs-io.c
patching file fs/bcachefs/fs-io.h
patching file fs/bcachefs/fs-ioctl.c
patching file fs/bcachefs/fs-ioctl.h
patching file fs/bcachefs/fs.c
patching file fs/bcachefs/fs.h
patching file fs/bcachefs/fsck.c
patching file fs/bcachefs/fsck.h
patching file fs/bcachefs/inode.c
patching file fs/bcachefs/inode.h
patching file fs/bcachefs/io.c
patching file fs/bcachefs/io.h
patching file fs/bcachefs/io_types.h
patching file fs/bcachefs/journal.c
patching file fs/bcachefs/journal.h
patching file fs/bcachefs/journal_io.c
patching file fs/bcachefs/journal_io.h
patching file fs/bcachefs/journal_reclaim.c
patching file fs/bcachefs/journal_reclaim.h
patching file fs/bcachefs/journal_sb.c
patching file fs/bcachefs/journal_sb.h
patching file fs/bcachefs/journal_seq_blacklist.c
patching file fs/bcachefs/journal_seq_blacklist.h
patching file fs/bcachefs/journal_types.h
patching file fs/bcachefs/keylist.c
patching file fs/bcachefs/keylist.h
patching file fs/bcachefs/keylist_types.h
patching file fs/bcachefs/lru.c
patching file fs/bcachefs/lru.h
patching file fs/bcachefs/migrate.c
patching file fs/bcachefs/migrate.h
patching file fs/bcachefs/move.c
patching file fs/bcachefs/move.h
patching file fs/bcachefs/move_types.h
patching file fs/bcachefs/movinggc.c
patching file fs/bcachefs/movinggc.h
patching file fs/bcachefs/nocow_locking.c
patching file fs/bcachefs/nocow_locking.h
patching file fs/bcachefs/nocow_locking_types.h
patching file fs/bcachefs/opts.c
patching file fs/bcachefs/opts.h
patching file fs/bcachefs/quota.c
patching file fs/bcachefs/quota.h
patching file fs/bcachefs/quota_types.h
patching file fs/bcachefs/rebalance.c
patching file fs/bcachefs/rebalance.h
patching file fs/bcachefs/rebalance_types.h
patching file fs/bcachefs/recovery.c
patching file fs/bcachefs/recovery.h
patching file fs/bcachefs/reflink.c
patching file fs/bcachefs/reflink.h
patching file fs/bcachefs/replicas.c
patching file fs/bcachefs/replicas.h
patching file fs/bcachefs/replicas_types.h
patching file fs/bcachefs/siphash.c
patching file fs/bcachefs/siphash.h
patching file fs/bcachefs/str_hash.h
patching file fs/bcachefs/subvolume.c
patching file fs/bcachefs/subvolume.h
patching file fs/bcachefs/subvolume_types.h
patching file fs/bcachefs/super-io.c
patching file fs/bcachefs/super-io.h
patching file fs/bcachefs/super.c
patching file fs/bcachefs/super.h
patching file fs/bcachefs/super_types.h
patching file fs/bcachefs/sysfs.c
patching file fs/bcachefs/sysfs.h
patching file fs/bcachefs/tests.c
patching file fs/bcachefs/tests.h
patching file fs/bcachefs/trace.c
patching file fs/bcachefs/two_state_shared_lock.c
patching file fs/bcachefs/two_state_shared_lock.h
patching file fs/bcachefs/util.c
patching file fs/bcachefs/util.h
patching file fs/bcachefs/varint.c
patching file fs/bcachefs/varint.h
patching file fs/bcachefs/vstructs.h
patching file fs/bcachefs/xattr.c
patching file fs/bcachefs/xattr.h
patching file fs/d_path.c
patching file fs/dcache.c
patching file fs/inode.c
patching file include/linux/bio.h
patching file include/linux/blkdev.h
patching file include/linux/closure.h (renamed from drivers/md/bcache/closure.h)
patching file include/linux/compiler_attributes.h
patching file include/linux/dcache.h
patching file include/linux/exportfs.h
patching file include/linux/fs.h
patching file include/linux/generic-radix-tree.h
patching file include/linux/kernel.h
patching file include/linux/list_bl.h
patching file include/linux/lockdep.h
patching file include/linux/lockdep_types.h
patching file include/linux/mean_and_variance.h
patching file include/linux/pretty-printers.h
patching file include/linux/printbuf.h
patching file include/linux/sched.h
patching file include/linux/seq_buf.h
patching file include/linux/shrinker.h
patching file include/linux/six.h
patching file include/linux/string.h
patching file include/linux/string_helpers.h
patching file include/linux/trace_events.h
patching file include/linux/trace_seq.h
patching file include/linux/vmalloc.h
patching file include/trace/events/bcachefs.h
patching file init/init_task.c
patching file kernel/Kconfig.locks
patching file kernel/locking/Makefile
patching file kernel/locking/lockdep.c
patching file kernel/locking/six.c
patching file kernel/module/main.c
patching file kernel/stacktrace.c
patching file kernel/trace/trace.c
Hunk #1 succeeded at 1680 (offset 1 line).
Hunk #2 succeeded at 3753 (offset 1 line).
Hunk #3 FAILED at 6788.
Hunk #4 succeeded at 6829 (offset 14 lines).
Hunk #5 succeeded at 6855 (offset 14 lines).
Hunk #6 succeeded at 6873 (offset 14 lines).
Hunk #7 succeeded at 9916 (offset 16 lines).
1 out of 7 hunks FAILED -- saving rejects to file kernel/trace/trace.c.rej
patching file kernel/trace/trace_dynevent.c
patching file kernel/trace/trace_events_filter.c
patching file kernel/trace/trace_events_synth.c
patching file kernel/trace/trace_functions_graph.c
patching file kernel/trace/trace_kprobe.c
patching file kernel/trace/trace_seq.c
patching file lib/Kconfig
patching file lib/Kconfig.debug
patching file lib/Makefile
patching file lib/closure.c (renamed from drivers/md/bcache/closure.c)
patching file lib/errname.c
patching file lib/generic-radix-tree.c
patching file lib/hexdump.c
patching file lib/math/Kconfig
patching file lib/math/Makefile
patching file lib/math/mean_and_variance.c
patching file lib/math/mean_and_variance_test.c
patching file lib/pretty-printers.c
patching file lib/printbuf.c
patching file lib/seq_buf.c
patching file lib/string_helpers.c
patching file lib/test_hexdump.c
patching file lib/test_printf.c
patching file lib/vsprintf.c
patching file mm/Makefile
patching file mm/filemap.c
Hunk #1 succeeded at 2923 (offset 4 lines).
patching file mm/memcontrol.c
patching file mm/nommu.c
patching file mm/oom_kill.c
patching file mm/show_mem.c (renamed from lib/show_mem.c)
patching file mm/slab.h
patching file mm/slab_common.c
patching file mm/vmalloc.c
patching file mm/vmscan.c
patching file tools/testing/nvdimm/test/ndtest.c
==> 错误: 在 prepare() 中发生一个错误。
    正在放弃...

with kernel source version 6.1.4

A patch is needed when compiling with LTO on AMD systems

See ClangBuiltLinux/linux#1987 and llvm/llvm-project#72026. This patch should fix the issue:

diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index d283c59df4c1..3840ded8c34a 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -3,6 +3,13 @@
 # Makefile for the Linux TCP/IP (INET6) layer.
 #
 
+# temporary workaround for clang/lld-18 with -march/-mtune=znver2
+# clangbuiltlinux issue 1987
+ifeq ($(call test-ge, $(CONFIG_CLANG_VERSION), 180000),y)
+badparms = -march=znver2 -mtune=znver2
+KBUILD_CFLAGS :=	$(filter-out $(badparams), $(KBUILD_CFLAGS))
+endif
+
 obj-$(CONFIG_IPV6) += ipv6.o
 
 ipv6-y :=	af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o \

GCC-LTO patches for 6.5

Since 6.3 there haven't been updates to the gcc-lto patches, and applying these patches on later versions cause multiple rejected changes.

I have attempted to circumvent these rejects, and have been using a "gcc-lto" enabled kernel even on 6.5. I can't say that my adjustments are issue-free, but they apply and compile, which result in a slightly larger kernel image.

Would it be worth submitting a PR for these patches, so they can be tested properly?

They currently conflict with 0001-rt.patch, but it's an extremely simple adjustment. I have two sets, one that I've been using personally with RT patches, and one that I recently created without RT patches applied.

Again, I cannot say for certain that it is working as intended from the original patchset, and I do not want to waste people's time testing/validating something I'm not certain on.

(old, edited the old patches directly, for RT)
https://github.com/MichaelDeets/kernel-patches/tree/gcc-lto-rt/6.5/misc/gcc-lto-rt

(recently done, patches remade, no RT)
https://github.com/MichaelDeets/kernel-patches/tree/gcc-lto/6.5/misc/gcc-lto

Weird blank screen after resume bug on 6.4.1

So, I just updated to 6.4.1 recently, and there's an annoying bug: whenever I resume from suspend, the screen is blank and I couldn't do anything but SysRq reboot my machine. I'm sure it's not an X or GDM problem as I couldn't get a TTY either. (My graphics card is NVIDIA and I'm using the proprietary drivers, but since I can't get a TTY either I think there's nothing to do with the drivers.)

Not sure what's causing the problem, but the stock Arch linux v6.4.1 kernel works alright for me.

problem compiling 6.9.0

compile kernel 6.9.0 using clang 17.0.6 and make LLVM=1 LLVM_IAS=1 failed.
The error output is

In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from ./include/linux/crypto.h:15:
In file included from ./include/linux/completion.h:12:
In file included from ./include/linux/swait.h:7:
In file included from ./include/linux/spinlock.h:60:
In file included from ./include/linux/thread_info.h:60:
In file included from ./arch/x86/include/asm/thread_info.h:59:
In file included from ./arch/x86/include/asm/cpufeature.h:5:
./arch/x86/include/asm/processor.h:690:51: error: non-void function does not return a value [-Werror,-Wreturn-type]
  690 | static inline int amd_get_this_core_type(void)          { }
      |                                                           ^
1 error generated.
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[1]: *** [/usr/src/linux-6.9.0-cachyos/Makefile:1199: prepare0] Error 2
make: *** [Makefile:240: __sub-make] Error 2

and I think related code could be

+static inline int amd_get_this_core_type(void) { }

6.0.0 stable won't boot at all with cachyos patchset

Hello,

Facing same issue as before (on 5.15 were kernel not boot at all with cachyos patch).

Cannot collect any logs, as it stuck on grub bootloader (loading kernel, loading initramfs) and only hard reset is option.
PS: Using latest cachyos patch (updated 8 hours ago)

Regards,
Rosen Aleksandrov

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.