hyperv: make overlay pages for SynIC
commit267e071bd6d675c15e7ffbf8aaf44d488ebd5c83
authorRoman Kagan <rkagan@virtuozzo.com>
Fri, 21 Sep 2018 08:22:11 +0000 (21 11:22 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Oct 2018 11:44:14 +0000 (19 13:44 +0200)
treecee516311465fd6a9167a13dd2769e547e8911ea
parent9b4cf107b09d18ac30f46fd1c4de8585ccba030c
hyperv: make overlay pages for SynIC

Per Hyper-V spec, SynIC message and event flag pages are to be
implemented as so called overlay pages.  That is, they are owned by the
hypervisor and, when mapped into the guest physical address space,
overlay the guest physical pages such that

1) the overlaid guest page becomes invisible to the guest CPUs until the
   overlay page is turned off
2) the contents of the overlay page is preserved when it's turned off
   and back on, even at a different address; it's only zeroed at vcpu
   reset

This particular nature of SynIC message and event flag pages is ignored
in the current code, and guest physical pages are used directly instead.
This happens to (mostly) work because the actual guests seem not to
depend on the features listed above.

This patch implements those pages as the spec mandates.

Since the extra RAM regions, which introduce migration incompatibility,
are only added at SynIC object creation which only happens when
hyperv_synic_kvm_only == false, no extra compat logic is necessary.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20180921082217.29481-5-rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/hyperv/hyperv.c
target/i386/hyperv.c