]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
x86/domain: remove the 's3_integrity' flag
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 16 Aug 2019 17:19:56 +0000 (18:19 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 23 Aug 2019 12:31:10 +0000 (13:31 +0100)
The flag is not needed since the domain 'options' can now be tested
directly.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: "Roger Pau Monné" <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/setup.c
xen/arch/x86/tboot.c
xen/include/asm-x86/domain.h

index bdaf16cd14407008436db2d5888d4ce0c45680f8..bc082ed82743957b5af32aa584fca06d1687b99b 100644 (file)
@@ -460,6 +460,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( !IS_ENABLED(CONFIG_TBOOT) &&
+         (config->flags & XEN_DOMCTL_CDF_s3_integrity) )
+    {
+        dprintk(XENLOG_INFO, "S3 integrity check not valid without CONFIG_TBOOT\n");
+        return -EINVAL;
+    }
+
     return 0;
 }
 
@@ -538,8 +545,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) )
index 87fc7c90da88e68d8e27f5e5b3d493fef2cc2aed..d0b35b0ce28361132c540b0246492e2c1c726de5 100644 (file)
@@ -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,
index 30d159cc62d734f9a923645b7b598e882783f58a..8263f2400920780f10ca5126dd6b2aa647c1a412 100644 (file)
@@ -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);
 
index 933b85901fd12c720a10a97ac6aee717eae0df37..badf7c892363238c8a45f01d131c58d35fec06f8 100644 (file)
@@ -296,8 +296,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;