[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

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.


Julien Grall

Xen-devel mailing list



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