diff mbox series

[RFC,v2,05/10] x86: Keep a copy of XSAVE area size

Message ID 20250102084413.102-6-ngoc-tu.dinh@vates.tech (mailing list archive)
State New
Headers show
Series Virtualize architectural LBRs | expand

Commit Message

Tu Dinh Jan. 2, 2025, 8:45 a.m. UTC
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 xen/arch/x86/include/asm/domain.h | 1 +
 xen/arch/x86/xstate.c             | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index b79d6badd7..d3f2695c20 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -638,6 +638,7 @@  struct arch_vcpu
      * #NM handler, we XRSTOR the states we XSAVE-ed;
      */
     struct xsave_struct *xsave_area;
+    unsigned int xsave_area_size;
     uint64_t xcr0;
     /* Accumulated eXtended features mask for using XSAVE/XRESTORE by Xen
      * itself, as we can never know whether guest OS depends on content
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index af9e345a7a..baae8e1a13 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -550,6 +550,7 @@  int xstate_alloc_save_area(struct vcpu *v)
     save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
 
     v->arch.xsave_area = save_area;
+    v->arch.xsave_area_size = size;
     v->arch.xcr0 = 0;
     v->arch.xcr0_accum = 0;