Every arch handles this the same way, so move it to the common code.
This will also make unifying the sim_cpu structure easier.
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-07  Jim Wilson  <jimw@sifive.com>
 
        PR sim/27483
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* Perform the initialization steps one by one.  */
-  if (sim_cpu_alloc_all (sd, 1, 0) != SIM_RC_OK
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK
       || sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK
       || sim_parse_args (sd, argv) != SIM_RC_OK
       || sim_analyze_program (sd,
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * wrapper.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * bpf.c (bpf_def_model_init): Use new-style declaration.
 
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ())
-      != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     goto error;
 
   if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-cpu.c (sim_cpu_alloc_all): Delete 3rd arg.  Delete 2nd arg to
+       sim_cpu_alloc.
+       (sim_cpu_alloc): Move extra_bytes to local var.  Add result of
+       cgen_cpu_max_extra_bytes.
+       * sim-cpu.h (sim_cpu_alloc_all): Delete 3rd arg.
+       (sim_cpu_alloc): Delete 2nd arg.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * cgen-utils.c (RORQI, ROLQI, RORHI, ROLHI, RORSI, ROLSI): Use
 
 #include "bfd.h"
 
 /* Allocate space for all cpus in the simulator.
-   Space for the cpu must currently exist prior to parsing ARGV.
-   EXTRA_BYTES is additional space to allocate for the sim_cpu struct.  */
+   Space for the cpu must currently exist prior to parsing ARGV.  */
 /* ??? wip.  better solution must wait.  */
 
 SIM_RC
-sim_cpu_alloc_all (SIM_DESC sd, int ncpus, int extra_bytes)
+sim_cpu_alloc_all (SIM_DESC sd, int ncpus)
 {
   int c;
 
   for (c = 0; c < ncpus; ++c)
-    STATE_CPU (sd, c) = sim_cpu_alloc (sd, extra_bytes);
+    STATE_CPU (sd, c) = sim_cpu_alloc (sd);
   return SIM_RC_OK;
 }
 
    EXTRA_BYTES is additional space to allocate for the sim_cpu struct.  */
 
 sim_cpu *
-sim_cpu_alloc (SIM_DESC sd, int extra_bytes)
+sim_cpu_alloc (SIM_DESC sd)
 {
+  int extra_bytes = 0;
+
+#ifdef CGEN_ARCH
+  extra_bytes += cgen_cpu_max_extra_bytes ();
+#endif
+
   return zalloc (sizeof (sim_cpu) + extra_bytes);
 }
 
 
 } sim_cpu_base;
 
 /* Create all cpus.  */
-extern SIM_RC sim_cpu_alloc_all (SIM_DESC, int, int);
+extern SIM_RC sim_cpu_alloc_all (SIM_DESC, int);
 /* Create a cpu.  */
-extern sim_cpu *sim_cpu_alloc (SIM_DESC, int);
+extern sim_cpu *sim_cpu_alloc (SIM_DESC);
 /* Release resources held by all cpus.  */
 extern void sim_cpu_free_all (SIM_DESC);
 /* Release resources held by a cpu.  */
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * traps.c: Include stdlib.h.
 
   bfd_byte sp_init[4] = {0, 0, 0, 0};
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-03  Mike Frysinger  <vapier@gentoo.org>
 
        * configure.ac, interp.c, Makefile.in, README, README.arch-spec,
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * traps.c: Include stdlib.h.
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_DESC sd = sim_state_alloc (kind, cb);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * compile.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * compile.c (init_pointers): Fix sequence point warning.
 
   sd = sim_state_alloc (kind, callback);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * iq2000.c: Include stdlib.h.
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * sim-if.c (sim_open, sim_create_inferior): Use new-style
 
   unsigned long base, limit;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Tom Tromey  <tom@tromey.com>
 
        * traps.c: Include stdlib.h.
 
   int i;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Makefile.in: Set ASAN_OPTIONS when running igen.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     return 0;
 
   cpu = STATE_CPU (sd, 0); /* FIXME */
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Makefile.in: Set ASAN_OPTIONS when running igen.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     return 0;
 
   /* for compatibility */
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Luis Machado  <luis.machado@linaro.org>
 
        * Makefile.in (moxie-gdb.dtb): Add maintainer mode dependency.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * msp430-sim.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
 
   /* Initialise the simulator.  */
 
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       sim_state_free (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   int i;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * aclocal.m4, configure: Regenerate.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
 
+2021-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (sim_open): Delete 3rd arg to sim_cpu_alloc_all.
+
 2021-04-08  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * Makefile.in: Set ASAN_OPTIONS when running igen.
 
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     return 0;
 
   /* for compatibility */