]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86emul: introduce stub_exn field in state structure
authorJan Beulich <jbeulich@suse.com>
Mon, 17 Apr 2023 12:05:13 +0000 (14:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 17 Apr 2023 12:05:13 +0000 (14:05 +0200)
This can be used to reduce the number of parameters x86emul_fpu() needs
to take, and will be re-used subsequently.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/fpu.c
xen/arch/x86/x86_emulate/private.h
xen/arch/x86/x86_emulate/x86_emulate.c

index baa383f9d1b0f6358c82b97ab9afd91535f18264..480d87965705c7cc1e6463f3a27a8ab400229553 100644 (file)
@@ -78,9 +78,8 @@ int x86emul_fpu(struct x86_emulate_state *s,
                 unsigned int *insn_bytes,
                 enum x86_emulate_fpu_type *fpu_type,
 #define fpu_type (*fpu_type) /* for get_fpu() */
-                struct stub_exn *stub_exn,
-#define stub_exn (*stub_exn) /* for invoke_stub() */
                 mmval_t *mmvalp)
+#define stub_exn (*s->stub_exn) /* for invoke_stub() */
 {
     uint8_t b;
     int rc;
index 1a7c17feab10fd3716d7cb04ac83f3a25c21d8b0..0f96eb5fd64023e9bf13527c1cbca9bfd43bdfd5 100644 (file)
@@ -310,6 +310,8 @@ struct x86_emulate_state {
 
     unsigned long ip;
 
+    struct stub_exn *stub_exn;
+
 #ifndef NDEBUG
     /*
      * Track caller of x86_decode_insn() to spot missing as well as
@@ -747,7 +749,6 @@ int x86emul_fpu(struct x86_emulate_state *s,
                 const struct x86_emulate_ops *ops,
                 unsigned int *insn_bytes,
                 enum x86_emulate_fpu_type *fpu_type,
-                struct stub_exn *stub_exn,
                 mmval_t *mmvalp);
 int x86emul_0f01(struct x86_emulate_state *s,
                  struct cpu_user_regs *regs,
index f31611751685318531699ecc19b28b8ca8ace6ef..17b374069cfd537e7b3b4ae3561d6e2900cf46c9 100644 (file)
@@ -2024,8 +2024,9 @@ x86_emulate(
 #ifndef X86EMUL_NO_FPU
     case 0x9b:  /* wait/fwait */
     case 0xd8 ... 0xdf: /* FPU */
+        state->stub_exn = &stub_exn;
         rc = x86emul_fpu(state, &_regs, &dst, &src, ctxt, ops,
-                         &insn_bytes, &fpu_type, &stub_exn, mmvalp);
+                         &insn_bytes, &fpu_type, mmvalp);
         goto dispatch_from_helper;
 #endif