[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9] xen/console: introduce domain_console struct



On Wed, Jul 23, 2025 at 06:24:07PM +0000, dmkhn@xxxxxxxxx wrote:
> On Wed, Jul 23, 2025 at 05:10:04PM +0200, Jan Beulich wrote:
> > On 23.07.2025 02:11, dmkhn@xxxxxxxxx wrote:
> > > @@ -559,7 +559,8 @@ void hvm_do_resume(struct vcpu *v)
> > >  static int cf_check hvm_print_line(
> > >      int dir, unsigned int port, unsigned int bytes, uint32_t *val)
> > >  {
> > > -    struct domain *cd = current->domain;
> > > +    struct domain *d = current->domain;
> > 
> > Why the renaming? (Iff any renaming was needed here, then please to currd.)
> 
> It was requested earlier:
>   https://lore.kernel.org/all/1ac74dd3-e0c5-43e5-9eed-c1a2cc17d068@xxxxxxxx/
> 

What would be the preferred way to address this?

Add `const` to domain pointer?
`s/cd/currd/`? 
`s/cd/d/` like in previous review?
Do not touch `cd`?

It make sense to adjust the code now by at least adding `const`.

> > 
> > > +    struct domain_console *cons = d->console;
> > >      char c = *val;
> > >
> > >      ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
> > > @@ -571,16 +572,21 @@ static int cf_check hvm_print_line(
> > >      if ( !is_console_printable(c) )
> > >          return X86EMUL_OKAY;
> > >
> > > -    spin_lock(&cd->pbuf_lock);
> > > +    rcu_lock_domain(d);
> > 
> > Given this is current->domain, it can't go away, and hence I don't think 
> > this
> > is needed here.
> 
> Ack
> 
> > 
> > Jan
> > 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.