Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70B2AC433EF for ; Tue, 8 Feb 2022 07:53:32 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nHLJP-0005RD-Vn; Tue, 08 Feb 2022 02:53:19 -0500 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.94.2) (envelope-from ) id 1nHLJM-0005R7-5s for kernelnewbies@kernelnewbies.org; Tue, 08 Feb 2022 02:53:16 -0500 Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 8 Feb 2022 16:53:10 +0900 X-Original-SENDERIP: 211.180.235.152 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send001-relay.gov-dooray.com with SMTP id b97e66dd62022166; Tue, 08 Feb 2022 16:53:10 +0900 DKIM-Signature: a=rsa-sha256; b=BycSDxvrujRVwaiiMXGy65q+619s12MHUZw+VUs31D0OyFrPNz3rJ+SuSK0c+1ahZbFS+C8j8F mWws95o9N0YoEj9qjI5kz9XZV8+PH+wJXT2XeK8uVdiU+vk8ySEZisUdjlUO9Moy7kZzH2Jh9IOf ZL5Pm15n/7E9hl3gMS3AZFj0U1tfno06KvzLNx6Zv7nU/Rhp1wiyo6xUg+2Fyj25+p10GaQ3z2D4 vX5/lHO5u4pT0tFD/uFWL+qFkMgJNh7LzU+DMhhTnmP3ztUVe6Fw/EyoeOH68TAUK9gjkTum7A8R wu8zqnGSbdVvGBngGixvwdMdbpVMd1LU2BPTZ10g==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=qwLsRnEWZBqPryNAQlUQcKeK+KSvhsrohVf99H3ymxo=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id 7ed5568e62022166; Tue, 08 Feb 2022 16:53:10 +0900 From: "Chan Kim" To: Subject: Can't find vprintk_safe in System.map Date: Tue, 8 Feb 2022 16:53:07 +0900 Message-ID: <060e01d81cc0$e96ca660$bc45f320$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: ko Thread-Index: Adgcv9CKT2gQqmmsSlOvXNj/1oP/wQ== X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7775693571850641951==" Errors-To: kernelnewbies-bounces@kernelnewbies.org This is a multipart message in MIME format. --===============7775693571850641951== Content-Type: multipart/alternative; boundary="----=_NextPart_000_060F_01D81D0C.59562320" Content-Language: ko This is a multipart message in MIME format. ------=_NextPart_000_060F_01D81D0C.59562320 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_060F_01D81D0C.59562320 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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 =3D = 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

------=_NextPart_000_060F_01D81D0C.59562320-- --===============7775693571850641951== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============7775693571850641951==--