From: Conor Dooley <conor@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: petrtesarik@huaweicloud.com,
Paul Walmsley <paul.walmsley@sifive.com>,
aou@eecs.berkeley.edu, Conor Dooley <conor.dooley@microchip.com>,
lihuafei1@huawei.com, liaochang1@huawei.com,
masahiroy@kernel.org, keescook@chromium.org,
akpm@linux-foundation.org, heiko@sntech.de, ribalda@chromium.org,
hi@alyssa.is, lizhengyu3@huawei.com,
linux-riscv@lists.infradead.org, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org, duwe@suse.de,
roberto.sassu@huaweicloud.com, petr@tesarici.cz
Subject: Re: [PATCH v2 2/3] riscv/purgatory: do not link with string.o and its dependencies
Date: Thu, 3 Aug 2023 16:17:26 +0100 [thread overview]
Message-ID: <20230803-buddhism-hardwood-eea45fdedd6e@spud> (raw)
In-Reply-To: <mhng-45e67c5d-6969-43da-9147-b53dc9a78612@palmer-ri-x1c9>
[-- Attachment #1: Type: text/plain, Size: 3333 bytes --]
On Thu, Aug 03, 2023 at 08:13:48AM -0700, Palmer Dabbelt wrote:
> On Wed, 26 Jul 2023 09:33:49 PDT (-0700), Conor Dooley wrote:
> > On Wed, Jul 26, 2023 at 11:54:00AM +0200, Petr Tesarik wrote:
> > > From: Petr Tesarik <petr.tesarik.ext@huawei.com>
> > >
> > > Linking with this object file makes kexec_file_load(2) fail because of
> > > multiple unknown relocation types:
> > >
> > > - R_RISCV_ADD16, R_RISCV_SUB16: used by alternatives in strcmp()
> > > - R_RISCV_GOT_HI20: used to resolve _ctype in strcasecmp()
> > >
> > > All this hassle is needed for one single call to memcmp() from
> > > verify_sha256_digest() to compare 32 bytes of SHA256 checksum.
> > >
> > > Simply replace this memcmp() call with an explicit loop over those 32 bytes
> > > and remove the need to link with string.o and all the other object files
> > > that provide undefined symbols from that object file.
> > >
> > > Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
> > > Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
> >
> > This version keeps the automation happy,
> > Acked-by: Conor Dooley <conor.dooley@microchip.com>
>
> Oddly enough, this breaks my builds. I tried fixing the first one with
> something like
You say "tried", does that mean it also didn't work?
What's the config?
Cheers,
Conor.
>
> From 41c5a952f77e53bf4201296abff0132725aa19e6 Mon Sep 17 00:00:00 2001
> From: Palmer Dabbelt <palmer@rivosinc.com>
> Date: Wed, 2 Aug 2023 20:22:33 -0700
> Subject: [PATCH] RISC-V: Include io from timex
> Without this I get some implicit declarations.
> CC arch/riscv/kernel/asm-offsets.s
> In file included from linux/include/linux/timex.h:67,
> from linux/include/linux/time32.h:13,
> from linux/include/linux/time.h:60,
> from linux/include/linux/ktime.h:24,
> from linux/include/linux/timer.h:6,
> from linux/include/linux/workqueue.h:9,
> from linux/include/linux/mm_types.h:19,
> from linux/include/linux/mmzone.h:22,
> from linux/include/linux/gfp.h:7,
> from linux/include/linux/mm.h:7,
> from linux/arch/riscv/kernel/asm-offsets.c:10:
> linux/arch/riscv/include/asm/timex.h: In function 'get_cycles':
> linux/arch/riscv/include/asm/timex.h:25:16: error: implicit declaration of function 'readl_relaxed' [-Werror=implicit-function-declaration]
> 25 | return readl_relaxed(((u32 *)clint_time_val));
> |
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---
> arch/riscv/include/asm/timex.h | 1 +
> 1 file changed, 1 insertion(+)
> diff --git a/arch/riscv/include/asm/timex.h b/arch/riscv/include/asm/timex.h
> index a06697846e69..1a4d181193e0 100644
> --- a/arch/riscv/include/asm/timex.h
> +++ b/arch/riscv/include/asm/timex.h
> @@ -7,6 +7,7 @@
> #define _ASM_RISCV_TIMEX_H
> #include <asm/csr.h>
> +#include <asm/io.h>
> typedef unsigned long cycles_t;
>
> -- 2.41.0
>
> The other two look fine and are somewhat independent, so I've picked those up
> for fixes.
>
> Thanks!
>
> >
> > Thanks,
> > Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-08-03 15:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 9:53 [PATCH v2 0/3] RISC-V: Fix a few kexec_file_load(2) failures Petr Tesarik
2023-07-26 9:53 ` [PATCH v2 1/3] riscv/kexec: handle R_RISCV_CALL_PLT relocation type Petr Tesarik
2023-07-26 16:30 ` Conor Dooley
2023-07-26 9:54 ` [PATCH v2 2/3] riscv/purgatory: do not link with string.o and its dependencies Petr Tesarik
2023-07-26 16:33 ` Conor Dooley
2023-08-03 15:13 ` Palmer Dabbelt
2023-08-03 15:17 ` Conor Dooley [this message]
2023-08-03 15:33 ` Petr Tesarik
2023-07-26 9:54 ` [PATCH v2 3/3] riscv/kexec: load initrd high in available memory Petr Tesarik
2023-07-26 16:38 ` Conor Dooley
2023-07-26 18:27 ` Petr Tesarik
2023-08-01 9:27 ` [PATCH v2 0/3] RISC-V: Fix a few kexec_file_load(2) failures Petr Tesarik
2023-08-03 15:10 ` patchwork-bot+linux-riscv
2023-08-09 14:35 ` (subset) " Palmer Dabbelt
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=20230803-buddhism-hardwood-eea45fdedd6e@spud \
--to=conor@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=duwe@suse.de \
--cc=heiko@sntech.de \
--cc=hi@alyssa.is \
--cc=keescook@chromium.org \
--cc=kexec@lists.infradead.org \
--cc=liaochang1@huawei.com \
--cc=lihuafei1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lizhengyu3@huawei.com \
--cc=masahiroy@kernel.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=petr@tesarici.cz \
--cc=petrtesarik@huaweicloud.com \
--cc=ribalda@chromium.org \
--cc=roberto.sassu@huaweicloud.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®