mem_sharing: reset a fork
authorTamas K Lengyel <tamas.lengyel@intel.com>
Wed, 8 Apr 2020 11:03:50 +0000 (13:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Apr 2020 11:03:50 +0000 (13:03 +0200)
commitc8dbdb32cef8e8ef796c925e91e347ea83735790
treee6b98ec87e95a38bcfce38e2167b74692bac7b4b
parent41548c5472a3ea514cb0173f2576096970358263
mem_sharing: reset a fork

Implement hypercall that allows a fork to shed all memory that got allocated
for it during its execution and re-load its vCPU context from the parent VM.
This allows the forked VM to reset into the same state the parent VM is in a
faster way then creating a new fork would be. Measurements show about a 2x
speedup during normal fuzzing operations. Performance may vary depending how
much memory got allocated for the forked VM. If it has been completely
deduplicated from the parent VM then creating a new fork would likely be more
performant.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/mem_sharing.c
xen/include/public/memory.h