All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2 1/5] symbols: add minimal self-test
Date: Fri, 29 Aug 2025 16:24:21 +0200	[thread overview]
Message-ID: <aLG4FdcHSLW6oaVA@Mac.lan> (raw)
In-Reply-To: <879646dd-b55e-4b42-b637-d3b14570b880@suse.com>

On Wed, Apr 02, 2025 at 03:57:57PM +0200, Jan Beulich wrote:
> ... before making changes to the involved logic.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> While Andrew validly suggests cf_check isn't a requirement for selecting
> which function(s) to use (with the non-upstream gcc patch that we're
> using in CI), that's only because of how the non-upstream patch works.
> Going function-pointer -> unsigned long -> function-pointer without it
> being diagnosed that the cf_check is missing is a shortcoming there, and
> might conceivably be fixed at some point. (Imo any address-taking on a
> function should require it to be cf_check.) Hence I'd like to stick to
> using cf_check functions only for passing to test_lookup().
> 
> With this FAST_SYMBOL_LOOKUP may make sense to permit enabling even
> when LIVEPATCH=n. Thoughts? (In this case "symbols: centralize and re-
> arrange $(all_symbols) calculation" would want pulling ahead.)
> 
> --- a/xen/common/symbols.c
> +++ b/xen/common/symbols.c
> @@ -260,6 +260,41 @@ unsigned long symbols_lookup_by_name(con
>      return 0;
>  }
>  
> +#ifdef CONFIG_SELF_TESTS
> +
> +static void __init test_lookup(unsigned long addr, const char *expected)
> +{
> +    char buf[KSYM_NAME_LEN + 1];
> +    const char *name, *symname;
> +    unsigned long size, offs;
> +
> +    name = symbols_lookup(addr, &size, &offs, buf);
> +    if ( !name )
> +        panic("%s: address not found\n", expected);
> +    if ( offs )
> +        panic("%s: non-zero offset (%#lx) unexpected\n", expected, offs);

If there's a non-zero offset returned, could you also print the
returned name? (so use %s+%#lx) there's a change the returned name
doesn't match what we expect if there's a non-zero offset.

The rest LGTM:

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.


  parent reply	other threads:[~2025-08-29 14:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 13:56 [PATCH v2 0/5] symbols: assorted adjustments Jan Beulich
2025-04-02 13:57 ` [PATCH v2 1/5] symbols: add minimal self-test Jan Beulich
2025-08-27 22:20   ` Jason Andryuk
2025-08-29 14:24   ` Roger Pau Monné [this message]
2025-09-01  6:38     ` Jan Beulich
2025-04-02 13:58 ` [PATCH v2 2/5] symbols: split symbols_num_syms Jan Beulich
2025-08-27 22:20   ` Jason Andryuk
2025-04-02 13:58 ` [PATCH v2 3/5] symbols: arrange to know where functions end Jan Beulich
2025-04-02 14:08   ` Jan Beulich
2025-08-28  1:03   ` Jason Andryuk
2025-08-28  7:28     ` Jan Beulich
2025-08-28 16:11       ` Jan Beulich
2025-08-28 17:16         ` Jason Andryuk
2025-08-29  6:59           ` Jan Beulich
2025-08-31 14:50             ` Jason Andryuk
2025-04-02 13:59 ` [PATCH v2 4/5] symbols: centralize and re-arrange $(all_symbols) calculation Jan Beulich
2025-08-28  1:05   ` Jason Andryuk
2025-08-29 15:02     ` Roger Pau Monné
2025-04-02 14:00 ` [PATCH v2 5/5] symbols: prefer symbols which have a type Jan Beulich
2025-08-28  1:07   ` Jason Andryuk
2025-08-29 15:13     ` Roger Pau Monné

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=aLG4FdcHSLW6oaVA@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.