[Pdbg] [PATCH 14/14] gdbserver: Add POWER10 support

Joel Stanley joel at jms.id.au
Wed Mar 16 10:47:40 AEDT 2022


On Mon, 14 Mar 2022 at 04:18, Nicholas Piggin <npiggin at gmail.com> wrote:
>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>

Reviewed-by: Joel Stanley <joel at jms.id.au>

> ---
>  src/pdbgproxy.c | 22 +++++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c
> index e8aab70..b44aea4 100644
> --- a/src/pdbgproxy.c
> +++ b/src/pdbgproxy.c
> @@ -104,6 +104,8 @@ static void detach(uint64_t *stack, void *priv)
>  }
>
>  #define POWER8_HID_ENABLE_ATTN                 PPC_BIT(31)
> +#define POWER10_HID_ENABLE_ATTN                        PPC_BIT(3)
> +#define POWER10_HID_FLUSH_ICACHE               PPC_BIT(2)
>
>  static int set_attn(bool enable)
>  {
> @@ -122,6 +124,17 @@ static int set_attn(bool enable)
>                                 return 0;
>                         hid &= ~POWER8_HID_ENABLE_ATTN;
>                 }
> +       } else if (pdbg_target_compatible(thread_target, "ibm,power10-thread")) {
> +               if (enable) {
> +                       if (hid & POWER10_HID_ENABLE_ATTN)
> +                               return 0;
> +                       hid |= POWER10_HID_ENABLE_ATTN;
> +               } else {
> +                       if (!(hid & POWER10_HID_ENABLE_ATTN))
> +                               return 0;
> +                       hid &= ~POWER10_HID_ENABLE_ATTN;
> +               }
> +               hid |= POWER10_HID_FLUSH_ICACHE;
>         } else {
>                 return -1;
>         }
> @@ -572,9 +585,12 @@ static int gdbserver(uint16_t port)
>         }
>
>         //
> -       // Temporary until I can get this working a bit smoother on p9
> -       if (!pdbg_target_compatible(thread, "ibm,power8-thread")) {
> -               PR_ERROR("GDBSERVER is only available on POWER8\n");
> +       // POWER9 appears to have problems with PSI interrupts when hitting
> +       // an attn intstruction. Could just disallow breakpoints on P9.
> +       //
> +       if (!pdbg_target_compatible(thread, "ibm,power8-thread") &&
> +           !pdbg_target_compatible(thread, "ibm,power10-thread")) {
> +               PR_ERROR("GDBSERVER is only available on POWER8 and POWER10\n");
>                 return -1;
>         }
>
> --
> 2.23.0
>
> --
> Pdbg mailing list
> Pdbg at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/pdbg


More information about the Pdbg mailing list