public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeff Fan via groups.io" <fanjianfeng=byosoft.com.cn@groups.io>
To: yoshinoyatoko <yoshinoyatoko@163.com>,
	 "devel@edk2.groups.io" <devel@edk2.groups.io>
Subject: 回复: Re: [edk2-devel] Is DEBUG output function safe for MP case?
Date: Tue, 4 Jun 2024 09:11:50 +0800	[thread overview]
Message-ID: <2024060409114975134835@byosoft.com.cn> (raw)
In-Reply-To: 4ba43421.8f62.18fdd334dbc.Coremail.yoshinoyatoko@163.com

[-- Attachment #1: Type: text/plain, Size: 1869 bytes --]

As Andrew mentioned, DEBUG() is NOT safe for MP. 

Generally, kernel modules are not suggested to use DEBUG() in AP code becasue they are not the decision maker on the final DebuLib instance.
If you could make sure the DebugLib instance platform selected only based on I/O or MMIO operations, you could use DEBUG() in AP for debuging or testing purpose.
To avoid mess output message due to multiple APs, you may use spinlock to protect DEBUG() invoking.

For runtime (for example SMM AP code),  the upper method may not work becaseu OS may take control on Serial Port.  




fanjianfeng@byosoft.com.cn
 
发件人: Yoshinoya
发送时间: 2024-06-03 16:24
收件人: devel; fanjianfeng
主题: Re:回复: [edk2-devel] Is DEBUG output function safe for MP case?
Hi, Jeff:
If AP code use base-typed debuglib, then it's mp safe?

Thanks





At 2024-05-31 14:33:40, "Jeff Fan via groups.io" <fanjianfeng=byosoft.com.cn@groups.io> wrote:
AP cannot run any UEFI Service. Please make sure AP code use base-typed DebugLib instance (Such as BaseDebugLibSerialport.inf from MdePkg)




fanjianfeng@byosoft.com.cn
 
发件人: Yoshinoya
发送时间: 2024-05-31 14:22
收件人: devel@edk2.groups.io
主题: [edk2-devel] Is DEBUG output function safe for MP case?
Hello
I ask for help for debug output in multi-core case.

Is the current DEBUG marco safe for AP Cores to output message?
If the output message is too long, it takes too much time, will it cause some abnormal exception?

Thanks



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119441): https://edk2.groups.io/g/devel/message/119441
Mute This Topic: https://groups.io/mt/106475080/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 5496 bytes --]

  reply	other threads:[~2024-06-04  1:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  6:22 [edk2-devel] Is DEBUG output function safe for MP case? Yoshinoya
2024-05-31  6:33 ` 回复: " Jeff Fan via groups.io
2024-05-31  9:59   ` Andrew Fish via groups.io
     [not found]   ` <17D48A6E78A3E42F.21428@groups.io>
2024-05-31 10:14     ` Andrew Fish via groups.io
2024-06-03  8:24   ` 回复: " Yoshinoya
2024-06-04  1:11     ` Jeff Fan via groups.io [this message]
2024-06-06  4:57       ` 回复: " Yoshinoya
     [not found]       ` <17D65170E6B4AF25.31248@groups.io>
2024-06-12  4:42         ` [edk2-devel] processing compressed section during CAR phase Yoshinoya
2024-06-20  8:56           ` [edk2-devel] uncompress peims during car phase Yoshinoya
2024-06-06  4:55 ` [edk2-devel] pci command supports CXL device type Yoshinoya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024060409114975134835@byosoft.com.cn \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox