[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 2/2] xen: enable dom0less guests to use console_io hypercalls
- To: Stefano Stabellini <stefano.stabellini@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Thu, 29 Jan 2026 20:15:55 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qzcptzbJOo7Yz/i9v0LFtExbw5pxyLcL/Da0og1H+6U=; b=DAT4gxi+vvlQkSmaz1bvUu3X3LJcv5TXXCMSfS56YcONniLsSMVFU9wBaViNsflL/dWbO8kGO6jHhScD0ZEw0ubIpSz0MVNHokyB93F18CLV+WOd9SXnEevJWMMI6EiZd7nSvc8NX4wdQKu00Ygc2y0WPUAXa5KYDqgP+2r2JcEtwqGTsti7MAICCsakqWbdu72L6miJIx2qYBeHz9uBzWbdqQIjdRgBvB/OxdmFC5I2IAuZQJHtCdvPAqVM0RaMPqb/YsKxSuZqRd6bvC0fAElOndOkSCPZrTaAf9YuxfGkcy3sXpstEuUrw4UbhfPjV+MQIgH6Af0YoD38bIgPJA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BxCcdxyppVZAOFMTimCpS5k6nCKiO33UjhEulJRVDwreyFgqRTgEORv3YcJb9Kt44GAUgBuG1FywDX7Y2cDDD25UtSKOQcbtIzMaq0ogYP+wGTCC/edGknFVVuUkKVVF8R6t0JZyuZ3PHyY+IcJ800y96klt4q5JEb+Sa+GYIOf8tKyfMe91jtZjlH9/MEUB65J/fdAa4r48ltKXrZbhvGoxfwBfBJFaMHrnBXF8PRu89tNZAfB6cCRhRVt64hjMqZwnUwMTPwKTpp6j3nAQjr1OsunXJLuNk1KBA5k2CSwJQpPK/0WMLVTPgjTx6AkgMW8IDjcp+0hywn8tRJ6kLQ==
- Cc: <grygorii_strashko@xxxxxxxx>, <anthony.perard@xxxxxxxxxx>, <michal.orzel@xxxxxxx>, <julien@xxxxxxx>, <roger.pau@xxxxxxxxxx>, <victorm.lira@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <sstabellini@xxxxxxxxxx>
- Delivery-date: Fri, 30 Jan 2026 01:16:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2026-01-29 17:08, Stefano Stabellini wrote:
Enable dom0less guests on ARM to use console_io hypercalls:
- set input_allow = true for dom0less domains
- update the in-code comment in console.c
- prioritize the VUART check to retain the same behavior as today
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
Changes in v8:
- move in-code comment update to previous patch
- add in-code comment about is_focus_domain() check
---
xen/common/device-tree/dom0less-build.c | 2 ++
xen/drivers/char/console.c | 16 ++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/xen/common/device-tree/dom0less-build.c
b/xen/common/device-tree/dom0less-build.c
index 840d14419d..cb7026fa7e 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -829,6 +829,8 @@ static int __init construct_domU(struct kernel_info *kinfo,
rangeset_destroy(kinfo->xen_reg_assigned);
+ d->console->input_allowed = true;
+
return rc;
}
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ed8f1ad8f2..418d194cef 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -613,11 +613,20 @@ static void __serial_rx(char c)
if ( console_rx == 0 )
return handle_keypress(c, false);
+ /* Includes an is_focus_domain() check. */
d = console_get_domain();
if ( !d )
return;
- if ( is_hardware_domain(d) )
+#ifdef CONFIG_SBSA_VUART_CONSOLE
+ /* Prioritize vpl011 if enabled for this domain */
+ if ( d->arch.vpl011.base_addr )
+ {
+ /* Deliver input to the emulated UART. */
+ rc = vpl011_rx_char_xen(d, c);
+ }
+ else
+#endif
{
unsigned long flags;
@@ -636,11 +645,6 @@ static void __serial_rx(char c)
*/
send_global_virq(VIRQ_CONSOLE);
I think we need an additional patch, or included in one of these two, to
change VIRQ_CONSOLE to a VIRQ_DOMAIN. Otherwise only hwdom could bind
to the virq, I think? It would be the two changes below:
Regards,
Jason
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 67700b050a..dab123f20d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -138,6 +138,7 @@ static enum virq_type get_virq_type(unsigned int virq)
return VIRQ_VCPU;
case VIRQ_ARGO:
+ case VIRQ_CONSOLE:
return VIRQ_DOMAIN;
case VIRQ_ARCH_0 ... VIRQ_ARCH_7:
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 903ad912cc..138eeaa14d 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -611,7 +611,7 @@ static void __serial_rx(char c)
* Always notify the hardware domain: prevents receive path from
* getting stuck.
*/
- send_global_virq(VIRQ_CONSOLE);
+ send_guest_domain_virq(d, VIRQ_CONSOLE);
}
#ifdef CONFIG_SBSA_VUART_CONSOLE
else
|