@@ -119,8 +119,17 @@ struct arch_domain
void *tee;
#endif
+ /* Emulated devices enabled bitmap. */
+ uint32_t emulation_flags;
+
} __cacheline_aligned;
+enum {
+ ARM_EMU_VUART = BIT(0, U),
+};
+
+#define domain_has_vuart(d) (!!((d)->arch.emulation_flags & ARM_EMU_VUART))
+
struct arch_vcpu
{
struct {
@@ -730,6 +730,8 @@ int domain_vpl011_init(struct domain *d, struct vpl011_init_info *info)
register_mmio_handler(d, &vpl011_mmio_handler,
vpl011->base_addr, GUEST_PL011_SIZE, NULL);
+ d->arch.emulation_flags |= ARM_EMU_VUART;
+
return 0;
out1:
@@ -31,8 +31,6 @@
#include "vuart.h"
-#define domain_has_vuart(d) ((d)->arch.vuart.info != NULL)
-
static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
register_t *r, void *priv);
static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
@@ -63,6 +61,8 @@ int domain_vuart_init(struct domain *d)
d->arch.vuart.info->size,
NULL);
+ d->arch.emulation_flags |= ARM_EMU_VUART;
+
return 0;
}