[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/FPU: make vcpu_reset_fpu() build with old gcc



commit d636e0ed911234d7eca53777496203e83bb45505
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Dec 10 18:03:38 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Dec 10 18:03:38 2024 +0100

    x86/FPU: make vcpu_reset_fpu() build with old gcc
    
    Fields of anonymous structs/unions may not be part of an initializer for
    rather old gcc (4.6 and earlier).
    
    Fixes: 49a068471d77 ("x86/fpu: Rework fpu_setup_fpu() uses to split it in 
two")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
---
 xen/arch/x86/i387.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 3add0025e4..8fba0aef42 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -306,13 +306,13 @@ void vcpu_reset_fpu(struct vcpu *v)
 {
     v->fpu_initialised = false;
     *v->arch.xsave_area = (struct xsave_struct) {
-        .fpu_sse = {
-            .mxcsr = MXCSR_DEFAULT,
-            .fcw = FCW_RESET,
-            .ftw = FXSAVE_FTW_RESET,
-        },
         .xsave_hdr.xstate_bv = X86_XCR0_X87,
     };
+
+    /* Old gcc doesn't permit these to be part of the initializer. */
+    v->arch.xsave_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
+    v->arch.xsave_area->fpu_sse.fcw = FCW_RESET;
+    v->arch.xsave_area->fpu_sse.ftw = FXSAVE_FTW_RESET;
 }
 
 void vcpu_setup_fpu(struct vcpu *v, const void *data)
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.