All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Orzel, Michal" <michal.orzel@amd.com>
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/arm: vpl011: reserve the virq before setting up the backend
Date: Mon, 23 Nov 2026 09:32:22 +0100	[thread overview]
Message-ID: <222bf600-e950-45e6-baba-999751da36d2@amd.com> (raw)
In-Reply-To: <20261119213722.4174845-1-stefano.stabellini@amd.com>



On 19-Nov-26 22:37, Stefano Stabellini wrote:
> domain_vpl011_init() allocates the backend event channel before it
> reserves the virq and records it in vpl011->virq. A notification sent
> on that port in between runs vpl011_update_interrupt_status() with
> vpl011->virq still 0. With CONFIG_NEW_VGIC this calls
> vgic_inject_irq(d, NULL, 0, ...), and vgic_get_irq() dereferences the
> NULL vcpu to look up the private interrupt 0. The same notification
> also takes vpl011->lock and updates vpl011->uartfr before either is
> initialised, and both are then reset under it.
I struggle to understand how this could work in practice (in theory, yes). The
evtchn port is returned by the hypercall which at this point has not yet
returned to the caller. So the caller (console domain) would need to predicate
the port that Xen is going to return and send something on that port via a
different pCPU. xenconsoled never does that which is worth saying in the commit msg.

> 
> Reserve and record the virq, set the initial flags and initialise the
> lock first, before any backend is set up, so that they are valid by the
> time the event channel exists. All the failures after the reservation
> now go through domain_vpl011_deinit(), which releases the virq.
> 
> Fixes: ca0637a147af ("xen/arm: vpl011: Add SBSA UART emulation in Xen")
> Fixes: 85da01b71312 ("xen/arm: vpl011: record the virq only once it is reserved")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



      reply	other threads:[~2026-11-23  8:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 21:37 [PATCH] xen/arm: vpl011: reserve the virq before setting up the backend Stefano Stabellini
2026-11-23  8:32 ` Orzel, Michal [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=222bf600-e950-45e6-baba-999751da36d2@amd.com \
    --to=michal.orzel@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=stefano.stabellini@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.