vcpu: add missing dummy_vcpu_info to compat VCPUOP_initialise
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 6 Oct 2015 15:38:41 +0000 (17:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 Oct 2015 15:38:41 +0000 (17:38 +0200)
This check is missing from the compat version when compared to the
non-compat version.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
xen/common/compat/domain.c
xen/common/domain.c
xen/include/xen/shared.h

index 3ca4ef7329ff750144070491979a5e7eea310ccf..157570a97e47daf1258592532f86c3921501ea70 100644 (file)
@@ -38,6 +38,9 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     {
         struct compat_vcpu_guest_context *cmp_ctxt;
 
+        if ( v->vcpu_info == &dummy_vcpu_info )
+            return -EINVAL;
+
         if ( (cmp_ctxt = xmalloc(struct compat_vcpu_guest_context)) == NULL )
         {
             rc = -ENOMEM;
index 7c362eb3cf25c87b9bb41f00ce0be8266afb7dae..b0378aa98b75b92fdf37c1f4d8b0f36cfb305f62 100644 (file)
@@ -70,7 +70,7 @@ integer_param("hardware_dom", hardware_domid);
 
 struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
-static vcpu_info_t dummy_vcpu_info;
+vcpu_info_t dummy_vcpu_info;
 
 static void __domain_finalise_shutdown(struct domain *d)
 {
index 3f5b2835d5b0ec3361320473a6c7944f783b378a..a411a8a3e38d5bbf9bdd58c5be1490ac4460135c 100644 (file)
@@ -41,6 +41,8 @@ typedef struct vcpu_info vcpu_info_t;
 
 #endif
 
+extern vcpu_info_t dummy_vcpu_info;
+
 #define shared_info(d, field)      __shared_info(d, (d)->shared_info, field)
 #define vcpu_info(v, field)        __vcpu_info(v, (v)->vcpu_info, field)