@@ -653,7 +653,7 @@ int paging_domain_init(struct domain *d)
if ( hap_enabled(d) )
hap_domain_init(d);
else
- rc = shadow_domain_init(d, d->options);
+ rc = shadow_domain_init(d);
return rc;
}
@@ -46,7 +46,7 @@ static void sh_clean_dirty_bitmap(struct domain *);
/* Set up the shadow-specific parts of a domain struct at start of day.
* Called for every domain from arch_domain_create() */
-int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+int shadow_domain_init(struct domain *d)
{
static const struct log_dirty_ops sh_ops = {
.enable = sh_enable_log_dirty,
@@ -62,7 +62,6 @@ int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
d->arch.paging.shadow.oos_active = 0;
- d->arch.paging.shadow.oos_off = domcr_flags & XEN_DOMCTL_CDF_oos_off;
#endif
d->arch.paging.shadow.pagetable_dying_op = 0;
@@ -2523,11 +2522,13 @@ static void sh_update_paging_modes(struct vcpu *v)
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
/* We need to check that all the vcpus have paging enabled to
* unsync PTs. */
- if ( is_hvm_domain(d) && !d->arch.paging.shadow.oos_off )
+ if ( !(d->options & XEN_DOMCTL_CDF_oos_off) )
{
int pe = 1;
struct vcpu *vptr;
+ ASSERT(is_hvm_domain(d));
+
for_each_vcpu(d, vptr)
{
if ( !hvm_paging_enabled(vptr) )
@@ -18,7 +18,7 @@ static void _clean_dirty_bitmap(struct domain *d)
ASSERT(is_pv_domain(d));
}
-int shadow_domain_init(struct domain *d, unsigned int domcr_flags)
+int shadow_domain_init(struct domain *d)
{
static const struct log_dirty_ops sh_none_ops = {
.enable = _enable_log_dirty,
@@ -313,11 +313,19 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
return -EINVAL;
}
- if ( !(config->flags & XEN_DOMCTL_CDF_hvm_guest) &&
- (config->flags & XEN_DOMCTL_CDF_hap) )
+ if ( !(config->flags & XEN_DOMCTL_CDF_hvm_guest) )
{
- dprintk(XENLOG_INFO, "HAP enabled for non-HVM guest\n");
- return -EINVAL;
+ if ( config->flags & XEN_DOMCTL_CDF_hap )
+ {
+ dprintk(XENLOG_INFO, "HAP enabled for non-HVM guest\n");
+ return -EINVAL;
+ }
+
+ /*
+ * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
+ * for HVM guests.
+ */
+ config->flags |= XEN_DOMCTL_CDF_oos_off;
}
return arch_sanitise_domain_config(config);
@@ -115,7 +115,6 @@ struct shadow_domain {
/* OOS */
bool_t oos_active;
- bool_t oos_off;
/* Has this domain ever used HVMOP_pagetable_dying? */
bool_t pagetable_dying_op;
@@ -49,7 +49,7 @@
/* Set up the shadow-specific parts of a domain struct at start of day.
* Called from paging_domain_init(). */
-int shadow_domain_init(struct domain *d, unsigned int domcr_flags);
+int shadow_domain_init(struct domain *d);
/* Setup the shadow-specific parts of a vcpu struct. It is called by
* paging_vcpu_init() in paging.c */