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

[PATCH v8 2/2] xen: enable dom0less guests to use console_io hypercalls


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Thu, 29 Jan 2026 14:08:58 -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=yhb/Ct6/30TNWJ4dGiIhm+GmR7yGbSpklZW15TSwm7s=; b=iaCv0X5WuagjICWfF0z3kGoymyg8lyTzGmaAArbguzQmf3S4+1kjH/LVGQUD49FFcQuW1d3mOzazzyMiySVNFF5PbRYCpJEUYd6FQT818h1LgPoTaooUH9E05nVYVRUHzTYiFpNaxYbXlpnkJwmpggb4gtyZElWwdw1f8zedvfwWIP8N6mf0VVEw0OjKVtdNWSQ7rhY4TSV6jBjNwJmCgyBSmcdN1ZD+F8E7n2ojb5CTqAgUTPa01K2Rn816KVz7VnVFZpKQi9jYlvaMc5hYAHHefQnPBiLn9xuaYHT2Gozz7JmmESFwrJBtRwHKJmJjsDOsUfD+0jwadkXlJHX0OA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JD2c9eo7wUG/bFMa9k7TZ3gN+nNe5BXSLgKnswbbXaLXRRMALfCIvuSEx3cqsc7y8T4IQaCtx56ZIOSBiynA8Rui0J5d8z3yftm8MqwZIC57b9QSYaVA0R1V74IchqK2Cb5Y3SdJ81Mof4Wrw5RzGJcC969yeP0pKf7MXUABFW01O70A57Whmbp9jFAAh3J5ySTulxSG4nIPvzm+OEIn3T8uOCaDf8sB3VPR1r9VCgw+mYHwwsB/DzOfxdXwRg9reCFHx4VKDz7raotL2Rr9erOSoJV3w/A3ufGbqEK2IuR+qN/lYfz6xnIp2dfBXSX69AjI+aVkGS1faNHusAUW0Q==
  • 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: Thu, 29 Jan 2026 22:09:14 +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>
---
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);
     }
-#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®.