Assembly function (crc_t10dif_pcl) varies in performance between different...
I do see a difference in the performance of the assembly function crc_t10dif_pcl between two difference kernels, one is 5.1.20 and the newer one in 5.5.6.Here is the function in:5.1.20:...
View ArticleWhy there was a lot of FIN retransmission(TCP/IP)?
21088 2020-03-02 21:59:27.815879 10.9.180.89 161.117.97.14 TCP 76 41818 → 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1370 SACK_PERM=1 TSval=1656722322 TSecr=0 WS=512 21092 2020-03-02 21:59:27.903661...
View ArticleNo library found for linux to implement keyboard simulation in c++ [closed]
I am trying to make an application in c++ which simulates a keypress from a keyboard, meaning that if i execute the program than after that if i open any text editor it must keep on printing the...
View ArticleChar Driver Linux: What is the correct implementation of file_operations read...
I am trying to read and write to a char driver. When i use a C program to open the device file and read and write it gives a SEG fault. When i use a cat to the device file it goes to infinite loop.1)...
View ArticleHigh kworker CPU usage on idle embedded system
I am working on an embedded device where the kworker stays at high cpu usage when the device is idle.iostat output:bash-4.3# /intflash/iostat Linux 4.9 03/05/20 _ppc_ (2 CPU) avg-cpu: %user %nice...
View ArticlePick up an issue in Linux kernel [closed]
I want to contribute to Linux kernel. I want to solve an existing issue. I have already researched on steps to submit patches and formatting style. I am clear in mind regarding the patch...
View ArticleHow does a system wide profiler (e.g. perf) correlate counters with...
I'm trying to understand how a system wide profiler works. Let's take linux perf as example. For a certain profiling time it can provide:Various aggregated hadware performance countersTime spent and...
View ArticleWhy ppoll() no wait my delay in Android Pie?
I learned that the loop that checks the GPIO interrupt, which is supposed to loop at ~100 usec, is actually looping every 3 usec. The reason is that the timespec I gave the GPIO event wait routine...
View ArticleARM ORR register difference
I'm trying to understand this kernel change. It's a {get,put}_user function correction, and it includes this fix: #ifndef __ARMEB__ - orr r2, r2, r3, lsl #8 + orr r2, r2, rb, lsl #8 #else - orr r2, r3,...
View ArticleReason why CFS scheduler using red black tree?
CFS scheduler picks next process based on minimum virtual time and to get this value efficiently its using Red-Black tree(rbtree), using rbtree we will get minimum O(h) here h is height of rbtree. But,...
View ArticleAny idea how Linux determines which string should be printed in a kernel module?
Given the most basic kernel module#include <linux/module.h> #include <linux/kernel.h> #include <linux/printk.h> static int __init my_mod_init(void) { printk("Hello World!");...
View ArticleVulnerabilities of Linux Kernel While Scanning Docker Images in AWS ECR
We are using AWS ECR for managing docker images. I enabled "Scan on push" while creating repository. We are building the docker images on Linux Kernel which has version of "5.3.0-40-generic".After...
View ArticleHalt instruction from Linux kernel module is not working
I wrote a simple Linux kernel module to issue hlt instruction#include <linux/kernel.h> #include <linux/module.h> MODULE_LICENSE("GPL"); static int __init test_hello_init(void) { asm("hlt");...
View ArticleHow to write to protected pages in the Linux kernel?
I am trying to add a syscall in a module. My rationale is:This is for a research project, so the exact implementation does not matter.Adding syscalls in the kernel-core takes a prohibitively long time...
View ArticleDifferent ways of suppressing 'uninitialized variable warnings' in C
I have encountered multiple uses of the uninitialized_var() macro designed to get rid of warnings like:warning: ‘ptr’ is used uninitialized in this function [-Wuninitialized] For GCC...
View ArticleLinux - list of registered devices
I have a linux driver that registers a char device for every compatible device-node in the Flattened-Device-Tree(FDT). On initialization, the driver allocates a major device number and a range of minor...
View ArticleBuilding an out-of-tree linux kernel module with separate output directory
I want to build an out of tree kernel module with the output directory being separate from my source directory? How would I do this? I'm willing to go any route. I'm okay with minimal changes to the...
View Articleseq_file not working properly after next returns NULL
What is wrong with this code (I guess with regard to compatibility with different kernel versions)?#define BUFFER_SIZE 2048 #define BUFFER_STEP 128 static char buffer[BUFFER_SIZE] = { 0 }; // this is...
View ArticleMemory map AXI DMA scatter/gather mode registers to userspace
I am new to the area of DMA and Kernel Programming, so please pardon me if it is a naive question.I am writing a kernel driver which can expose kernel memory to user space for dma related operations...
View ArticleWhy do we need DMA pool?
I'm reading https://www.kernel.org/doc/Documentation/DMA-API.txt and I don't understand why DMA pool is needed.Why not having PAGE_SIZE DMA allocated memory dma_alloc_coherent and use offsets?Also, why...
View Article