What is the purpose of RH_KABI_REPLACE_SPLIT? - linux-kernel

I'm trying to build ClearCase MVFS kernel module under CentOS 8, kernel 4.18.
The build failed because the code references struct task_struct.state (from linux/sched.h). This member exists in vanilla kernels up to 5.13. In the CentOS kernel, is has been renamed using the macro RH_KABI_REPLACE_SPLIT from state to __state.
So, whats the purpose of RH_KABI_REPLACE_SPLIT here?

Related

adding RT PRMEEPT_rt patch in imx6ullevk and building yocto rootfs using core-image-rt-sdk in yocto toaster

im using imx6ull , where i need to enable prmeept_rt patch, i have enabled
--->General setup
-->(X) Fully Preemptible Kernel (Real-Time)
in Linux kernel 5.4.3 by using patch-5.4.3-rt1.patch.xz and created kernel image and i tried to boot the board with rootfs build (poky branch is kirkstone) using core-image-minimal image recipe it was not providing me root access ,
So i tried to build another rootfs (poky branch is kirkstone) using core-image-rt-sdk image recipe in yocto toaster it is showing error. as
Nothing PROVIDES 'core-image-rt-sdk'
core-image-rt-sdk was skiped : Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it
how to build rootfs using core-image-rt-sdk image recipe .
any suggestions will be more help full

Compile error for Linux kernel 4.10.8 targeting ARM

I'm trying to cross compile the Linux kernel 4.10.8 for arm, but get this error:
CC [M] drivers/vhost/vhost.o
In file included from ./include/uapi/linux/stddef.h:1:0,
from ./include/linux/stddef.h:4,
from ./include/uapi/linux/posix_types.h:4,
from ./include/uapi/linux/types.h:13,
from ./include/linux/types.h:5,
from ./include/uapi/asm-generic/fcntl.h:4,
from ./arch/arm/include/uapi/asm/fcntl.h:9,
from ./include/uapi/linux/fcntl.h:4,
from ./include/linux/fcntl.h:4,
from ./include/linux/eventfd.h:11,
from drivers/vhost/vhost.c:14:
drivers/vhost/vhost.c: In function ‘vhost_vring_ioctl’:
./include/linux/compiler.h:518:38: error: call to ‘__compiletime_assert_1357’ declared with attribute error: BUILD_BUG_ON failed: __alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)enter
Any idea how to solve this?
I dont know what this module is used for, so I dont know if I actually need to compile it, but I cant find where in menuconfig to disable this module?
This module (CONFIG_VHOST) usually requires when you need virtualization support. If you don't require it disable it in the make menuconfig.
If you don't need virtualization, you can ignore it and proceed your build.

create_proc_read_entry returns NULL but CONFIG_PROC_FS=y

I am working on 32bit to 64bit kernel module porting project. The old kernel version is 2.6.18 and the target is 2.6.32.
The old kernel modules were creating files under /proc/sys/net// path via the following function:
if (create_proc_read_entry("/sys/net/<module_name>/<proc_file_name>", 0, NULL, read_proc, NULL) == NULL){ ...}
I set CONFIG_PROC_FS as "y" in .config file before building 2.6.32 kernel.
However, although proc_fs.h for kernel version 2.6.32 has "create_proc_read_entry" same as kernel version 2.6.18, and "CONFIG_PROC_FS=y" in .config file, the return value is always NULL and it crashes the module when I load it with modprodbe command. If I comment out the subject function call, module is loaded without any problem and it works without any problem.
Did I miss something ? Should I stick with CONFIG_PROC_FS flag ?

Linux kernel module is not running anymore when switching from mdev to udev

I have a simple Kernel module:
void GPIO_LED(void) {
printk(" GPIO: set PC8: '0');
at91_set_gpio_value(AT91_PIN_PC8, 1);
}
//
int init_module(void) {
GPIO_LED();
return 0;
}
MODULE_LICENSE("GPL");
When using it with mdev device management. everything works just fine. But using it with a udev device management, while executing insmod
insmod /usr/modules/measurement_gpio.ko
the following message appeared:
insmod: can't insert '/usr/modules/measurement_gpio.ko': invalid module format
Another test showed that when using a device table instead of mdev/udev leads to the same Error. Every setting stayed the same (especially the kernel version) but the device management changes during this Test, so actually the module should be fine.
How can that be and how to solve it?
[Edit:] after making the kernel be able for load modules for multiple versions i receive the following message, which confuses me even more:
measurement_gpio: version magic '2.6.39 mod_unload modversions ARMv5 ' should be '2.6.39 mod_unload ARMv5
[Edit2:]
The way I build my module is:
with Buildroot I'm generating an Image, on the way a Linux
2.6.39 is installed.
Afterwards I'm compiling the kernelmodule with the path to the Linux 2.6.39, that buildroot has downloaded.
When the module is created I'm putting it into a fs-overlay
directory, so it will be included into the image on next build.
I hit another "make" on buildroot and i got everything together and a bootable Image.
I change nothing, that's why it confuses me even more

Where is tasklist_lock defined in Linux kernel?

The linux/shed.h contains the following forward declaration:
extern rwlock_t tasklist_lock;
But where is tasklist_lock defined?
tasklist_lock is references in sched.h, and defined in fork.c
I use "gid" as a tool to spelunk through the kernel source. I simply:
1) Install idutils
2) Run "mkid" (to generate a searchable index) from the root of my kernel source
3) run "gid MYVARIABLE | less" any time I want to look something up
"idutils" is freely available on most Linux distros, and on the Internet.
Here's the documentation:
http://www.gnu.org/software/idutils/manual/idutils.html

Resources