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

[PATCH v8 15/26] emul/ns16x50: enable emulator


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Wed, 11 Nov 2026 11:47:49 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; 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=aO87XBPCOsw2KMeE0QjjyNNPLKb7he3ta/Gk66oZ8M8=; b=r8QhUZgAoJaOGCTyKN+7zanQSfxf1y6hg8N6+94n0rJ+BQ960PVugZyODAEVb8xqngBrMrQkwFk9mE2HTbQ63YbhrGyQIwYIhFNunMAXqwQlejM43zRCkW6Myvotdad3f+I2oE5EMN2TWjaFd1fmux2olNq1lCgIon785WFvcFfonUxK2kXaXomNQXvRaNydWICbe1HPjbQTsdsvLI5aorYZY/9/oZz9BsREOYtZ7kXHpP7yje9luOfv8+qZcoidUc55+E3oumGG9BoVbOhf3+IK1nS/3kga6DQDMh4DbktbuZKtZ7YqBfJrfPEVO03pEENX50m92qCGy3t2JVb/Hg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s/k1mCEZgDxLIUFVFBYqBEwLY4GFGt5uRRi/5eawiUmq8jJFGep+fq8XC2Gd0AtcJg4dMZ1FvVEGfxlW5dkrZIe2HF2dIrtsdMhGhHvsJ174A9nmi3fwLWJlOS30mnwAT4lL6cgxDf3vD2k0K41JMnTP9CpcH/YRS/9H2FSV+IWgyirzGj32r+G3QCFLaSWrwjm96aQ2DTIpGzJzh7bRkmXZEcNgWT7bTp5XTtEfeQhWpwmFlCezBzm8U5PgF7uzhPKuMYtC7ZMyTAO2gQDOZUXSmbEVXqWzJMmUayuxI58kWIfgqaEC6kUgK5uo6LzG8hTMgy5U6OaTrivrNvq7AA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger@xxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, xakep.amatop@xxxxxxxxx, dmukhin@xxxxxxx, Denis Mukhin <dmukhin@xxxxxxxx>
  • Delivery-date: Wed, 11 Nov 2026 19:48:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx>

Wire emulator to domain creation code.

Introduce a helper `vuart_probe()` call to get the parsed vUART
configuration settings and use it while constructing domain with vUART.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c        | 9 +++++++++
 xen/common/emul/vuart/vuart.c | 8 ++++++++
 xen/include/xen/vuart.h       | 6 ++++++
 3 files changed, 23 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ef9c7cd05777..f4d2fbe75fc6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -29,6 +29,7 @@
 #include <xen/trace.h>
 #include <xen/vm_event.h>
 #include <xen/vpci.h>
+#include <xen/vuart.h>
 #include <xen/wait.h>
 #include <xen/warning.h>
 
@@ -699,6 +700,10 @@ int hvm_domain_initialise(struct domain *d,
     if ( rc != 0 )
         goto fail1;
 
+    rc = vuart_init(d, vuart_probe(d));
+    if ( rc )
+        goto out_vioapic_deinit;
+
     stdvga_init(d);
 
     rtc_init(d);
@@ -722,6 +727,8 @@ int hvm_domain_initialise(struct domain *d,
     return 0;
 
  fail2:
+    vuart_deinit(d);
+ out_vioapic_deinit:
     vioapic_deinit(d);
  fail1:
     if ( is_hardware_domain(d) )
@@ -784,6 +791,8 @@ void hvm_domain_destroy(struct domain *d)
     if ( hvm_funcs.domain_destroy )
         alternative_vcall(hvm_funcs.domain_destroy, d);
 
+    vuart_deinit(d);
+
     vioapic_deinit(d);
 
     XFREE(d->arch.hvm.pl_time);
diff --git a/xen/common/emul/vuart/vuart.c b/xen/common/emul/vuart/vuart.c
index 0df29540b1b6..b2680711ad09 100644
--- a/xen/common/emul/vuart/vuart.c
+++ b/xen/common/emul/vuart/vuart.c
@@ -144,6 +144,14 @@ struct vuart *vuart_find_by_resource(const struct domain 
*d,
     return NULL;
 }
 
+const struct vuart_info *vuart_probe(const struct domain *d)
+{
+    if ( d->domain_id == opt_vuart_domid )
+        return opt_vuart_info;
+
+    return NULL;
+}
+
 int vuart_init(struct domain *d, const struct vuart_info *info)
 {
     const struct vuart_emulator *emulator;
diff --git a/xen/include/xen/vuart.h b/xen/include/xen/vuart.h
index b5785b3c6b8f..43c6759c1f97 100644
--- a/xen/include/xen/vuart.h
+++ b/xen/include/xen/vuart.h
@@ -75,6 +75,7 @@ int vuart_put_rx(const struct domain *d, char c);
 
 #ifdef CONFIG_VUART_FRAMEWORK
 
+const struct vuart_info *vuart_probe(const struct domain *d);
 int vuart_init(struct domain *d, const struct vuart_info *info);
 void vuart_deinit(struct domain *d);
 void vuart_dump_state(const struct domain *d);
@@ -82,6 +83,11 @@ bool domain_has_vuart(const struct domain *d);
 
 #else
 
+static inline const struct vuart_info *vuart_probe(const struct domain *d)
+{
+    return NULL;
+}
+
 static inline int vuart_init(struct domain *d, const struct vuart_info *info)
 {
     return 0;
-- 
2.56.0




 


Rackspace

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