dynup/kpatch

linux 6.9.0-rc6 can't find special struct paravirt_patch_site size

wardenjohn opened this issue · 6 comments

I use kernel 6.9.0-rc6-next-20240430-dirty and try to build livepatch ko.
When kpatch-build start to read special section data, an error raised : "can't find special struct paravirt_patch_site size."
It seem that the vmlinux dont contain paravirt_patch_site.
I read the vmlinux, and only found paravirt_patch_template, no paravirt_patch_site found.
Anything wrong with the kernel or kpatch-build?

Hi @wardenjohn : thanks for the reminder, this is a dup of #1380 that was fixed with (just merged now) #1392. Can you re-pull the latest and try again? Thanks.

@joe-lawrence OK
I still have a small question. I read the commit #1392 found the change is :
[[ -n "$CONFIG_PARAVIRT" ]] && ! kernel_version_gte 6.8.0 && check[p]=true # paravirt_patch_site

it just added a judgment of kernel version. So, is paravirt_patch_site is deleted in kernel 6.9.
Maybe just ignore it will not have any negative effect.
Thank you @joe-lawrence for answering my question. :)

The answer is in #1380

@joe-lawrence As described in torvalds/linux@f7af697
this paravirt_patch_site is no longer needed. But this function may still exist. Is kpatch-build have a compatible solution?

@wardenjohn : if I understand your question, take a look at the kernel patch series https://lore.kernel.org/all/20231210062138.2417-1-jgross@suse.com/ to see that Juergen has implemented the previous paravirt patching functionality with alternatives based patching. Support for .altinstructions / .altinstr_replacement has been in kpatch since 698cc1c ("create-diff-object: support fixup and related sections").

OK! I got it. Thank you, joe~