[PATCH 00/27] target/ppc: SPR registration cleanups

Fabiano Rosas posted 27 patches 2 years, 2 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220215214148.1848266-1-farosas@linux.ibm.com
Maintainers: Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>
There is a newer version of this series
target/ppc/cpu.h         |   57 ++
target/ppc/cpu_init.c    | 1901 ++++++++++++--------------------------
target/ppc/helper_regs.c |  402 ++++++++
target/ppc/spr_tcg.h     |   65 ++
4 files changed, 1115 insertions(+), 1310 deletions(-)
[PATCH 00/27] target/ppc: SPR registration cleanups
Posted by Fabiano Rosas 2 years, 2 months ago
The goal of this series is to do some untangling of SPR registration
code in cpu_init.c and prepare for moving the CPU initialization into
separate files for each CPU family.

The first 23 patches are all simple cleanups:
 - Remove unnecessary comments/code;
 - Reuse some pieces of code where it makes sense;
 - Group spr_register calls;
 - Remove bare spr_register calls from init_proc;
 - Separate code that affects different CPU families;

The last 4 patches move common SPR registration routines out of
cpu_init.c so that the cpu-specific code that uses them can move to
other files.

After this series we'll have only cpu-specific SPR code in cpu_init.c,
i.e. code that can be split and moved as a unit into other
files. Common/generic SPR code will be in helper_regs.c, exposed via
spr_tcg.h.

This series is based on legoater/ppc7.0.

Fabiano Rosas (27):
  target/ppc: cpu_init: Remove not implemented comments
  target/ppc: cpu_init: Remove G2LE init code
  target/ppc: cpu_init: Group registration of generic SPRs
  target/ppc: cpu_init: Move Timebase registration into the common
    function
  target/ppc: cpu_init: Avoid nested SPR register functions
  target/ppc: cpu_init: Move 405 SPRs into register_405_sprs
  target/ppc: cpu_init: Move G2 SPRs into register_G2_sprs
  target/ppc: cpu_init: Decouple G2 SPR registration from 755
  target/ppc: cpu_init: Decouple 74xx SPR registration from 7xx
  target/ppc: cpu_init: Deduplicate 440 SPR registration
  target/ppc: cpu_init: Deduplicate 603 SPR registration
  target/ppc: cpu_init: Deduplicate 604 SPR registration
  target/ppc: cpu_init: Deduplicate 7xx SPR registration
  target/ppc: cpu_init: Deduplicate 755 SPR registration
  target/ppc: cpu_init: Move 755 L2 cache SPRs into a function
  target/ppc: cpu_init: Move e300 SPR registration into a function
  target/ppc: cpu_init: Move 604e SPR registration into a function
  target/ppc: cpu_init: Reuse init_proc_603 for the e300
  target/ppc: cpu_init: Reuse init_proc_604 for the 604e
  target/ppc: cpu_init: Reuse init_proc_745 for the 755
  target/ppc: cpu_init: Rename software TLB function
  target/ppc: cpu_init: Rename register_ne_601_sprs
  target/ppc: cpu_init: Remove register_usprg3_sprs
  target/ppc: cpu_init: Expose some SPR registration helpers
  target/ppc: cpu_init: Move SPR registration macros to a header
  target/ppc: cpu_init: Move check_pow and QOM macros to a header
  target/ppc: Move common SPR functions out of cpu_init

 target/ppc/cpu.h         |   57 ++
 target/ppc/cpu_init.c    | 1901 ++++++++++++--------------------------
 target/ppc/helper_regs.c |  402 ++++++++
 target/ppc/spr_tcg.h     |   65 ++
 4 files changed, 1115 insertions(+), 1310 deletions(-)

-- 
2.34.1


Re: [PATCH 00/27] target/ppc: SPR registration cleanups
Posted by David Gibson 2 years, 2 months ago
On Tue, Feb 15, 2022 at 06:41:21PM -0300, Fabiano Rosas wrote:
> The goal of this series is to do some untangling of SPR registration
> code in cpu_init.c and prepare for moving the CPU initialization into
> separate files for each CPU family.
> 
> The first 23 patches are all simple cleanups:
>  - Remove unnecessary comments/code;
>  - Reuse some pieces of code where it makes sense;
>  - Group spr_register calls;
>  - Remove bare spr_register calls from init_proc;
>  - Separate code that affects different CPU families;
> 
> The last 4 patches move common SPR registration routines out of
> cpu_init.c so that the cpu-specific code that uses them can move to
> other files.
> 
> After this series we'll have only cpu-specific SPR code in cpu_init.c,
> i.e. code that can be split and moved as a unit into other
> files. Common/generic SPR code will be in helper_regs.c, exposed via
> spr_tcg.h.

These are some very nice cleanups, and rather overdue.  You've also
done a great job of splitting them up into easy to review pieces,
thanks.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson