x86/shim: fix ballooning up the guest
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Thu, 9 Apr 2020 08:13:45 +0000 (10:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Apr 2020 08:13:45 +0000 (10:13 +0200)
args.preempted is meaningless here as it doesn't signal whether the
hypercall was preempted before. Use start_extent instead which is
correct (as long as the hypercall was invoked in a "normal" way).

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: 76dbabb59eeaa78e9f57407e5b15a6606488333e
master date: 2020-03-18 12:55:54 +0100

xen/common/memory.c

index dee85f149661e7eb5415ad108fb7d9ebcdc1fcdc..312a8ec91c50e999e67892df3b88cb477ff6ff04 100644 (file)
@@ -1128,8 +1128,8 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         }
 
 #ifdef CONFIG_X86
-        if ( pv_shim && op != XENMEM_decrease_reservation && !args.preempted )
-            /* Avoid calling pv_shim_online_memory when preempted. */
+        if ( pv_shim && op != XENMEM_decrease_reservation && !start_extent )
+            /* Avoid calling pv_shim_online_memory when in a continuation. */
             pv_shim_online_memory(args.nr_extents, args.extent_order);
 #endif