When debugging Linux Kernel running in QEMU with GDB it's not possible to access the Kernel function located in .text.init. Example:
(gdb) disas start_kernel
Dump of assembler code for function start_kernel:
0xffffffff83160ff3 <+0>: Cannot access memory at address 0xffffffff83160ff3
Removing --enable-kvm -cpu host from the QEMU command line makes it works as expected:
(gdb) disas start_kernel
Dump of assembler code for function start_kernel:
=> 0xffffffff83160ff3 <+0>: call 0xffffffff810788c0 <__fentry__>
0xffffffff83160ff8 <+5>: push rbp
0xffffffff83160ff9 <+6>: mov rdi,0xffffffff82e1a9c0
0xffffffff83161000 <+13>: mov rbp,rsp
Is it possible to make --enable-kvm -cpu host to be able to access memory located in the .init.text section? If some fixes are needed I'll be more than happy to help.