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

[PATCH 5/9] x86emul: re-use new stub_exn field in state structure


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 4 Apr 2023 16:53:07 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8OsRmeonhBRsTzr/ndz1lxvEmvcIjQIblEBSSAV+qJQ=; b=iKBBzkhVmSNBmPbbVZtt/9+Bvf6t+CJ5i7fZKksYGXexRcH4AI79VsMXIrWuR10Z0d+Qjgyl8fXOsECQKY2LpLKyLjtmcknw78FkcBPc2wj1Iod5CsYU5Xy+0GN5Wn6EC58XpjWHUZ5FbvmBCrVhd/fB1o828GfDscH5/1cOExqb8pCyDwpLkdsNkCm2j5+aldUNOkuq5+yC3cOCBczbfAjUaw2rNw/mynZqgAXacRJCv1+u1ogtdEpRwPnCitLHbM/HjkC+oqFDeeQZDf7mbKwadV6TZ40dDO3mycH9cgEYWCwKbhorjLLl3Nqwp8/DsoMLM/OTGdw5BKSIB74IzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhnS7sPADdHjgqtZl6OY5N1VFd7TcKOoBUKAX5Wj7HYTQr0lRr6dNea8hpaLZJqAUB93Uu/mKBhDmSrGeqIug0TrqSafATODSiVfXbVWhK6EGrkK1F57nl19RFyCW9wgkRRQZg1MTlzbw1nZhX2hlioGNJ+Oz0dIkAXH8l2F5+rma3aMG80MBzwWU/UXES7yqM69ct5ENwFhvq1D5NN1xlPb52G/XnzI2V5H+LEpywQY+sbbnuPnp0BsonrEgV0m9+HD2jRgAaC9ROz9UUyIgZ52p1KydKEqOOy9X9osP1hOFSGwyQCurOHPR4N+UqsIxaR98UMp2HJkd52mDhZbaA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 04 Apr 2023 14:53:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This can now also be used to reduce the number of parameters
x86emul_fpu() needs to take.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
We could of course set the struct field once early in x86_emulate(), but
for now I think we're better off leaving it as NULL where not actually
needed.

--- a/xen/arch/x86/x86_emulate/fpu.c
+++ b/xen/arch/x86/x86_emulate/fpu.c
@@ -90,9 +90,8 @@ int x86emul_fpu(struct x86_emulate_state
                 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;
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -764,7 +764,6 @@ int x86emul_fpu(struct x86_emulate_state
                 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,
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2058,8 +2058,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
 




 


Rackspace

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