]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/domain: Fix build with GCC 4.3.x
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 29 Oct 2018 11:29:54 +0000 (11:29 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 Oct 2018 13:26:21 +0000 (13:26 +0000)
GCC 4.3.x can't initialise the user_regs structure like this.

Reported-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c

index d63b71c9f9bd180ce87b61db38b124915e9c601d..19692e2193ff6903bd521134e670f07faefbc9f9 100644 (file)
@@ -326,9 +326,8 @@ void free_vcpu_struct(struct vcpu *v)
 /* Initialise various registers to their architectural INIT/RESET state. */
 void arch_vcpu_regs_init(struct vcpu *v)
 {
-    v->arch.user_regs = (typeof(v->arch.user_regs)){
-        .rflags = X86_EFLAGS_MBS,
-    };
+    memset(&v->arch.user_regs, 0, sizeof(v->arch.user_regs));
+    v->arch.user_regs.eflags = X86_EFLAGS_MBS;
 
     memset(v->arch.debugreg, 0, sizeof(v->arch.debugreg));
     v->arch.debugreg[6] = X86_DR6_DEFAULT;