From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>, u-boot@lists.denx.de
Subject: Re: [v6 01/12] sandbox: efi_loader: Correct use of addresses as pointers
Date: Wed, 27 Nov 2024 20:38:15 +0100 [thread overview]
Message-ID: <99be07a6-e4bf-4b3e-a44a-e714014fa029@gmx.de> (raw)
In-Reply-To: <55538d09-dd9f-424e-9600-a7d94172e216@gmx.de>
On 27.11.24 19:40, Heinrich Schuchardt wrote:
> On 27.11.24 18:17, Tom Rini wrote:
>> From: Simon Glass <sjg@chromium.org>
>>
>> The cache-flush function is incorrect which causes a crash in the
>> remoteproc tests with arm64.
>>
>> Fix both problems by using map_sysmem() to convert an address to a
>> pointer and map_to_sysmem() to convert a pointer to an address.
>>
>> Also update the image-loader's cache-flushing logic.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> Fixes: 3286d223fd7 ("sandbox: implement invalidate_icache_all()")
>> Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>
>> Changes in v6:
>> - Re-introduce
>>
>> Changes in v2:
>> - Drop message about EFI_LOADER
>>
>> arch/sandbox/cpu/cache.c | 8 +++++++-
>> drivers/remoteproc/rproc-elf-loader.c | 18 +++++++++++-------
>> lib/efi_loader/efi_image_loader.c | 3 ++-
>> 3 files changed, 20 insertions(+), 9 deletions(-)
>> ---
>> arch/sandbox/cpu/cache.c | 8 +++++++-
>> drivers/remoteproc/rproc-elf-loader.c | 18 +++++++++++-------
>> lib/efi_loader/efi_image_loader.c | 3 ++-
>> 3 files changed, 20 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/sandbox/cpu/cache.c b/arch/sandbox/cpu/cache.c
>> index c8a5e64214b6..96b3da47e8ed 100644
>> --- a/arch/sandbox/cpu/cache.c
>> +++ b/arch/sandbox/cpu/cache.c
>> @@ -4,12 +4,18 @@
>> */
>>
>> #include <cpu_func.h>
>> +#include <mapmem.h>
>> #include <asm/state.h>
>>
>> void flush_cache(unsigned long addr, unsigned long size)
>> {
>> + void *ptr;
>> +
>> + ptr = map_sysmem(addr, size);
>> +
>> /* Clang uses (char *) parameters, GCC (void *) */
>> - __builtin___clear_cache((void *)addr, (void *)(addr + size));
>> + __builtin___clear_cache(map_sysmem(addr, size), ptr + size);
>> + unmap_sysmem(ptr);
>> }
I missed this part when looking at the EFI change.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
next prev parent reply other threads:[~2024-11-27 19:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 17:17 [v6 0/12] CI: Set up for an arm64 runner Tom Rini
2024-11-27 17:17 ` [v6 01/12] sandbox: efi_loader: Correct use of addresses as pointers Tom Rini
2024-11-27 18:40 ` Heinrich Schuchardt
2024-11-27 18:51 ` Tom Rini
2024-11-27 19:13 ` Heinrich Schuchardt
2024-11-27 19:38 ` Heinrich Schuchardt [this message]
2024-11-27 21:09 ` Simon Glass
2024-11-27 21:14 ` Tom Rini
2024-11-30 20:24 ` Simon Glass
2024-11-27 17:17 ` [v6 02/12] test: Adjust print_ut test to use unsigned char Tom Rini
2024-11-27 17:17 ` [v6 03/12] docker: Add kernel.org x86_64 toolchain Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 04/12] docker: Use "make -j$(nproc)" when invoking make Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 05/12] docker: Update to grub-2.12 Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 06/12] docker: Build grub for all architectures Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 07/12] docker: Use cache mounts for apt Tom Rini
2024-11-28 15:45 ` Simon Glass
2024-11-27 17:17 ` [v6 08/12] docker: Support building for multiple architectures Tom Rini
2024-11-27 17:17 ` [v6 09/12] docker: Adjust installed packages slightly Tom Rini
2024-11-27 17:17 ` [v6 10/12] docker: Fix LegacyKeyValueFormat warning with PYTHONPATH Tom Rini
2024-11-27 17:17 ` [v6 11/12] docker: Install toolchains on arm64 host Tom Rini
2024-11-27 17:17 ` [v6 12/12] CI: Add platform variable Tom Rini
2024-12-03 19:57 ` [v6 0/12] CI: Set up for an arm64 runner Tom Rini
2024-12-17 19:45 ` Simon Glass
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=99be07a6-e4bf-4b3e-a44a-e714014fa029@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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