Code Monkey home page Code Monkey logo

Comments (12)

swine avatar swine commented on September 28, 2024 1

from kpatch.

liu-song-6 avatar liu-song-6 commented on September 28, 2024

config-6.2-rc2.txt

The config used in the test.

from kpatch.

joe-lawrence avatar joe-lawrence commented on September 28, 2024

Wow, riding the bleeding edge @liu-song-6 ... looking through some of the commits in v6.2, this one looks interesting:
torvalds/linux@bea75b3 ("x86/Kconfig: Introduce function padding") I wonder if that change explains this msg (also I notice readelf --wide --symbol reports "FUNC" values are now 0x10.

I think disassembly confirms it:

$ KCFLAGS="-ffunction-sections -fdata-sections" \
    make -j$(nproc) fs/proc/cmdline.o
...
$ objdump -Dr -j.text.cmdline_proc_show fs/proc/cmdline.o

fs/proc/cmdline.o:     file format elf64-x86-64


Disassembly of section .text.cmdline_proc_show:

0000000000000000 <cmdline_proc_show-0x10>:
   0:   90                      nop
   1:   90                      nop
   2:   90                      nop
   3:   90                      nop
   4:   90                      nop
   5:   90                      nop
   6:   90                      nop
   7:   90                      nop
   8:   90                      nop
   9:   90                      nop
   a:   90                      nop
   b:   90                      nop
   c:   90                      nop
   d:   90                      nop
   e:   90                      nop
   f:   90                      nop

0000000000000010 <cmdline_proc_show>:
  10:   f3 0f 1e fa             endbr64 
  14:   53                      push   %rbx
  15:   48 8b 35 00 00 00 00    mov    0x0(%rip),%rsi        # 1c <cmdline_proc_show+0xc>
                        18: R_X86_64_PC32       saved_command_line-0x4
  1c:   48 89 fb                mov    %rdi,%rbx
  1f:   e8 00 00 00 00          call   24 <cmdline_proc_show+0x14>
                        20: R_X86_64_PLT32      seq_puts-0x4
  24:   48 89 df                mov    %rbx,%rdi
  27:   be 0a 00 00 00          mov    $0xa,%esi
  2c:   e8 00 00 00 00          call   31 <cmdline_proc_show+0x21>
                        2d: R_X86_64_PLT32      seq_putc-0x4
  31:   31 c0                   xor    %eax,%eax
  33:   5b                      pop    %rbx
  34:   e9 00 00 00 00          jmp    39 <cmdline_proc_show+0x29>
                        35: R_X86_64_PLT32      __x86_return_thunk-0x4

from kpatch.

joe-lawrence avatar joe-lawrence commented on September 28, 2024

@liu-song-6 : I quickly hacked together: joe-lawrence@9c9426e this will at least build a few of the small patches... how about the one you are testing with?

from kpatch.

liu-song-6 avatar liu-song-6 commented on September 28, 2024
			if (sym->sym.st_value != 0 &&
			if (sym->sym.st_value != 0x10 &&

I think this breaks it on older kernels. And the error message in the line 244 needs update.

Somehow, I am getting sym->sym.st_value of 0 now, even with 6.2-rc2... I am not sure what was changed.

from kpatch.

joe-lawrence avatar joe-lawrence commented on September 28, 2024
			if (sym->sym.st_value != 0 &&
			if (sym->sym.st_value != 0x10 &&

I think this breaks it on older kernels. And the error message in the line 244 needs update.

Somehow, I am getting sym->sym.st_value of 0 now, even with 6.2-rc2... I am not sure what was changed.

Right it that commit was just hacked together for testing. A real fix would probably need to key off arch and kernel version and indicate to create-diff-object what the nop padding size should be (if any). You could probably make the condition check 0 or 0x10 offset if that moves you forward.

from kpatch.

liu-song-6 avatar liu-song-6 commented on September 28, 2024

I have got st_value == 0 for some functions, and st_value == 0x10 for some other functions. I guess we do need 0 for 0x10 here.

from kpatch.

joe-lawrence avatar joe-lawrence commented on September 28, 2024

Yeah, I notice that some/all? '.cold' functions don't get the padding, so there are definitely multiple offsets we'll need to handle.

from kpatch.

joe-lawrence avatar joe-lawrence commented on September 28, 2024

A second attempt: a3f3688 is more flexible in that it accounts for any amount of NOP padding on x86. That should retain backwards compat and keep the unit tests happy.

from kpatch.

liu-song-6 avatar liu-song-6 commented on September 28, 2024

I am getting

ERROR: multiple parent matches for raid10.o: drivers/md/built-in.a drivers/md/raid10.mod.

For a simple patch:

---
 drivers/md/raid10.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 3aa8b6e11d58..5c1e95892b93 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4298,6 +4298,9 @@ static void raid10_free(struct mddev *mddev, void *priv)
 {
        struct r10conf *conf = priv;

+       if (!conf)
+               return;
+
        mempool_exit(&conf->r10bio_pool);
        safe_put_page(conf->tmppage);
        kfree(conf->mirrors);
--
2.30.2

from kpatch.

joe-lawrence avatar joe-lawrence commented on September 28, 2024

I agree w/ @swine. I could repro the same ancestor problem as I was adding .config options, starting with the =m, then moving on to grabbing @liu-song-6 's entire attached config. Only after doing a make clean and make mrproper, the error went away.

from kpatch.

liu-song-6 avatar liu-song-6 commented on September 28, 2024

Yeah, the error went away after make clean. Sorry about the noise.

from kpatch.

Related Issues (20)

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.