public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "levi.yun" <yeoreum.yun@arm.com>
To: Laszlo Ersek <lersek@redhat.com>,
	Oliver Smith-Denny <osde@linux.microsoft.com>,
	devel@edk2.groups.io, Ard Biesheuvel <ardb@kernel.org>
Cc: sami.mujawar@arm.com, ray.ni@intel.com, pierre.gondois@arm.com,
	nd@arm.com
Subject: Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Initialise serial port early in StandaloneMmEntryPoint
Date: Wed, 10 Jan 2024 16:13:03 +0000	[thread overview]
Message-ID: <5a9cd535-988e-4212-a0bb-f340d0b124f9@arm.com> (raw)
In-Reply-To: <90dd9b46-b0a6-99f3-db30-4225c337e0a9@redhat.com>

> My personal conclusion in that thread was [1], and correspondingly,
> commit 5087a0773645 ("ArmVirtPkg/FdtPL011SerialPortLib: initialize
> implicitly", 2023-10-07). In the end, the only tractable solution was to
> initialize the serial port (hardware, and library instance) exactly
> once, in (a) the constructor, or (b) the explicit SerialPortInitialize()
> call, or (c) any SerialPortLib API, whichever occurred first. (And (a)
> and (b) can be coalesced, because SerialPortInitialize() can be marked
> as the constructor for the lib instance.)
>
> [1] http://mid.mail-archive.com/542db9e1-cd28-27a2-3a98-5b0c85cd7c79@redhat.com
>      https://edk2.groups.io/g/devel/message/109235
>
> Laszlo
>
In my personal thinking, It's better to make new interface like

RETURN_STATUS
EFIAPI
SerialPortInitializeEarly (
VOID
   );

to solve this problem.

Because, It makes a memory permission fault
when we call SerialPortInitialize like
ArmVirtPkg/Library/FdtPL011SerialPortLib
where try to modify global variable.

At the _ModuleEntryPoint of StandAloneMmCore which is FIRST entry from TF-A
All of Image area is mapped as RO+X, so before load StandaloneMmCore,
We couldn't write global variable.

the purposes of above interface are:
     - Initalize serial port to use in early environment only (like
StandAloneMmCore Entry Point) where couldn't write global variable by
static information (FixedPcd).
     - It presume that all setting configured by it will be overwritten
by SerialPortInitialize.




IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


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



  reply	other threads:[~2024-01-10 16:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 11:49 [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Initialise serial port early in StandaloneMmEntryPoint levi.yun
2024-01-05 11:52 ` levi.yun
2024-01-05 16:46 ` Ard Biesheuvel
2024-01-05 17:22   ` levi.yun
2024-01-05 18:38     ` Oliver Smith-Denny
2024-01-08 12:16       ` Laszlo Ersek
2024-01-10 16:13         ` levi.yun [this message]
2024-01-10 16:41           ` Laszlo Ersek
2024-01-10 17:16             ` levi.yun
2024-01-10 21:06               ` Brian J. Johnson
2024-01-11  9:05                 ` levi.yun
     [not found]                 ` <17A93FAECCFD3533.4530@groups.io>
2024-01-18 10:19                   ` levi.yun

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=5a9cd535-988e-4212-a0bb-f340d0b124f9@arm.com \
    --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