@@ -238,6 +238,8 @@ void __init pv_shim_setup_dom(struct domain *d, l4_pgentry_t *l4start,
* guest from depleting the shim memory pool.
*/
d->max_pages = domain_tot_pages(d);
+
+ d->is_console = true;
}
static void write_start_info(struct domain *d)
@@ -682,6 +682,8 @@ struct domain *domain_create(domid_t domid,
old_hwdom = hardware_domain;
hardware_domain = d;
+
+ d->is_console = true;
}
TRACE_TIME(TRC_DOM0_DOM_ADD, d->domain_id);
@@ -818,6 +820,18 @@ struct domain *domain_create(domid_t domid,
memcpy(d->handle, config->handle, sizeof(d->handle));
+ /*
+ * Housekeeping for physical console forwarding to the domain.
+ */
+ if ( !is_system_domain(d) && max_init_domid < domid )
+ max_init_domid = domid;
+
+ /*
+ * NB: flag is already set for PV shim and hardware domain, check whether
+ * virtual UART is present.
+ */
+ d->is_console |= domain_has_vuart(d);
+
return d;
fail:
@@ -1,8 +1,8 @@
/******************************************************************************
* console.c
- *
+ *
* Emergency console I/O for Xen and the domain-0 guest OS.
- *
+ *
* Copyright (c) 2002-2004, K A Fraser.
*
* Added printf_ratelimit
@@ -509,14 +509,20 @@ static void console_find_owner(void)
domid = get_initial_domain_id();
else
domid = next_rx - 1;
+
d = rcu_lock_domain_by_id(domid);
- if ( d )
+ if ( d == NULL )
+ continue;
+
+ if ( d->is_console )
{
rcu_unlock_domain(d);
console_owner = next_rx;
printk("*** Serial input to DOM%u", domid);
break;
}
+
+ rcu_unlock_domain(d);
}
if ( switch_code )
@@ -814,7 +820,7 @@ static int printk_prefix_check(char *p, char **pp)
return ((atomic_read(&print_everything) != 0) ||
(loglvl < lower_thresh) ||
((loglvl < upper_thresh) && printk_ratelimit()));
-}
+}
static int cf_check parse_console_timestamps(const char *s)
{