@@ -47,6 +47,7 @@ type x86_arch_emulation_flags =
| X86_EMU_PIT
| X86_EMU_USE_PIRQ
| X86_EMU_VPCI
+ | X86_EMU_VUART
type x86_arch_misc_flags =
| X86_MSR_RELAXED
@@ -41,6 +41,7 @@ type x86_arch_emulation_flags =
| X86_EMU_PIT
| X86_EMU_USE_PIRQ
| X86_EMU_VPCI
+ | X86_EMU_VUART
type x86_arch_misc_flags =
| X86_MSR_RELAXED
@@ -752,6 +752,10 @@ static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
if ( is_hardware_domain(d) &&
emflags != (X86_EMU_VPCI | X86_EMU_LAPIC | X86_EMU_IOAPIC) )
return false;
+
+ /* FIXME: remove once virtual UART is configurable via xl */
+ emflags &= ~XEN_X86_EMU_VUART;
+
if ( !is_hardware_domain(d) &&
xen_emflags_allowable(emflags) != XEN_X86_EMU_BASELINE &&
emflags != X86_EMU_LAPIC )
@@ -804,6 +808,12 @@ int arch_domain_create(struct domain *d,
emflags = config->arch.emulation_flags;
+ /* FIXME: enable virtual UART for all HVMs; must be configurable via xl */
+ if ( IS_ENABLED(CONFIG_HAS_VUART) && is_hvm_domain(d) )
+ emflags |= XEN_X86_EMU_VUART;
+ else
+ emflags &= ~XEN_X86_EMU_VUART;
+
if ( is_hardware_domain(d) && is_pv_domain(d) )
emflags |= XEN_X86_EMU_PIT;
@@ -485,7 +485,8 @@ struct arch_domain
#define X86_EMU_VPCI 0
#endif
-#define X86_EMU_PIT XEN_X86_EMU_PIT
+#define X86_EMU_PIT XEN_X86_EMU_PIT
+#define X86_EMU_VUART XEN_X86_EMU_VUART
/* This must match XEN_X86_EMU_ALL in xen.h */
#define X86_EMU_ALL (X86_EMU_LAPIC | X86_EMU_HPET | \
@@ -493,7 +494,7 @@ struct arch_domain
X86_EMU_IOAPIC | X86_EMU_PIC | \
X86_EMU_VGA | X86_EMU_IOMMU | \
X86_EMU_PIT | X86_EMU_USE_PIRQ | \
- X86_EMU_VPCI)
+ X86_EMU_VPCI | X86_EMU_VUART)
#define has_vlapic(d) (!!((d)->arch.emulation_flags & X86_EMU_LAPIC))
#define has_vhpet(d) (!!((d)->arch.emulation_flags & X86_EMU_HPET))
@@ -32,17 +32,19 @@ enum {
#define XEN_X86_EMU_PIT VIRTDEV_PIT
#define XEN_X86_EMU_USE_PIRQ VIRTDEV_PIRQ
#define XEN_X86_EMU_VPCI VIRTDEV_PCI
+#define XEN_X86_EMU_VUART VIRTDEV_UART
#define XEN_X86_EMU_ALL (XEN_X86_EMU_LAPIC | XEN_X86_EMU_HPET | \
XEN_X86_EMU_PM | XEN_X86_EMU_RTC | \
XEN_X86_EMU_IOAPIC | XEN_X86_EMU_PIC | \
XEN_X86_EMU_VGA | XEN_X86_EMU_IOMMU | \
XEN_X86_EMU_PIT | XEN_X86_EMU_USE_PIRQ |\
- XEN_X86_EMU_VPCI)
+ XEN_X86_EMU_VPCI | XEN_X86_EMU_VUART)
/* PIRQ (HVM) feature is user-selectable (libxl). */
#define XEN_X86_EMU_OPTIONAL (XEN_X86_EMU_VPCI | \
- XEN_X86_EMU_USE_PIRQ)
+ XEN_X86_EMU_USE_PIRQ | \
+ XEN_X86_EMU_VUART)
#define XEN_X86_EMU_BASELINE xen_emflags_allowable(XEN_X86_EMU_ALL)