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

[PATCH v10 5/5] xen: enable dom0less guests to use console_io hypercalls


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Wed, 4 Feb 2026 15:37:12 -0800
  • 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=3YQTbuJVfM0sef3zdqjvdf8PT/yiTIdcCgsVM88URmI=; b=psa3Xm6kzFK/dlH+RcXG6s18ZyO8Fu+Ql7IVcOhxXqZWhUA2N5PHufdsXVoGDSepSOcCxKn5Hy5gToB2XkBedoqVddlO7ViEPxa07tfzYPCXrYrpCaNkvhG7yLz2BxOCyz8vEOiAAf2PFWEKn5xiHNhG83C4xCjMZDmSHAa/PP9QW55pcHA/G6Dl+JKoziM3Fn8muSPmJslXonoRm+XQYziunVf6jGFuxQ3+5sbOBrg8AAPBq1xOKIEwH0dKl9zkSW7cqV3g5Ky6X/W1IOlYzPLMBuFGTwzpiIUfM+ZfHL/c9OeoyeM5WgFD8dBAJeNzUuuWuuwhmyfdggEBX0y0mg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FliW+oRrlzbj5N4k8TI8NvCkYQvyXTYhokJtgDDR5kzCWfHKAdYMjOhf6aUGznN3yfslFcVIdFVKuIAv0EzGwc1a7JSa4Ki68rlfZSQqkYiKCRikkR5Oh5KU8Nq3Ve0B+4TGiCwAZmTn4gOUI51QZ1iZvQdxwur25aXiovx+HKup4I0kjRhYmrKS720n92d14KuwPPIERfHFp0ucqbRVerBLZ14UWn7vmLlN2P3fgjBS2+jAepD6Sqe22uxm6iTMe9qCuLwHCN1wbwRch0HVPW2udpnmpzu2FjS82kZED9MBtbadgWOTIZx5n5OPAHa7A1390KYe/m1TRSn151Xc+w==
  • Cc: <grygorii_strashko@xxxxxxxx>, <anthony.perard@xxxxxxxxxx>, <michal.orzel@xxxxxxx>, <julien@xxxxxxx>, <roger.pau@xxxxxxxxxx>, <jason.andryuk@xxxxxxx>, <victorm.lira@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <sstabellini@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Wed, 04 Feb 2026 23:37:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>
---
 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 d3ce925131..7f0c3d8376 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -610,11 +610,20 @@ static void __serial_rx(char c)
     if ( ACCESS_ONCE(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;
 
@@ -633,11 +642,6 @@ static void __serial_rx(char c)
          */
         send_guest_domain_virq(d, VIRQ_CONSOLE);
     }
-#ifdef CONFIG_SBSA_VUART_CONSOLE
-    else
-        /* Deliver input to the emulated UART. */
-        rc = vpl011_rx_char_xen(d, c);
-#endif
 
     if ( consoled_is_enabled() )
         /* Deliver input to the PV shim console. */
-- 
2.25.1




 


Rackspace

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