All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Maninder Singh <maninder1.s@samsung.com>,
	bcain@quicinc.com, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, keescook@chromium.org,
	nathanl@linux.ibm.com, ustavoars@kernel.org,
	alex.gaynor@gmail.com, gary@garyguo.net, ojeda@kernel.org,
	pmladek@suse.com, wedsonaf@google.com,
	linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	Onkarnath <onkarnath.1@samsung.com>
Subject: Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size
Date: Thu, 1 Jun 2023 12:27:30 +0200	[thread overview]
Message-ID: <CANiq72nf-MC36hHzv0ZpR+qUyaf3mhF+rfqpMcVbw0AheuRBpA@mail.gmail.com> (raw)
In-Reply-To: <87ilc8ym6v.fsf@mail.lhotse>

On Thu, Jun 1, 2023 at 4:02 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> > Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being
> > used, but the name seems discarded? Can
> > `kallsyms_lookup_size_offset()` be used instead, thus avoiding the
> > usage of the buffer there to begin with?
>
> A few lines below it uses the modname, and AFAICS there's no (easy) way
> to lookup the modname without also looking up the name.

Hmm... I think you are looking at the `xmon_print_symbol()` one? I was
referring to the `get_function_bounds()` one, where the `modname`
parameter is `NULL` (and the `name` contents are not used, only
whether it was found or not).

> > Side-note 2: in `scanhex()`, I see a loop `i<63` using `tmpstr` which
> > then is used to do a `kallsyms_lookup_name()`, so I guess symbols
> > larger than 64 couldn't be found. I have no idea about what are the
> > external constraints here, but perhaps it is possible to increase the
> > `line` buffer etc. to then allow for bigger symbols to be found.
>
> Yeah that looks wrong. I don't see any symbols that long in current
> kernels, but we should fix it.
>
> Thanks for looking.

My pleasure!

Cheers,
Miguel

WARNING: multiple messages have this Message-ID (diff)
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: nathanl@linux.ibm.com, bcain@quicinc.com, keescook@chromium.org,
	gary@garyguo.net, pmladek@suse.com,
	linux-hexagon@vger.kernel.org, ustavoars@kernel.org,
	linux-kernel@vger.kernel.org, ojeda@kernel.org,
	wedsonaf@google.com, npiggin@gmail.com, alex.gaynor@gmail.com,
	Maninder Singh <maninder1.s@samsung.com>,
	Onkarnath <onkarnath.1@samsung.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size
Date: Thu, 1 Jun 2023 12:27:30 +0200	[thread overview]
Message-ID: <CANiq72nf-MC36hHzv0ZpR+qUyaf3mhF+rfqpMcVbw0AheuRBpA@mail.gmail.com> (raw)
In-Reply-To: <87ilc8ym6v.fsf@mail.lhotse>

On Thu, Jun 1, 2023 at 4:02 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> > Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being
> > used, but the name seems discarded? Can
> > `kallsyms_lookup_size_offset()` be used instead, thus avoiding the
> > usage of the buffer there to begin with?
>
> A few lines below it uses the modname, and AFAICS there's no (easy) way
> to lookup the modname without also looking up the name.

Hmm... I think you are looking at the `xmon_print_symbol()` one? I was
referring to the `get_function_bounds()` one, where the `modname`
parameter is `NULL` (and the `name` contents are not used, only
whether it was found or not).

> > Side-note 2: in `scanhex()`, I see a loop `i<63` using `tmpstr` which
> > then is used to do a `kallsyms_lookup_name()`, so I guess symbols
> > larger than 64 couldn't be found. I have no idea about what are the
> > external constraints here, but perhaps it is possible to increase the
> > `line` buffer etc. to then allow for bigger symbols to be found.
>
> Yeah that looks wrong. I don't see any symbols that long in current
> kernels, but we should fix it.
>
> Thanks for looking.

My pleasure!

Cheers,
Miguel

WARNING: multiple messages have this Message-ID (diff)
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: nathanl@linux.ibm.com, bcain@quicinc.com, keescook@chromium.org,
	gary@garyguo.net, pmladek@suse.com,
	linux-hexagon@vger.kernel.org, ustavoars@kernel.org,
	linux-kernel@vger.kernel.org, ojeda@kernel.org,
	wedsonaf@google.com, npiggin@gmail.com, alex.gaynor@gmail.com,
	Maninder Singh <maninder1.s@samsung.com>,
	Onkarnath <onkarnath.1@samsung.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size
