v->arch.hcr_el2 |= HCR_RW;
}
+int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+{
+ /* Fill in the native GIC version, passed back to the toolstack. */
+ if ( config->arch.gic_version == XEN_DOMCTL_CONFIG_GIC_NATIVE )
+ {
+ switch ( gic_hw_version() )
+ {
+ case GIC_V2:
+ config->arch.gic_version = XEN_DOMCTL_CONFIG_GIC_V2;
+ break;
+
+ case GIC_V3:
+ config->arch.gic_version = XEN_DOMCTL_CONFIG_GIC_V3;
+ break;
+
+ default:
+ ASSERT_UNREACHABLE();
+ return -EINVAL;
+ }
+ }
+
+ return 0;
+}
+
int arch_domain_create(struct domain *d,
struct xen_domctl_createdomain *config)
{
switch ( config->arch.gic_version )
{
- case XEN_DOMCTL_CONFIG_GIC_NATIVE:
- switch ( gic_hw_version () )
- {
- case GIC_V2:
- config->arch.gic_version = XEN_DOMCTL_CONFIG_GIC_V2;
- d->arch.vgic.version = GIC_V2;
- break;
-
- case GIC_V3:
- config->arch.gic_version = XEN_DOMCTL_CONFIG_GIC_V3;
- d->arch.vgic.version = GIC_V3;
- break;
-
- default:
- BUG();
- }
- break;
-
case XEN_DOMCTL_CONFIG_GIC_V2:
d->arch.vgic.version = GIC_V2;
break;
break;
default:
- rc = -EOPNOTSUPP;
- goto fail;
+ BUG();
}
if ( (rc = domain_vgic_register(d, &count)) != 0 )
int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity);
void domain_update_node_affinity(struct domain *d);
+/*
+ * To be implemented by each architecture, sanity checking the configuration
+ * and filling in any appropriate defaults.
+ */
+int arch_sanitise_domain_config(struct xen_domctl_createdomain *config);
+
/*
* Create a domain: the configuration is only necessary for real domain
* (domid < DOMID_FIRST_RESERVED).