public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: Michael Brown <mcb30@ipxe.org>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Laszlo Ersek <lersek@redhat.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] RFC: Another solution to the nested interrupt issue
Date: Thu, 25 Jan 2024 13:54:05 +0000	[thread overview]
Message-ID: <MN6PR11MB82441D5DED9C87A508D3F4B58C7A2@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <0102018d40b796c3-4a61aa4c-dc30-444d-b731-470396d46072-000000@eu-west-1.amazonses.com>


> On 25/01/2024 07:57, Ni, Ray wrote:
> > This mail is to bring another approach to solve the stack-overflow due
> > to nested interrupts. Michael solved this problem in OVMF through
> > NestedInterruptTplLib.
> >
> > I made a draft patch as attached “DxeCore.diff”. The patch simply to
> > avoid the interrupt in enable state when TPL is dropped to the
> > interrupted TPL. The interrupt will be enabled later through “IRET”.
> 
> I don't disagree with the approach, but it does break the API as per the
> UEFI PI specification (version 1.8 section II-12.10), and so this is not
> something that can just be dropped in as an EDK2 code change.

You think that the TimerInterruptHandler() doesn't raise/restore TPL
which would violate the PI spec as PI spec says " NotifyFunction ... executes at EFI_TPL_HIGH_LEVEL."?

I do not think the PI spec requires TimerInterruptHandler() raises TPL
to HIGH before invoking NotifyFunction. It just means the NotifyFunction
will execute at TPL_HIGH.

If you review HpetTimer driver, it does not raise TPL to HIGH before
invoking NotifyFunction.

And I think implementing the DxeCore changes as attached does not
prevent the TimerInterruptHandler() from calling raise/restore TPL.

So, with the changes done in DxeCore, a timer driver could either
not raise/restore TPL in TimerInterruptHandler(), or it calls
NestedInterruptTplLib if it wants.

I like the idea behind NestedInterruptTplLib. The only concern is
the maintenance effort. I want to avoid the difficulty of debuggability
brought by NestedInterruptTplLib when some timer interrupt related
issues happen in future. 

I am ok with OvmfPkg code using NestedInterruptTplLib.

Thanks,
Ray



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



  reply	other threads:[~2024-01-25 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25  7:57 [edk2-devel] RFC: Another solution to the nested interrupt issue Ni, Ray
2024-01-25 13:03 ` Michael Brown
2024-01-25 13:54   ` Ni, Ray [this message]
2024-01-25 14:25     ` Michael Brown
2024-01-25 15:06       ` Ni, Ray
2024-01-25 15:29         ` 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=MN6PR11MB82441D5DED9C87A508D3F4B58C7A2@MN6PR11MB8244.namprd11.prod.outlook.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