From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
U-Boot Mailing List <u-boot@lists.denx.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
AKASHI Takahiro <akashi.tkhro@gmail.com>,
Mark Kettenis <kettenis@openbsd.org>,
Masahisa Kojima <kojima.masahisa@socionext.com>,
Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: Re: [PATCH v4 04/25] efi_loader: Add comments where incorrect addresses are used
Date: Tue, 3 Dec 2024 08:09:52 -0600 [thread overview]
Message-ID: <20241203140952.GV2457179@bill-the-cat> (raw)
In-Reply-To: <CAFLszTiMi89uydJUmDg740opTJXm0YJ8WUQ5aJPwxPnb+9EGMw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3174 bytes --]
On Tue, Dec 03, 2024 at 06:45:58AM -0700, Simon Glass wrote:
> Hi Ilias,
>
> On Tue, 3 Dec 2024 at 01:49, Ilias Apalodimas
> <ilias.apalodimas@linaro.org> wrote:
> >
> > Hi Simon,
> >
> > On Tue, 3 Dec 2024 at 02:22, Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Tom,
> > >
> > > On Mon, 2 Dec 2024 at 13:18, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Sun, Dec 01, 2024 at 08:24:23AM -0700, Simon Glass wrote:
> > > >
> > > > > Some functions are passing addresses instead of pointers to the
> > > > > efi_add_memory_map() function. This confusion is understandable since
> > > > > the function arguments indicate an address.
> > > > >
> > > > > Make a note of the 8 places where there are problems, which would break
> > > > > usage in sandbox tests.
> > > > >
> > > > > Future work will resolve these problems.
> > > > >
> > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > >
> > > > Please just resolve these rather than introducing a patch to then fix
> > > > them later. This is something that should have been fixup'd before
> > > > posting. Thanks.
> > >
> > > That was deliberate, as I wanted people to see the problems. It will
> > > save discussion on later patches where the problems are fixed, if we
> > > can agree that these are actual problems. If people are happy to add
> > > review tags to the later patches then I'm happy to redo it.
> >
> > I am pretty sure Heinrich has repeated this in the past. Why do we
> > have to sprinkle around map_sysmem/unmap sysmem for sandbox?
> > Polluting the entire u-boot to support a special platform is less than
> > ideal. Why can't sandbox limit this internally and do whatever
> > mappings it needs when it receives an address?
>
> Tom, I suppose I have made my point.
>
> Ilias, this is documented at [1] and has been the same for 10 years.
>
> See for example the 'md' command, do_mem_md(), which shows how 'md 0'
> is implemented in sandbox.
>
> As I have mentioned before, the nice thing is that you can easily make
> code work with sandbox just by converting casts from
> address-to-pointer into map_sysmem().
>
> Back to this series, if you look at efi_allocate_pages() you'll
> currently see three calls (two map_to_sysmem() one map_sysmem(), but
> now, with this series, there is none. It also makes it a lot easier to
> understand what is going on, IMO.
>
> Regards,
> Simon
>
> [1] https://docs.u-boot.org/en/latest/arch/sandbox/sandbox.html#memory-emulation
This is something I was wondering about yesterday in fact. Especially
these days when "everyone" is developing on machines with 8GB or more of
memory, why does sandbox not just malloc 512MB/1GB/2GB/4GB (make it a
switch?) and pretend that area is memory starting at some address.
Especially if it's less than 4GB and starts at 0x80000000 more "memory
starts at 0" bugs would be found and fixed. I swear we did something
like that in my OS class 20+ years ago. I'm not sure what your link is
meant for, as it doesn't say why sandbox works the way it does, merely
that it works this way. Not that it can't work some other way.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2024-12-03 14:10 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-01 15:24 [PATCH v4 00/25] efi: Tidy up confusion between pointers and addresses Simon Glass
2024-12-01 15:24 ` [PATCH v4 01/25] efi: Define fields in struct efi_mem_desc Simon Glass
2024-12-01 15:24 ` [PATCH v4 02/25] efi_loader: Fix typos in enum efi_allocate_type Simon Glass
2024-12-02 20:17 ` Tom Rini
2024-12-01 15:24 ` [PATCH v4 03/25] efi_loader: Drop extra brackets in efi_mem_carve_out() Simon Glass
2024-12-02 20:16 ` Tom Rini
2024-12-03 0:24 ` Simon Glass
2024-12-03 0:37 ` Tom Rini
2024-12-03 13:46 ` Simon Glass
2024-12-03 14:04 ` Tom Rini
2024-12-03 15:53 ` Simon Glass
2024-12-03 16:02 ` Tom Rini
2024-12-03 19:45 ` Simon Glass
2024-12-01 15:24 ` [PATCH v4 04/25] efi_loader: Add comments where incorrect addresses are used Simon Glass
2024-12-02 20:18 ` Tom Rini
2024-12-03 0:22 ` Simon Glass
2024-12-03 0:38 ` Tom Rini
2024-12-03 8:48 ` Ilias Apalodimas
2024-12-03 13:45 ` Simon Glass
2024-12-03 14:09 ` Tom Rini [this message]
2024-12-03 15:55 ` Simon Glass
2024-12-01 15:24 ` [PATCH v4 05/25] efi_loader: Show the resulting memory address from an alloc Simon Glass
2024-12-01 15:24 ` [PATCH v4 06/25] efi_loader: Update startimage_exit self-test to check error Simon Glass
2024-12-01 15:24 ` [PATCH v4 07/25] efi_loader: Move some memory-function comments to header Simon Glass
2024-12-01 15:24 ` [PATCH v4 08/25] doc: efi: Add the EFI-loader API documentation Simon Glass
2024-12-01 15:24 ` [PATCH v4 09/25] efi_loader: Use the enum for memory type Simon Glass
2024-12-03 14:32 ` Heinrich Schuchardt
2024-12-03 15:53 ` Simon Glass
2024-12-10 16:17 ` Simon Glass
2024-12-10 17:13 ` Tom Rini
2024-12-01 15:24 ` [PATCH v4 10/25] efi_loader: Use a separate struct for memory nodes Simon Glass
2024-12-01 15:24 ` [PATCH v4 11/25] efi_loader: Drop virtual_start from priv_mem_desc Simon Glass
2024-12-01 15:24 ` [PATCH v4 12/25] efi_loader: Drop reserved " Simon Glass
2024-12-01 15:24 ` [PATCH v4 13/25] efi_loader: Use the enum for the memory type in priv_mem_desc Simon Glass
2024-12-01 15:24 ` [PATCH v4 14/25] efi_loader: Avoid assigning desc in efi_mem_carve_out() Simon Glass
2024-12-01 15:24 ` [PATCH v4 15/25] efi_loader: Move struct efi_mem_list fields together Simon Glass
2024-12-01 15:24 ` [PATCH v4 16/25] efi_loader: Rename struct efi_mem_list to mem_node Simon Glass
2024-12-01 15:24 ` [PATCH v4 17/25] efi_loader: Rename physical_start to base Simon Glass
2024-12-01 15:24 ` [PATCH v4 18/25] efi_loader: Use correct type in efi_add_runtime_mmio() Simon Glass
2024-12-01 15:24 ` [PATCH v4 19/25] efi_loader: Show the address for pool allocations Simon Glass
2024-12-01 15:24 ` [PATCH v4 20/25] efi_loader: Don't try to add sandbox runtime code Simon Glass
2024-12-01 15:24 ` [PATCH v4 21/25] efi_loader: Update to use addresses internally Simon Glass
2024-12-01 15:24 ` [PATCH v4 22/25] efi_loader: Correct address-usage in copy_fdt() Simon Glass
2024-12-01 15:24 ` [PATCH v4 23/25] efi_loader: Drop comments about incorrect addresses Simon Glass
2024-12-01 15:24 ` [PATCH v4 24/25] efi_bootmgr: Avoid casts in try_load_from_uri_path() Simon Glass
2024-12-01 15:24 ` [PATCH v4 25/25] efi_loader: Simplify efi_dp_from_mem() Simon Glass
2024-12-04 14:46 ` [PATCH v4 00/25] efi: Tidy up confusion between pointers and addresses Ilias Apalodimas
2024-12-04 15:13 ` 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=20241203140952.GV2457179@bill-the-cat \
--to=trini@konsulko.com \
--cc=akashi.tkhro@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=kettenis@openbsd.org \
--cc=kojima.masahisa@socionext.com \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.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 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.