libxc/restore: STATIC_DATA_END inference for v2 compatibility
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 16 Dec 2019 19:03:14 +0000 (19:03 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 May 2020 16:33:03 +0000 (17:33 +0100)
commit4f8b684117f7e6cc02dfbb21cde15aa431259d2c
tree213a5a7f4f6d78a2565f325e42ea8a495f65a765
parent6501e46ca797d445253ee48974220d939ae9ec4f
libxc/restore: STATIC_DATA_END inference for v2 compatibility

A v3 stream can compatibly read a v2 stream by inferring the position of the
STATIC_DATA_END record.

v2 compatibility is only needed for x86.  No other architectures exist yet,
but they will have a minimum of v3 when introduced.

The x86 HVM compatibility point being in handle_page_data() (which is common
code) is a bit awkward.  However, as the two compatibility points are subtly
different, and it is (intentionally) not possible to call into arch specific
code from common code (except via the ops hooks), use some #ifdef-ary and
opencode the check, rather than make handle_page_data() a per-arch helper.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/include/xenguest.h
tools/libxc/xc_sr_common.h
tools/libxc/xc_sr_restore.c
tools/libxc/xc_sr_restore_x86_pv.c