foss-for-synopsys-dwc-arc-processors / linux

Helpful resources for users & developers of Linux kernel for ARC
22 stars 13 forks source link

ARCv3 (32/64): failed to build with CONFIG_KPROBES option #124

Open pavelvkozlov opened 1 year ago

pavelvkozlov commented 1 year ago

An attempt to build kernel with enabled CONFIG_KPROBES or CONFIG_KGDB options ends with error:

/tmp/linux/arch/arc/kernel/disasm.c: In function 'get_reg':
/tmp/linux/arch/arc/kernel/disasm.c:443:29: error: 'struct callee_regs' has no member named 'r13'; did you mean 'r14'?
  443 |                 p = &cregs->r13;
      |                             ^~~
      |                             r14
/tmp/linux/arch/arc/kernel/disasm.c: In function 'set_reg':
/tpm/linux/arch/arc/kernel/disasm.c:471:37: error: 'struct callee_regs' has no member named 'r13'; did you mean 'r14'?
  471 |                         p = &cregs->r13;
      |                                     ^~~
      |                                     r14
make[2]: *** [/tmp/linux/scripts/Makefile.build:287: arch/arc/kernel/disasm.o] Error 1

This particular problem occurs because of difference in ABI and can be fixed easily. But it points to another problem: support for KPROBE and KGDB was not tested. Review of instruction decoding in disasm_instr() function and testing of KPROBE and KGDB functionality for ARCv3 32-bit and 64-bit is required.

abrodkin commented 1 year ago

@pavelvkozlov indeed KGDB on ARCv3 requires more testing. What we have now is what was done primarily for ARCompact & ARCv2 back in the day.