[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 21/23] xen/vpl011: buffer out chars when the backend is xen
On Sat, 20 Oct 2018, Julien Grall wrote: > Hi Stefano, > > On 10/20/18 12:20 AM, Stefano Stabellini wrote: > > On Mon, 8 Oct 2018, Jan Beulich wrote: > > > > > > On 05.10.18 at 20:47, <sstabellini@xxxxxxxxxx> wrote: > > > > --- a/xen/drivers/char/console.c > > > > +++ b/xen/drivers/char/console.c > > > > @@ -406,6 +406,13 @@ static void dump_console_ring_key(unsigned char > > > > key) > > > > */ > > > > static unsigned int __read_mostly console_rx = 0; > > > > +struct domain *console_input_domain(void) > > > > +{ > > > > + if ( console_rx == 0 ) > > > > + return NULL; > > > > + return get_domain_by_id(console_rx - 1); > > > > > > This acquires a domain reference, yet I can't see that reference > > > getting dropped anywhere in the caller. > > > > Well spotted! > > > > I'll add a comment here as a reminder, and I'll drop the domain > > reference in the caller (xen/arch/arm/vpl011.c:vpl011_write_data_xen). > > Why do you use get_domain_by_id() and not rcu_lock_domain_by_id()? The latter > is recommend for short live reference. Yes, you are right, that is a better solution. I'll change it to use rcu_lock_domain_by_id. We still need the corresponding rcu_unlock_domain call, so I'll still add a new comment and the corresponding unlock call. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |