|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v8 15/26] emul/ns16x50: enable emulator
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |