[Skiboot] [PATCH 01/15] opal: Fix parameter for opal entry in skiboot trace

Oliver oohall at gmail.com
Mon Mar 25 11:36:34 AEDT 2019


On Mon, Mar 25, 2019 at 11:16 AM Jordan Niethe <jniethe5 at gmail.com> wrote:
>
> trace_add expects to be given the complete size of the trace entry it
> will add to the trace buffer. Currently the size of the trace_opal trace
> type is not calculated correctly which leads to it being added
> incorrectly to the trace buffer. Calculate using the sizeof operator.
> This is consistent with how it is done for the uart entry.

It would help if you described what's incorrect about the current
behaviour. Is the reader assuming there is always 9 arguments?

> ---
>  core/opal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/core/opal.c b/core/opal.c
> index 624e2a255f4d..f42fd8d258fb 100644
> --- a/core/opal.c
> +++ b/core/opal.c
> @@ -110,7 +110,7 @@ static void opal_trace_entry(struct stack_frame *eframe __unused)
>         for(i=0; i<nargs; i++)
>                 t.opal.r3_to_11[i] = cpu_to_be64(eframe->gpr[3+i]);
>
> -       trace_add(&t, TRACE_OPAL, offsetof(struct trace_opal, r3_to_11[nargs]));
> +       trace_add(&t, TRACE_OPAL, sizeof(struct trace_opal));
>  }
>  #endif
>
> --
> 2.20.1

Reviewed-by: Oliver O'Halloran <oohall at gmail.com>

>
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot


More information about the Skiboot mailing list