From eb68c40ba5d0212adc176290f09e4ee133c96e83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Tue, 19 Jan 2016 16:08:39 +0100 Subject: [PATCH] x86/HVM: add padding to struct hvm_hw_cpu MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit So that the size of the structure is the same on 32 and 64bit. Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper --- xen/arch/x86/hvm/hvm.c | 3 +++ xen/include/public/arch-x86/hvm/save.h | 1 + 2 files changed, 4 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index e0cb82d2a3..8f98956e30 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1987,6 +1987,9 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) if ( hvm_load_entry_zeroextend(CPU, h, &ctxt) != 0 ) return -EINVAL; + if ( ctxt.pad0 != 0 ) + return -EINVAL; + /* Sanity check some control registers. */ if ( (ctxt.cr0 & HVM_CR0_GUEST_RESERVED_BITS) || !(ctxt.cr0 & X86_CR0_ET) || diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h index b6b1bf894b..6862720137 100644 --- a/xen/include/public/arch-x86/hvm/save.h +++ b/xen/include/public/arch-x86/hvm/save.h @@ -163,6 +163,7 @@ struct hvm_hw_cpu { #define _XEN_X86_FPU_INITIALISED 0 #define XEN_X86_FPU_INITIALISED (1U<<_XEN_X86_FPU_INITIALISED) uint32_t flags; + uint32_t pad0; }; struct hvm_hw_cpu_compat { -- 2.39.5