Android GKI kernel ABI broken problem - liuyq/android-issues GitHub Wiki
ABI Broken
when there is an ABI broken problem, the vendor kernel module will be failed to be loaded
[ 6.708547][ T1] init: Loading module /lib/modules/ufs_qcom.ko with args ''
[ 6.716289][ T1] ufs_qcom: Unknown symbol ufshcd_system_freeze (err -2)
[ 6.723305][ T1] ufs_qcom: Unknown symbol ufshcd_system_thaw (err -2)
[ 6.730086][ T1] ufs_qcom: Unknown symbol ufshcd_system_restore (err -2)
[ 6.772458][ T1] init: Failed to insmod '/lib/modules/ufs_qcom.ko' with args '': No such file or directory
[ 6.782478][ T1] init: LoadWithAliases was unable to load ufs_qcom
[ 6.789690][ T1] init: Failed to load kernel modules
[ 6.795600][ T1] init: InitFatalReboot: signal 6
[ 6.815294][ T1] init: #00 pc 0000000000319dc0 /init (unwindstack::AndroidLocalUnwinder::InternalUnwind(std:)
[ 6.834794][ T1] init: #01 pc 000000000030e65c /init (android::init::InitFatalReboot(int)+204) (BuildId: 800)
[ 6.847898][ T1] init: #02 pc 000000000030ed10 /init (android::init::InstallRebootSignalHandlers()::$_24::__)
[ 6.863492][ T1] init: #03 pc 000000000000084c [vdso]
[ 6.869143][ T1] init: #04 pc 00000000004d89d0 /init (abort+176) (BuildId: 800c88c049b2e96d8341be103b90df93)
[ 6.879594][ T1] init: #05 pc 0000000000313fac /init (android::init::InitAborter(char const*)+44) (BuildId: )
[ 6.892937][ T1] init: #06 pc 000000000049aad0 /init (android::base::SetAborter(std::__1::function<void (cha)
[ 6.911164][ T1] init: #07 pc 000000000049a264 /init (android::base::LogMessage::~LogMessage()+356) (BuildId)
[ 6.924671][ T1] init: #08 pc 0000000000304f98 /init (android::init::FirstStageMain(int, char**)+8808) (Buil)
[ 6.938445][ T1] init: #09 pc 00000000004d67ec /init (__real_libc_init(void*, void (*)(), int (*)(int, char*)
[ 6.957530][ T1] init: Reboot ending, jumping to kernel
update the ABI symbol list for the vendor
## in this case android/abi_gki_aarch64_db845c will be updated
## as it's specified in the build.config.db845c as KMI_SYMBOL_LIST
$ KMI_SYMBOL_LIST_ADD_ONLY=1 BUILD_CONFIG=common/build.config.db845c build/build_abi.sh -s
update the ABI representation
## The android/abi_gki_aarch64.xml will be updated and diff report will be printed
## as ABI_DEFINITION=android/abi_gki_aarch64.xml is defined in build.config.gki.aarch64
$ BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh -u
...
ABI DIFFERENCES HAVE BEEN DETECTED!
3 function symbol(s) added
'int ufshcd_system_freeze(struct device *)'
'int ufshcd_system_restore(struct device *)'
'int ufshcd_system_thaw(struct device *)'
========================================================
Updating expected ABI definition (android/abi_gki_aarch64.xml)
...
## out_abi/android13-5.15/dist/abi.report is the report of the above
why the ko failed to be loaded.
based on the Android Kernel ABI Monitoring document. All the KMI(Kernel Module Interface) ABI symbols used for the db845c vendor kernel modules will be listed in the android/abi_gki_aarch64_db845c file, and when building the GKI kernel, the KMI symbol list file for all vendors(abi_gki_aarch64_db845c is one for the db845c build) will be used if they are defined in the ADDITIONAL_KMI_SYMBOL_LISTS list in the build.config.gki.aarch64, and only all the functions defined in such files will be public and be accessible to the vendor kos, the symbol for the functions not defined in such files will be delete and not accessible by the kernel module files, and would cause the module loading error like report above. so the update of vendor KMI symbol list file is required for such ABI broken problem. Note: update for android/abi_gki_aarch64.xml is not required to resolve the ABI Broken problem, but better to update