@@ -466,6 +466,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
return -EINVAL;
}
+ if ( (config->flags & XEN_DOMCTL_CDF_s3_integrity) &&
+ !IS_ENABLED(CONFIG_TBOOT) )
+ {
+ dprintk(XENLOG_INFO, "S3 integrity check not valid without CONFIG_TBOOT\n");
+ return -EINVAL;
+ }
+
return 0;
}
@@ -544,8 +551,6 @@ int arch_domain_create(struct domain *d,
d->domain_id);
}
- d->arch.s3_integrity = config->flags & XEN_DOMCTL_CDF_s3_integrity;
-
emflags = config->arch.emulation_flags;
if ( is_hardware_domain(d) && is_pv_domain(d) )
@@ -696,7 +696,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
.stop_bits = 1
};
struct xen_domctl_createdomain dom0_cfg = {
- .flags = XEN_DOMCTL_CDF_s3_integrity,
+ .flags = IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity : 0,
.max_evtchn_port = -1,
.max_grant_frames = opt_max_grant_frames,
.max_maptrack_frames = opt_max_maptrack_frames,
@@ -212,7 +212,7 @@ static void tboot_gen_domain_integrity(const uint8_t key[TB_KEY_SIZE],
vmac_set_key((uint8_t *)key, &ctx);
for_each_domain( d )
{
- if ( !d->arch.s3_integrity )
+ if ( !(d->options & XEN_DOMCTL_CDF_s3_integrity) )
continue;
printk("MACing Domain %u\n", d->domain_id);
@@ -295,8 +295,6 @@ struct arch_domain
uint32_t pci_cf8;
uint8_t cmos_idx;
- bool_t s3_integrity;
-
union {
struct pv_domain pv;
struct hvm_domain hvm;