All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmkhn@proton.me
To: Jan Beulich <jbeulich@suse.com>
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
	julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
	sstabellini@kernel.org, dmukhin@ford.com,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 2/5] xen/console: introduce console_get_domid()
Date: Thu, 22 May 2025 00:30:39 +0000	[thread overview]
Message-ID: <aC5wKu4k6gWvQbKl@kraken> (raw)
In-Reply-To: <a8423035-771d-4e55-a3c5-562cc67dbb26@suse.com>

On Tue, May 20, 2025 at 08:20:16AM +0200, Jan Beulich wrote:
> On 19.05.2025 22:12, dmkhn@proton.me wrote:
> > --- a/xen/arch/arm/vpl011.c
> > +++ b/xen/arch/arm/vpl011.c
> > @@ -78,12 +78,11 @@ static void vpl011_write_data_xen(struct domain *d, uint8_t data)
> >      unsigned long flags;
> >      struct vpl011 *vpl011 = &d->arch.vpl011;
> >      struct vpl011_xen_backend *intf = vpl011->backend.xen;
> > -    struct domain *input = console_get_domain();
> >
> >      VPL011_LOCK(d, flags);
> >
> >      intf->out[intf->out_prod++] = data;
> > -    if ( d == input )
> > +    if ( d->domain_id == console_get_domid() )
> 
> How do you know d isn't a domain different from the one that was the
> console "owner" prior to being destroyed? Original code guaranteed this
> up to ...
> 
> > @@ -123,8 +122,6 @@ static void vpl011_write_data_xen(struct domain *d, uint8_t data)
> >      vpl011_update_interrupt_status(d);
> >
> >      VPL011_UNLOCK(d, flags);
> > -
> > -    console_put_domain(input);
> 
> ... here.

Agreed; I will drop the code change in the next iteration.
Thanks.

> 
> Jan



  reply	other threads:[~2025-05-22  0:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 20:12 [PATCH v3 0/5] xen/console: cleanup console input switch logic dmkhn
2025-05-19 20:12 ` [PATCH v3 1/5] xen/console: rename switch_serial_input() to console_switch_input() dmkhn
2025-05-20  6:07   ` Jan Beulich
2025-05-19 20:12 ` [PATCH v3 2/5] xen/console: introduce console_get_domid() dmkhn
2025-05-20  6:20   ` Jan Beulich
2025-05-22  0:30     ` dmkhn [this message]
2025-05-19 20:12 ` [PATCH v3 3/5] xen/console: introduce console input permission dmkhn
2025-05-19 20:12 ` [PATCH v3 4/5] xen/console: remove max_init_domid dependency dmkhn
2025-05-20  6:28   ` Jan Beulich
2025-05-19 20:12 ` [PATCH v3 5/5] xen/console: rename console_rx to console_domid dmkhn

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=aC5wKu4k6gWvQbKl@kraken \
    --to=dmkhn@proton.me \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dmukhin@ford.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --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.