]> xenbits.xensource.com Git - xen.git/commitdiff
x86/cpuid: Disallow policy updates once the domain is running
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 Feb 2017 15:47:31 +0000 (15:47 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Feb 2017 10:07:53 +0000 (10:07 +0000)
On real hardware, the bulk of CPUID data is system-specific and constant.
Hold the toolstack to the same behaviour when constructing domains.

Values which are expected to change dynamically (e.g. OSXSAVE) are unaffected
and continue to function as before.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c

index 364283e362c2858df94952b2ca16fbf01313e5bb..a3dd27638c5083733d0318927f83d24d0c5ece5c 100644 (file)
@@ -941,6 +941,8 @@ long arch_do_domctl(
     case XEN_DOMCTL_set_cpuid:
         if ( d == currd ) /* no domain_pause() */
             ret = -EINVAL;
+        else if ( d->creation_finished )
+            ret = -EEXIST; /* No changing once the domain is running. */
         else
         {
             domain_pause(d);