[01/10] x86/cpuid: Disallow policy updates once the domain is running
diff mbox

Message ID 1487588434-4359-2-git-send-email-andrew.cooper3@citrix.com
State New, archived
Headers show

Commit Message

Andrew Cooper Feb. 20, 2017, 11 a.m. UTC
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>
---
CC: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/x86/domctl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich Feb. 21, 2017, 4:37 p.m. UTC | #1
>>> On 20.02.17 at 12:00, <andrew.cooper3@citrix.com> wrote:
> 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>

Patch
diff mbox

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 3b5c3c9..fc42cb1 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -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);