[Pdbg] [PATCH 00/29] Understand Update Upgrade

Cyril Bur cyrilbur at gmail.com
Fri Feb 9 15:48:13 AEDT 2018


Oops, have to actually put the text of the cover letter in there...

On Fri, 2018-02-09 at 15:38 +1100, Cyril Bur wrote:

Hello,

This series does three/four things in one. Happy to split it up but
I think we'll find they're a bit dependant on eachother.

The first part of the series are obvious cleanups, just simple easy
stuff which got me into pdbg.

I then I thought I've move everything around. Currently everthing sits
in main.c of the pdbg binary which I'm sure was fine when it was just
to get gprs and sprs. As pdbg grows this is becoming increasingly
unmanagable. This move around also paves the way for changing how pdbg
handles its commands.

Currently pdbg has quite an inflexible way of handling command params,
that is, there is a generic way for it to grab between zero and two
params from the command line and call a handler - this works great
right now for stuff like getgpr but again as more functionality gets
added, just two params (of fixed type) is hard to work with. Now
adding commands with an arbitraty number of params and flags is easy.
Just use getopt().

More HTM features. The initial HTM work was really just for Power9
nest but there's really no reason that Power8 core and nest can't be
made to work. I wanted the HTM commands to be easy to use, so really
you shouldn't know if you're talking about a Power8 or a Power9, just,
what do you want to do. Hopefull this all works. Slight caveat it
looks like the Power8 core HTM enumeration isn't quite right, they
seem to half be on core 0 and half on core 8. Pretty sure this just
cosmetic.

The second last patch is actually quite nice by its self. Even after
all this hacking on pdbg I'm not sure I quite follow how to tell it
how to get access to the hardware that it needs. I've tested that
patch on a few systems and I think it works, which means we can do
away with the flags to tell it how to get access to the hardware (we
should leave them in of course just not require they be used).

The last patch just removes the first HTM commands I wrote, the
functionality still exists with the new style commands. I don't think
there are too many people who will have gotten used to the commands so
remove them before they gain any traction.

I'm sure I've missed something. I had to do a pretty heavy rebase onto
the API patches from Alistair so I bet theres some oddity that snuck
in somewhere.

Thanks,

Cyril

> 
> Cyril Bur (29):
>   main: Remove unused variable oidx
>   main: Alphabetise getopt()
>   main: Handle unknown getopt argument
>   main: Use endptr to better check the result of strtoull()
>   main: Pull out command parsing from option parsing
>   main: Pull cfam functions out of main.c
>   main: Pull out scom functions from main.c
>   main: Pull register accessors out of main.c
>   main: Pull memory accessors out of main.c
>   main: Pull thread control accessors out of main.c
>   main: Pull HTM functions out of main.c
>   main: Prepare to change command handling
>   main: Use new command handling for cfams
>   main: Use new command handling for scoms
>   main: Use new command handling for memory commands
>   main: Use new command handling for registers
>   main: Use new command handling for threads
>   main: Use new command handling for HTM
>   main: Use new command handling for probe
>   main: Remove oldstyle command parsing
>   main: Use the actions array to print the commands
>   libpdbg/htm: Convert current HTM function names to Nest HTM
>   libpdbg/htm: Add nest to Nest HTM specific constants
>   htm: Check that nodes aren't disabled
>   libpdbg/htm: Both `chtm` and `nhtm` classes are valid
>   libpdbg/htm: Add POWER8 HTM (both Core and Nest)
>   main: Add HTM functions to deal with Core HTM
>   main: Attempt to automatically discover target
>   pdbg/htm: Remove deprecated commands and code
> 
>  .gitignore        |   1 +
>  Makefile.am       |   4 +-
>  configure.ac      |   8 +
>  libpdbg/device.c  |  10 +
>  libpdbg/device.h  |   3 +
>  libpdbg/htm.c     | 269 ++++++++++++-----
>  libpdbg/target.c  |   8 +
>  libpdbg/target.h  |   1 +
>  p8-pib.dts.m4     |  11 +
>  p9-pib.dts.m4     |   4 +-
>  src/cfam.c        |  86 ++++++
>  src/cfam.h        |  18 ++
>  src/htm.c         | 304 +++++++++++++++++++
>  src/htm.h         |  21 ++
>  src/main.c        | 853 ++++++++----------------------------------------------
>  src/main.h        |  32 ++
>  src/mem.c         | 115 ++++++++
>  src/mem.h         |  18 ++
>  src/options.h     |  30 ++
>  src/options_arm.c |  95 ++++++
>  src/options_def.c |  39 +++
>  src/options_ppc.c |  76 +++++
>  src/reg.c         | 234 +++++++++++++++
>  src/reg.h         |  20 ++
>  src/scom.c        |  86 ++++++
>  src/scom.h        |  20 ++
>  src/thread.c      | 144 +++++++++
>  src/thread.h      |  24 ++
>  28 files changed, 1738 insertions(+), 796 deletions(-)
>  create mode 100644 src/cfam.c
>  create mode 100644 src/cfam.h
>  create mode 100644 src/htm.c
>  create mode 100644 src/htm.h
>  create mode 100644 src/main.h
>  create mode 100644 src/mem.c
>  create mode 100644 src/mem.h
>  create mode 100644 src/options.h
>  create mode 100644 src/options_arm.c
>  create mode 100644 src/options_def.c
>  create mode 100644 src/options_ppc.c
>  create mode 100644 src/reg.c
>  create mode 100644 src/reg.h
>  create mode 100644 src/scom.c
>  create mode 100644 src/scom.h
>  create mode 100644 src/thread.c
>  create mode 100644 src/thread.h
> 
> -- 
> 2.16.1
> 


More information about the Pdbg mailing list