c - Exported kvm kernel functions get undefined warning when compiling a kernel driver that calls them -
i'm trying call 2 exported (maybe) kernel functions kvm - kvm_write_guest
, kvm_get_segment
when compile kernel driver call these 2 functions warning saying undefined.
warning: "kvm_write_guest" [/home/driver.ko] undefined! warning: "kvm_get_segment" [/home/driver.ko] undefined!
when executed commands:
cat /proc/kallsyms | grep kvm_get_segment cat /proc/kallsyms | grep kvm_write_guest
to check see if exported following:
0000000000000000 t kvm_write_guest [kvm] 0000000000000000 t kvm_get_segment [kvm]
below protocols , includes have in header file included in .c file calls these functions. pulled prototypes kvm_main.c code.
#include <linux/kvm.h> #include <linux/kvm_types.h> #include <linux/kvm_host.h> int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, unsigned long len); void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
when dig kvm_main.c
source code kvm_write_guest
don't seem exported using following code:
export_symbol_gpl(kvm_write_guest);
when dig x86.c code kvm_get_segment
isn't exported using method either. doesn't seem in fact exported want make sure i'm not doing wrong. i'd avoid patching code , recompiling if can. thank in advance appreciated!
you're not doing wrong. if they're not exported export_symbol or export_symbol_gpl, won't able call them module.
Comments
Post a Comment