This adds a tiny utility to verify the patch is correct, by printing the sizes of the structures. Compile once on 32bit and once on 64bit, compare the results, it they don't match something is wrong ... Signed-off-by: Gerd Hoffmann Cc: Jan Beulich --- tools/xcutils/Makefile | 1 + tools/xcutils/check-structs.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) Index: build-64-unstable-11624/tools/xcutils/Makefile =================================================================== --- build-64-unstable-11624.orig/tools/xcutils/Makefile +++ build-64-unstable-11624/tools/xcutils/Makefile @@ -27,6 +27,7 @@ CFLAGS += -Wp,-MD,.$(@F).d PROG_DEP = .*.d PROGRAMS = xc_restore xc_save readnotes +PROGRAMS += check-structs LDLIBS = -L$(XEN_LIBXC) -lxenguest -lxenctrl Index: build-64-unstable-11624/tools/xcutils/check-structs.c =================================================================== --- /dev/null +++ build-64-unstable-11624/tools/xcutils/check-structs.c @@ -0,0 +1,32 @@ +#include +#include +#include + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + printf("%-20s %-6s %-6s\n", "struct", "x86_32", "x86_64"); + printf("----------------------------------\n"); + printf("%-20s %6zd %6zd\n", "trap_info_t", + sizeof(trap_info_x86_32_t), + sizeof(trap_info_x86_64_t)); + printf("%-20s %6zd %6zd\n", "cpu_user_regs_t", + sizeof(cpu_user_regs_x86_32_t), + sizeof(cpu_user_regs_x86_64_t)); + printf("%-20s %6zd %6zd\n", "vcpu_guest_context_t", + sizeof(vcpu_guest_context_x86_32_t), + sizeof(vcpu_guest_context_x86_64_t)); + printf("%-20s %6zd %6zd\n", "arch_shared_info_t", + sizeof(arch_shared_info_x86_32_t), + sizeof(arch_shared_info_x86_64_t)); + printf("%-20s %6zd %6zd\n", "arch_vcpu_info_t", + sizeof(arch_vcpu_info_x86_32_t), + sizeof(arch_vcpu_info_x86_64_t)); + printf("%-20s %6zd %6zd\n", "xen_callback_t", + sizeof(xen_callback_x86_32_t), + sizeof(xen_callback_x86_64_t)); + return 0; +} --