From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Wei Liu" <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>,
"Ross Lagerwall" <ross.lagerwall@citrix.com>,
"Julien Grall" <julien.grall@arm.com>,
"Norbert Manthey" <nmanthey@amazon.de>,
"Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH] x86/livepatch: Fail the build if duplicate symbols exist
Date: Fri, 5 Apr 2019 17:02:50 -0400 [thread overview]
Message-ID: <20190405210250.GA18169@char.us.oracle.com> (raw)
In-Reply-To: <1554492364-21684-1-git-send-email-andrew.cooper3@citrix.com>
On Fri, Apr 05, 2019 at 08:26:04PM +0100, Andrew Cooper wrote:
> From: Ross Lagerwall <ross.lagerwall@citrix.com>
>
> The binary diffing algorithm used by xen-livepatch depends on having unique
> symbols.
>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien.grall@arm.com>
> CC: Ross Lagerwall <ross.lagerwall@citrix.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> CC: Norbert Manthey <nmanthey@amazon.de>
>
> This patch has been part of the XenServer patchqueue for ages, and should have
> been upstreamed sooner. It obviously can't be applied while the "block
> speculation" issue is outstanding.
> ---
> xen/arch/x86/Makefile | 1 +
> xen/tools/symbols.c | 11 +++++++++--
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
> index ef09939..d4ae46b 100644
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -98,6 +98,7 @@ endif
>
> syms-warn-dup-y := --warn-dup
> syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
> +syms-warn-dup-$(CONFIG_LIVEPATCH) := --error-dup
>
> $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
> ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) $(XEN_IMG_OFFSET) \
> diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
> index 05139d1..9f9e2c9 100644
> --- a/xen/tools/symbols.c
> +++ b/xen/tools/symbols.c
> @@ -599,7 +599,7 @@ static int compare_name(const void *p1, const void *p2)
> int main(int argc, char **argv)
> {
> unsigned int i;
> - bool unsorted = false, warn_dup = false;
> + bool unsorted = false, warn_dup = false, error_dup = false, found_dup = false;
>
> if (argc >= 2) {
> for (i = 1; i < argc; i++) {
> @@ -619,6 +619,8 @@ int main(int argc, char **argv)
> sort_by_name = 1;
> else if (strcmp(argv[i], "--warn-dup") == 0)
> warn_dup = true;
> + else if (strcmp(argv[i], "--error-dup") == 0)
> + warn_dup = error_dup = true;
> else if (strcmp(argv[i], "--xensyms") == 0)
> map_only = true;
> else
> @@ -634,14 +636,19 @@ int main(int argc, char **argv)
> for (i = 1; i < table_cnt; ++i)
> if (strcmp(SYMBOL_NAME(table + i - 1),
> SYMBOL_NAME(table + i)) == 0 &&
> - table[i - 1].addr != table[i].addr)
> + table[i - 1].addr != table[i].addr) {
> fprintf(stderr,
> "Duplicate symbol '%s' (%llx != %llx)\n",
> SYMBOL_NAME(table + i),
> table[i].addr, table[i - 1].addr);
> + found_dup = true;
> + }
> unsorted = true;
> }
>
> + if (error_dup && found_dup)
> + exit(1);
> +
> if (unsorted)
> qsort(table, table_cnt, sizeof(*table), compare_value);
>
> --
> 2.1.4
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-04-05 21:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-05 19:26 [PATCH] x86/livepatch: Fail the build if duplicate symbols exist Andrew Cooper
2019-04-05 21:02 ` Konrad Rzeszutek Wilk [this message]
2019-04-08 9:52 ` Jan Beulich
2019-04-08 10:11 ` Andrew Cooper
2019-04-08 10:53 ` Jan Beulich
2019-04-11 19:51 ` Andrew Cooper
2019-04-12 11:39 ` Jan Beulich
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=20190405210250.GA18169@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=julien.grall@arm.com \
--cc=nmanthey@amazon.de \
--cc=roger.pau@citrix.com \
--cc=ross.lagerwall@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).