Hello all I’m doing a experiment and found a strange phenomenon. This is the vprintk_func( ) function defined in kernel/printk/printk_safe.c (in linux 5.4.21, I’ll update to recent version later, it’s arm64). __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { /* * Try to use the main logbuf even in NMI. But avoid calling console * drivers that might have their own locks. */ if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK) && raw_spin_trylock(&logbuf_lock)) { int len; len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, 0, fmt, args); raw_spin_unlock(&logbuf_lock); defer_console_output(); return len; } /* Use extra buffer in NMI when logbuf_lock is taken or in safe mode. */ if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK) return vprintk_nmi(fmt, args); /* Use extra buffer to prevent a recursion deadlock in safe mode. */ if (this_cpu_read(printk_context) & PRINTK_SAFE_CONTEXT_MASK) return vprintk_safe(fmt, args); /* No obstacles. */ return vprintk_default(fmt, args); } In qemu test, it passes all the printk_context check and enters vprintk_default( ) funciton but in our FPGA board (with only 8MB ram instead of DDR), by writing debug information to some variables, I found the program seems to enter vprintk_safe( ) function and stuck somewhere inside. But when I examine the System.map file, I cannot find the vprintk_safe function and vprintk_nmi (I can find vprintk_default). I’m curious if this may be related to the malfunction. How can this happen? And how should I understand this? Thank you! Chan Kim |
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies