Xen-Devel Archive mirror
 help / color / mirror / Atom feed
From: Jens Wiklander <jens.wiklander@linaro.org>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, patches@linaro.org,
	 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	 Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: [XEN PATCH v4 5/5] xen/arm: ffa: support notification
Date: Tue, 7 May 2024 13:17:16 +0200	[thread overview]
Message-ID: <CAHUa44Fc6pRDjUr1HiW7r=QB4kxCEdRz_G9ATLqEg2KqNp+gFA@mail.gmail.com> (raw)
In-Reply-To: <447340c3-d57a-411b-8d4d-29e8683b27d9@xen.org>

Hi Julien,

On Fri, May 3, 2024 at 4:25 PM Julien Grall <julien@xen.org> wrote:
>
> Hi Jens,
>
> On 03/05/2024 14:54, Jens Wiklander wrote:
> >>> +static int ffa_setup_irq_callback(struct notifier_block *nfb,
> >>> +                                  unsigned long action, void *hcpu)
> >>> +{
> >>> +    unsigned int cpu = (unsigned long)hcpu;
> >>> +    struct notif_irq_info irq_info = { };
> >>> +
> >>> +    switch ( action )
> >>> +    {
> >>> +    case CPU_ONLINE:
> >>
> >> Can't you execute the notifier in CPU_STARTING? This will be called on
> >> the CPU directly, so you should be able to use request_irq(...).
> >
> > I tried that first but it failed with the ASSERT_ALLOC_CONTEXT() in _xmalloc().
> >
> > I've also tested a three-step solution with CPU_UP_PREPARE,
> > CPU_STARTING, and CPU_UP_CANCELED.
> > My approach here is more direct, but it still suffers from a weakness
> > in error handling even if it seems quite unlikely to run out of heap
> > or for setup_irq() to fail at this stage.
>
> Ah I didn't notice that notify_cpu_starting() is called with IRQ
> disabled. I assumed they would be enabled.
>
> Then I would consider to do:
>
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index 6efed876782e..db322672e508 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -389,6 +389,7 @@ void asmlinkage start_secondary(void)
>        */
>       init_maintenance_interrupt();
>       init_timer_interrupt();
> +    init_tee_interrupt();
>
>       local_abort_enable();
>
> And plumb through the TEE subsystem.

I'll use that in the next version, it should remove a lot of complex code.

Thanks,
Jens


      reply	other threads:[~2024-05-07 11:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 14:56 [XEN PATCH v4 0/5] FF-A notifications Jens Wiklander
2024-05-02 14:56 ` [XEN PATCH v4 1/5] xen/arm: ffa: refactor ffa_handle_call() Jens Wiklander
2024-05-02 14:56 ` [XEN PATCH v4 2/5] xen/arm: ffa: use ACCESS_ONCE() Jens Wiklander
2024-05-02 14:56 ` [XEN PATCH v4 3/5] xen/arm: ffa: simplify ffa_handle_mem_share() Jens Wiklander
2024-05-02 14:56 ` [XEN PATCH v4 4/5] xen/arm: allow dynamically assigned SGI handlers Jens Wiklander
2024-05-02 14:56 ` [XEN PATCH v4 5/5] xen/arm: ffa: support notification Jens Wiklander
2024-05-03  9:59   ` Julien Grall
2024-05-03 13:54     ` Jens Wiklander
2024-05-03 14:25       ` Julien Grall
2024-05-07 11:17         ` Jens Wiklander [this message]

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-all 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='CAHUa44Fc6pRDjUr1HiW7r=QB4kxCEdRz_G9ATLqEg2KqNp+gFA@mail.gmail.com' \
    --to=jens.wiklander@linaro.org \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=patches@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=volodymyr_babchuk@epam.com \
    --cc=xen-devel@lists.xenproject.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).