Date: Thu, 1 Jun 2023 12:27:30 +0200	[thread overview]
Message-ID: <CANiq72nf-MC36hHzv0ZpR+qUyaf3mhF+rfqpMcVbw0AheuRBpA@mail.gmail.com> (raw)
In-Reply-To: <87ilc8ym6v.fsf@mail.lhotse>

On Thu, Jun 1, 2023 at 4:02 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> > Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being
> > used, but the name seems discarded? Can
> > `kallsyms_lookup_size_offset()` be used instead, thus avoiding the
> > usage of the buffer there to begin with?
>
> A few lines below it uses the modname, and AFAICS there's no (easy) way
> to lookup the modname without also looking up the name.

Hmm... I think you are looking at the `xmon_print_symbol()` one? I was
referring to the `get_function_bounds()` one, where the `modname`
parameter is `NULL` (and the `name` contents are not used, only
whether it was found or not).

> > Side-note 2: in `scanhex()`, I see a loop `i<63` using `tmpstr` which
> > then is used to do a `kallsyms_lookup_name()`, so I guess symbols
> > larger than 64 couldn't be found. I have no idea about what are the
> > external constraints here, but perhaps it is possible to increase the
> > `line` buffer etc. to then allow for bigger symbols to be found.
>
> Yeah that looks wrong. I don't see any symbols that long in current
> kernels, but we should fix it.
>
> Thanks for looking.

My pleasure!

Cheers,
Miguel

  reply	other threads:[~2023-06-01 10:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230529111350epcas5p46a1fa16ffb2a39008c26d03c5c63f109@epcas5p4.samsung.com>
2023-05-29 11:13 ` [PATCH 1/2] hexagon/traps.c: use KSYM_NAME_LEN in array size Maninder Singh
2023-05-29 11:13   ` Maninder Singh
     [not found]   ` <CGME20230529111404epcas5p2d540d726dcf3e21aae2a6a0958e2eea5@epcas5p2.samsung.com>
2023-05-29 11:13     ` [PATCH 2/2] powerpc/xmon: " Maninder Singh
2023-05-29 11:13       ` Maninder Singh
2023-05-30  6:45       ` Michael Ellerman
2023-05-30  6:45         ` Michael Ellerman
2023-05-30 12:54       ` Miguel Ojeda
2023-05-30 12:54         ` Miguel Ojeda
2023-05-30 12:54         ` Miguel Ojeda
2023-06-01  2:02         ` Michael Ellerman
2023-06-01  2:02           ` Michael Ellerman
2023-06-01  2:02           ` Michael Ellerman
2023-06-01 10:27           ` Miguel Ojeda [this message]
2023-06-01 10:27             ` Miguel Ojeda
2023-06-01 10:27             ` Miguel Ojeda
2023-06-01 12:54             ` Michael Ellerman
2023-06-01 12:54               ` Michael Ellerman
2023-06-01 12:54               ` Michael Ellerman
2023-08-03  5:46         ` Benjamin Gray
2023-08-03  5:46           ` Benjamin Gray
2023-05-30  8:59   ` [PATCH 1/2] hexagon/traps.c: " Petr Mladek
2023-05-30  8:59     ` Petr Mladek
2023-05-30 12:59   ` Miguel Ojeda
2023-05-30 12:59     ` Miguel Ojeda
2023-05-30 12:59     ` Miguel Ojeda
2023-05-30 13:42   ` David Laight
2023-05-30 13:42     ` David Laight
2023-07-03  4:02   ` Michael Ellerman
2023-07-03  4:02     ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANiq72nf-MC36hHzv0ZpR+qUyaf3mhF+rfqpMcVbw0AheuRBpA@mail.gmail.com \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=bcain@quicinc.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=gary@garyguo.net \
    --cc=keescook@chromium.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maninder1.s@samsung.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=onkarnath.1@samsung.com \
    --cc=pmladek@suse.com \
    --cc=ustavoars@kernel.org \
    --cc=wedsonaf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.