public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Brown" <mcb30@ipxe.org>
To: devel@edk2.groups.io, ardb@kernel.org
Cc: Ray Ni <ray.ni@intel.com>, Gerd Hoffmann <kraxel@redhat.com>,
	 Laszlo Ersek <lersek@redhat.com>
Subject: Re: [edk2-devel] [PATCH v3 5/5] MdeModulePkg: Extend NestedInterruptTplLib to support Arm CPUs
Date: Tue, 23 Jan 2024 16:48:10 +0000	[thread overview]
Message-ID: <0102018d3738dfc9-ccb492a1-7d81-4ee5-9d8d-caaf5fae1c42-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <CAMj1kXEST44dG9pAwQiesL4J9_yED4WYS_qgy89xgOv4OhX_yQ@mail.gmail.com>

On 23/01/2024 15:51, Ard Biesheuvel wrote:
> On Tue, 23 Jan 2024 at 16:31, Michael Brown <mcb30@ipxe.org> wrote:
>> Add implementations of DisableInterruptsOnIret() for MDE_CPU_ARM and
>> MDE_CPU_AARCH64.  In both cases, the saved IRQs-disabled and
>> FIQs-disabled flags are set in the stored processor status register
>> (matching the behaviour of DisableInterrupts(), which also sets both
>> flags).
> 
> Thanks for this.
> 
> You can drop the FIQ bits, though: anything that can run Tianocore
> will have the FIQs routed to the secure world, and all of the higher
> level en/disable interrupt code only reasons about the IRQ line.

Thank you.

My commit message was incorrect, sorry: DisableInterrupts() in MdePkg 
does indeed disable only IRQs.  I was accidentally looking at 
ArmDisableInterrupts() in ArmPkg, which disables both IRQs and FIQs.

My (incomplete) understanding of Arm behaviour is that when an interrupt 
is raised, both IRQs and FIQs will be disabled by hardware.  When the 
interrupt handler ends up enabling interrupts during RestoreTPL(), only 
the IRQs will be re-enabled since EnableInterrupts() touches only the 
IRQ bit.  This state can persist for an extended period of time (e.g. 30 
seconds) if a callback at TPL_CALLBACK ends up waiting for further timer 
events.

Q1: Is it a problem to have this situation, with FIQs disabled for an 
extended period of time?

Q2: What happens with FIQs when there is no secure world (e.g. using 
ArmVirtQemu with "-M virt")?

Q3: Would you like me to add in the extra patch that modifies TimerDxe 
to use NestedInterruptTplLib?

Many thanks,

Michael



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



  reply	other threads:[~2024-01-23 16:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <17ACFF3FDD20CD9A.13754@groups.io>
2024-01-23 15:31 ` [edk2-devel] [PATCH v3 0/5] MdeModulePkg: Move NestedInterruptTplLib to MdeModulePkg Michael Brown
2024-01-25 12:17   ` Ni, Ray
     [not found] ` <20240123153104.2451759-1-mcb30@ipxe.org>
2024-01-23 15:31   ` [edk2-devel] [PATCH v3 1/5] " Michael Brown
2024-01-23 15:31   ` [edk2-devel] [PATCH v3 2/5] MdeModulePkg: Add missing Iret.h to NestedInterruptTplLib sources list Michael Brown
2024-01-23 15:31   ` [edk2-devel] [PATCH v3 3/5] MdeModulePkg: Do nothing on NestedInterruptRestoreTPL(TPL_HIGH_LEVEL) Michael Brown
2024-01-23 16:32     ` Laszlo Ersek
2024-01-23 16:59       ` Michael Brown
2024-01-24 12:52         ` Laszlo Ersek
2024-01-23 15:31   ` [edk2-devel] [PATCH v3 4/5] MdeModulePkg: Add self-tests for NestedInterruptTplLib Michael Brown
2024-01-23 16:55     ` Laszlo Ersek
2024-01-23 17:41       ` Michael Brown
2024-01-24 12:58         ` Laszlo Ersek
2024-01-24 10:24     ` Ni, Ray
2024-01-24 10:26       ` Ni, Ray
2024-01-23 15:31   ` [edk2-devel] [PATCH v3 5/5] MdeModulePkg: Extend NestedInterruptTplLib to support Arm CPUs Michael Brown
2024-01-23 15:51     ` Ard Biesheuvel
2024-01-23 16:48       ` Michael Brown [this message]
2024-01-23 17:10     ` Laszlo Ersek
2024-01-23 17:21       ` Michael Brown

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=0102018d3738dfc9-ccb492a1-7d81-4ee5-9d8d-caaf5fae1c42-000000@eu-west-1.amazonses.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