From joel at jms.id.au Thu Aug 4 15:45:29 2022 From: joel at jms.id.au (Joel Stanley) Date: Thu, 4 Aug 2022 05:45:29 +0000 Subject: [Pdbg] [PATCH 05/10] libpdbg: implement fused-core and lpar-per-thread thread status In-Reply-To: <20220531091457.2208488-6-npiggin@gmail.com> References: <20220531091457.2208488-1-npiggin@gmail.com> <20220531091457.2208488-6-npiggin@gmail.com> Message-ID: On Tue, 31 May 2022 at 09:15, Nicholas Piggin wrote: > > Like smt_state, these are really a per-core state but for now they are > put in the thread_state. A future change will use fused-core, and the > lpar mode may be generally useful to know in some situations. > > Signed-off-by: Nicholas Piggin > --- > libpdbg/libpdbg.h | 2 ++ > libpdbg/p10chip.c | 3 +++ > libpdbg/p8chip.c | 3 +++ > libpdbg/p9chip.c | 3 +++ > 4 files changed, 11 insertions(+) > > diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h > index 05e54f76..252b1b16 100644 > --- a/libpdbg/libpdbg.h > +++ b/libpdbg/libpdbg.h > @@ -1043,6 +1043,8 @@ enum pdbg_smt_state { > struct thread_state { > bool active; > bool quiesced; > + bool lpar_per_thread; > + bool fused_core_mode; > enum pdbg_sleep_state sleep_state; > enum pdbg_smt_state smt_state; > }; > diff --git a/libpdbg/p10chip.c b/libpdbg/p10chip.c > index 70481f1f..632a1a9c 100644 > --- a/libpdbg/p10chip.c > +++ b/libpdbg/p10chip.c > @@ -107,6 +107,9 @@ struct thread_state p10_thread_state(struct thread *thread) > else > thread_state.sleep_state = PDBG_THREAD_STATE_RUN; > > + thread_state.lpar_per_thread = !(value & PPC_BIT(62)); > + thread_state.fused_core_mode = !!(value & PPC_BIT(63)); > + > return thread_state; > } > > diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c > index 5b2a90a9..0592ca08 100644 > --- a/libpdbg/p8chip.c > +++ b/libpdbg/p8chip.c > @@ -247,6 +247,9 @@ static struct thread_state p8_thread_state(struct thread *thread) > /* Clear debug mode */ > pib_write(&thread->target, RAS_MODE_REG, mode_reg); > > + thread_state.lppar_per_thread = false; > + thread_state.fused_core_mode = false; There were a few typos here that I fixed when applying: - thread_state.lppar_per_thread = false; - thread_state.fused_core_mode = false; + thread_status.lpar_per_thread = false; + thread_status.fused_core_mode = false; > + > return thread_status; > } > > diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c > index 0040402c..036be521 100644 > --- a/libpdbg/p9chip.c > +++ b/libpdbg/p9chip.c > @@ -128,6 +128,9 @@ struct thread_state p9_thread_state(struct thread *thread) > else > thread_state.sleep_state = PDBG_THREAD_STATE_RUN; > > + thread_state.lpar_per_thread = !(value & PPC_BIT(62)); > + thread_state.fused_core_mode = !!(value & PPC_BIT(63)); > + > return thread_state; > } > > -- > 2.35.1 > > -- > Pdbg mailing list > Pdbg at lists.ozlabs.org > https://lists.ozlabs.org/listinfo/pdbg From joel at jms.id.au Thu Aug 4 15:46:36 2022 From: joel at jms.id.au (Joel Stanley) Date: Thu, 4 Aug 2022 05:46:36 +0000 Subject: [Pdbg] [PATCH 00/10] pdbg fixes and improvements related to gdbserver In-Reply-To: <20220531091457.2208488-1-npiggin@gmail.com> References: <20220531091457.2208488-1-npiggin@gmail.com> Message-ID: On Tue, 31 May 2022 at 09:15, Nicholas Piggin wrote: > > Here's a bunch of things that came up when trying to work out what's > wrong with using attn for breakpoints in gdbserver. > > After fixing some fused-core issues, turning off attn_handler service > on the BMC seems to allow breakpoints to work reliably. Although > executing attn can still cause the host skiboot PSI subsystem to > print the "Masking unhandled LSI global_err" error. Not sure why the > host gets these, I thought they only went to the BMC... That's > another thing to work out and fix up but it doesn't seem to be > harmful. > > Thanks, > Nick > > Nicholas Piggin (10): > sbefifo: correct typo in thread target name > gdbserver: Fix attn enable HID change icache flushing sequence > gdbserver: use TRAP for step stop reason > p9chip: implement SMT state thread state > libpdbg: implement fused-core and lpar-per-thread thread status > gdbserver: Add a note about the attn_handler service on the BMC I applied this set of patches. The next patch with its libpdbg change required a bit more review, which I'll do later. > libpdbg: move core state into struct core > thread: print core state with threadstatus > libpdbg: add fused-core thread id > gdbserver: Fix POWER10 fused-core SPATTN register handling > > README.md | 15 +++++++-- > libpdbg/chip.h | 3 ++ > libpdbg/hwunit.h | 3 ++ > libpdbg/libpdbg.h | 19 +++++++++++ > libpdbg/p10chip.c | 77 +++++++++++++++++++++++++++++++++------------ > libpdbg/p8chip.c | 39 ++++++++++++++++++----- > libpdbg/p9chip.c | 58 ++++++++++++++++++++++++++++++++-- > libpdbg/sbefifo.c | 51 +++++++++++++++++++++++++++++- > libpdbg/thread.c | 9 ++++++ > src/pdbgproxy.c | 80 +++++++++++++++++++++++++++++++++++++---------- > src/thread.c | 46 +++++++++++++++++++++++++-- > 11 files changed, 349 insertions(+), 51 deletions(-) > > -- > 2.35.1 > > -- > Pdbg mailing list > Pdbg at lists.ozlabs.org > https://lists.ozlabs.org/listinfo/pdbg