[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXF30WyFccj7uNTrf4YzndyaB8uL5PTQwJp8ADY-MTLTsQ@mail.gmail.com>
Date: Fri, 21 Jul 2023 16:42:08 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Alexandre Ghiti <alexghiti@...osinc.com>
Cc: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Kees Cook <keescook@...omium.org>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-efi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v5 4/5] libstub: Fix compilation warning for rv32
On Fri, 21 Jul 2023 at 09:52, Alexandre Ghiti <alexghiti@...osinc.com> wrote:
>
> Fix the following warning which appears when compiled for rv32 by using
> unsigned long type instead of u64.
>
> ../drivers/firmware/efi/libstub/efi-stub-helper.c: In function 'efi_kaslr_relocate_kernel':
> ../drivers/firmware/efi/libstub/efi-stub-helper.c:846:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 846 | (u64)_end < EFI_ALLOC_LIMIT) {
>
> Signed-off-by: Alexandre Ghiti <alexghiti@...osinc.com>
Acked-by: Ard Biesheuvel <ardb@...nel.org>
For all I care, you can just squash this into the previous patch as well.
> ---
> drivers/firmware/efi/libstub/kaslr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/libstub/kaslr.c b/drivers/firmware/efi/libstub/kaslr.c
> index be0c8ab0982a..afb857329799 100644
> --- a/drivers/firmware/efi/libstub/kaslr.c
> +++ b/drivers/firmware/efi/libstub/kaslr.c
> @@ -130,7 +130,7 @@ efi_status_t efi_kaslr_relocate_kernel(unsigned long *image_addr,
> if (!check_image_region(*image_addr, kernel_memsize)) {
> efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n");
> } else if (IS_ALIGNED(*image_addr, min_kimg_align) &&
> - (u64)_end < EFI_ALLOC_LIMIT) {
> + (unsigned long)_end < EFI_ALLOC_LIMIT) {
> /*
> * Just execute from wherever we were loaded by the
> * UEFI PE/COFF loader if the placement is suitable.
> --
> 2.39.2
>
Powered by blists - more mailing lists