| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
The number of arguments required for these functions is wrong -
it requires 2 arguments for putnia and putmsr, and the second one
is written. The code has obviously been copy/pasted from getgpr/getspr
functions where you need to supply which register and then the data.
|
|
|
|
|
|
|
|
|
|
| |
Based on feedback it seems "expert" mode was too vague and confusing for users,
so remove it. This means the user will be forced to manually manage the state of
the system which also seems to be too confusing for some users, but a future
patch will add user-friendly commands to the application which will change the
system state as required.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
| |
Instead of outputting:
Usage: /root/mikey/pdbg/.libs/pdbg
output
Usage: pdbg
Signed-off-by: Michael Neuling <mikey@neuling.org>
|
|
|
|
| |
Signed-off-by: Michael Neuling <mikey@neuling.org>
|
|
|
|
| |
Signed-off-by: Michael Neuling <mikey@neuling.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tacking a boolean parameter onto the end of the a function makes it hard
to read the code at call sites and know what is going on.
See Rusty's API levels, point 6 and 7:
7. The obvious use is (probably) the correct one.
6. The name tells you how to use it.
From http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html
Cache inhibited is probably not what you're after, unless you know that
you're after it. These wrappers remove the boolean from the user
callable API.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
| |
In some places it's declared as one, others it's not. It's used as one,
so lets do it.
Signed-off-by: Joel Stanley <joel@jms.id.au>
|
|
|
|
|
|
|
| |
If a boolean function returns true on error, it's just recipe for all
sorts of programming errors.
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are few execptions:
- src/thread.c, src/htm.c
These require bitutils.h. The correct fix might be to include thread
abstraction in libpdbg.
- src/main.c
This requires target.h.
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is currently no abstraction of thread status between library and
application. It just passes the hardware specific values down. There is
also no interface exported in the library headers to read status.
This makes it difficult to implement more advanced functionality in the
application as there is no way hardware agnostic way to determine if a
thread is in powersave mode or not for example.
Instead introduce a hardware agnostic thread state so that we can implement
more advanced functionality such as automatically stopping threads if
required.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
| |
I2C based access is unique in that to access the PIB on secondary processors we
need to traverse the PIB on the primary processor. This confuses our current
selection logic as every core becomes a child of the primary PIB. Hopefully our
selection logic will get rewritten soon, but in the meantime add a check to
ensure a cores immediate parent PIB matches the currently selected processor.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NIA : 0xc000000000984604
CFAR : 0xc00000000098461c
MSR : 0x9000000000009033
LR : 0xc0000000009846e4
CTR : 0xc000000000984560
TAR : 0x0000000000000000
CR : 0x24004424
XER : 0x00000000
GPRS :
0xc0000000009845a8 0xc000000006e07d90 0xc000000001306000 0x0000000000000000
0x0000000000000001 0x0000000000000000 0x0000000000000009 0x0000000000000808
0x0000000000000000 0x00000565ba95ebcd 0xc000000006e04000 0x822ca467ef411b43
0xc000000000984560 0xc000000ffffe0200 0xc000000006e07f90 0x0000000000000000
0x0000000000000000 0xc000000000029d8c 0xc000000000043630 0xc000000000fa5410
0x0000000000000800 0xc0000000013481f4 0x0000000000000026 0x0000000000000000
0x0000000000000001 0x0000000000000000 0x0000000000000000 0x0000000000000000
0xc000000001266ba0 0xc000000ff57a1d58 0x0000000000000000 0x00000565ba95f7b5
LPCR : 0x0040400001d2f012
PTCR : 0x0040400001d2f012
LPIDR : 0x0000000000000000
PIDR : 0x0000000000080081
HFSCR : 0x000000000000059f
HDSISR: 0x00000000
HDAR : 0x0000000000000000
HSRR0 : 0xc000000000984618
HSRR1 : 0x9000000000009033
HDEC : 0xfffffaa5941c2f0a
HSPRG0: 0xc000000ffffe0200
HSPRG1: 0xc000000ffffe0200
FSCR : 0x0000000000000184
DSISR : 0x00000000
DAR : 0x0000000000000000
SRR0 : 0xc000000000984608
SRR1 : 0x9000000000009033
DEC : 0xfffffffee1c2b8cf
TB : 0x00000566dd7f0784
SPRG0 : 0x0000000000000000
SPRG1 : 0x0000000000000000
SPRG2 : 0x0000000000000000
SPRG3 : 0x0000000000000000
PPR : 0x0004000000000000
STACK:
0xc000000006e07dd0 0xc00000000098170c
0xc000000006e07e40 0xc00000000013e60c
0xc000000006e07e60 0xc00000000013e920
0xc000000006e07ed0 0xc00000000013eeb8
0xc000000006e07f00 0xc000000000045bc4
0xc000000006e07f90 0xc00000000000af70
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This uses ramming to pull out most registers. There are more
SPRs to left to add.
Ramming remains set over all register extraction, by keeping
ram_is_setup target attribut. This helps to speed things up
and minimise disturbance to the host.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Have sreset work in !expert mode, by stopping threads automatically.
There is some indication in the workbook that the sreset control
works on running threads, but testing has so far proven otherwise,
so stop them if they were not stopped.
Expert mode still require it only be used on threads already stopped.
Signed-off-by: Nicholas Piggin <npiggin@mgail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add an --expert mode which contains dangerous options or things which
are "stateful" between pdbg invocations, where the release command and
possibly others need to be run to return the system to a normal state.
If you're not in expert mode, you just run a command and that's it.
More commands can be added to expert mode as we go.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
|
|
|
|
|
|
| |
People like progress bars. Give the people what they want.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
| |
For long running library operations such as getmem it is useful to give the
application an ability to report progress back to the user. This adds a way to
register a progress_tick callback which takes the current and maximum progress
counts.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Suggested-by: Amitay Isaacs <amitay@ozlabs.org>
|
|
|
|
|
|
|
|
| |
This comes from skiboot's pflash utility. Source is copyright IBM under
Apache 2.0.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
| |
Using P9_TTYPE_CI_PARTIAL_WRITE instead of P9_TTYPE_CI_PARTIAL_OOO_WRITE
because that is what cronus does.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
|
|
|
|
|
|
| |
Without this patch, attempting to write to memory causes a segfault.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Special wakeup needs to remain asserted e.g., between stopping a
thread and reading registers, so targets can't be released between
invocations of pdbg automatically. So provide an explicit release
function that must be called when we're done with our targets.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
|
|
|
|
|
|
|
|
| |
Currently if the user omits an htm command such as 'start' or 'stop'
we segfault. This happens because we check for the wrong number of
arguments.
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
|
|
|
|
|
|
|
| |
There's no point compressing status down to a single letter. Add
letters for each mode we are intereted in. Add the P9 stop state.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
|
|
|
|
| |
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The HTM does not call the same target iterators as the rest of the pdbg
application. Therefore the changes to device selection were not carried
over. Longer term we should change the HTM code to call the same iterators
as the rest of the pdbg application, but for the moment just copy the
device selection code across as the longer term fix really requires
rewritting the iterators to not use callbacks.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
| |
Add basic support for a getring operation on POWER9.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Core HTM has a nasty habit of not working if the stars haven't aligned
with the exact polar axis of Mars. To complicate matters if Zeus got up
on the incorrect side of the bed Core HTM will likely reflect his mood.
Core HTM requires that no threads be in powersave. It isn't clear if
this restriction only applies to threads on the core being traced on or
if this is a global thing. In order to be as safe as possible, pdbg
will enforce that powersave be disabled globally.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
|
| |
We only call into libpdbg with one HTM unit, libpdbg returns how many
HTM units it operated on. A successful calling of HTM dump would expect
a return value of 1, so not 1 is an error.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have now moved entirely to lazy probing of targets. This means client
applications now need to explicitly probe each child target they need
rather than explicitly marking everything they need prior to initialising
the library.
This leads to problems with device selection in pdbg as previously it would
run a command on every target which was found to exist after probing which
would ignore disabled targets. However disabling a target now prevents it
being probed even if child targets require it so pdbg can no longer set a
target to disabled just because it doesn't want to run a command on that
target.
Instead it needs to explicitly record which targets a command should be run
on. This is performed by marking each target as selected or not prior to
running commands.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When libpdbg runs though the device tree and calls probe() on all the
targets it marks any node (and all its children) which fails to probe
as "disabled".
When pdbg recieves arguments to specifiy a pib, core or thread (-p -c
-t) it runs though the device tree and marks nodes which do not match
the specified -p -c or -t as "disabled".
These two scenarios are related - that is we don't want to be operating
on any disabled nodes. However, they are not the same.
Consider HTM wanting to know if the machine has powersave disabled. A
simple way would be to loop through all the threads and if any of them
are not in "active" state then powersave must be enabled. In this
scenario HTM want to be able to get the status of every thread on the
machine regardless of -p -c -t flags but if the machine isn't fully
speced out and has cores which didn't probe, HTM wants to know to
ignore those threads.
This patch introduces a "nonexistant" pdbg target status which is set
during libpdbg probe() time. Later pdbg can mark nodes to targets that
do 'exist' but it would like to avoid as "disabled".
Attempting to solve the above problem with only a "nonexistant" flag
would also require everything to be probed before selecting out chips
and threads that the user is not interested in. This would be highly
inefficient.
This patch probes the system lazily.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
| |
Somehow HTM started not putting the correct indexes and it started
becoming impossible to know which htm was being used.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thread status can return the current hardware smt state of a thread
pretty easily, the information is in POW_STATUS_REG which we already
read.
It should be noted that the value read by the scom has nothing to do
with the ppc64_cpu --smt value. The value returned by the hardware is
really how the hardware is operating, it will happy be in SMT1 and
having a thread using the entire core. The other threads to not need to
be asleep for SMT1 to be reported, something like the Linux idle loop
(but without sleep states) will do it. This means that an SMT1 thread
with three others active threads spinning could at any time jump report
SMT4 depending on the load of the system.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
| |
This commit also updates the README to only reference the new commands
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
|
|
|
| |
It should be noted here that 'GETVMEM' was declared but never actually
used so it has disapeared from the source entirely.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|
|
|
|
| |
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
|