public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Randolph Sapp <rs@ti.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Randolph Sapp <rs@ti.com>
Cc: <robertcnelson@gmail.com>, <ayush@beagleboard.org>,
	<Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,
	<trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,
	<u-boot@lists.denx.de>
Subject: Re: [PATCHv3 4/6] efi_selftest_memory: check for duplicates first
Date: Fri, 17 Apr 2026 11:51:26 -0500	[thread overview]
Message-ID: <DHVL32OQW0ON.F5MYYVTYU1JE@ti.com> (raw)
In-Reply-To: <CAC_iWjKtRMz1Vr7VXyw56cij=zhcSRfOdGO=XGui3uYGcp1x7Q@mail.gmail.com>

On Fri Apr 17, 2026 at 3:17 AM CDT, Ilias Apalodimas wrote:
> On Thu, 16 Apr 2026 at 23:26, Randolph Sapp <rs@ti.com> wrote:
>>
>> On Thu Apr 16, 2026 at 3:55 AM CDT, Ilias Apalodimas wrote:
>> > On Mon, 13 Apr 2026 at 23:36, <rs@ti.com> wrote:
>> >>
>> >> From: Randolph Sapp <rs@ti.com>
>> >>
>> >> Check for duplicate memory mappings before reporting any incorrect
>> >> attributes. Could be that second allocation has the correct type while
>> >> the first doesn't. Knowing there is a duplicate in this scenario is
>> >> more helpful than just reporting the first mismatch.
>> >>
>> >> Signed-off-by: Randolph Sapp <rs@ti.com>
>> >
>> > [...]
>> >
>> >>                         }
>> >> -                       found = true;
>> >> -                       if (memory_type != entry->type) {
>> >> -                               efi_st_error
>> >> -                                       ("Wrong memory type %d, expected %d\n",
>> >> -                                        entry->type, memory_type);
>> >> -                               return EFI_ST_FAILURE;
>> >> -                       }
>> >> +                       match = entry;
>> >>                 }
>> >>         }
>> >> -       if (!found) {
>> >> +       if (!match) {
>> >>                 efi_st_error("Missing memory map entry\n");
>> >>                 return EFI_ST_FAILURE;
>> >>         }
>> >> +       if (memory_type != match->type) {
>> >> +               efi_st_error("Wrong memory type %d, expected %d\n", match->type,
>> >> +                            memory_type);
>> >> +               return EFI_ST_FAILURE;
>> >
>> > This check is now outside the loop and only checks for the last entry.
>> > If you wan't to split the fucntionality, don't we need a loop over all
>> > memory areas and the type?
>> >
>> > Thanks
>> > /Ilias
>>
>> Not necessarily. At the end of the day we can only really raise one exception
>> anyway. I just think informing the user about a duplicate should take priority
>> above mismatched attributes. It hints at a bigger issue.
>
> I dont mind about the priority. We can swap that over. But with this
> patch we will check for less problems than we currently do.
>
> Thanks
> /Ilias

In what regards? We're still checking for mismatched attributes, we just check
for duplicates first. If there's a dupe it doesn't really matter what the
attributes are on either allocation, good or bad something horrible has
occurred.

The prior version of this would never report if there was a duplicate unless the
first allocation it saw had the correct attributes.

>>
>> >> +       }
>> >>         return EFI_ST_SUCCESS;
>> >>  }
>> >>
>> >> --
>> >> 2.53.0
>> >>
>>


  reply	other threads:[~2026-04-17 16:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 20:35 [PATCHv3 0/6] various memory related fixups rs
2026-04-13 20:35 ` [PATCHv3 1/6] lmb: allocation flags macro documentation rs
2026-04-16  8:30   ` Ilias Apalodimas
2026-04-16 11:09     ` Heinrich Schuchardt
2026-04-19  3:52   ` Simon Glass
2026-04-13 20:35 ` [PATCHv3 2/6] lmb: add LMB_FDT for fdt reserved regions rs
2026-04-16  8:39   ` Ilias Apalodimas
2026-04-16 19:23     ` Randolph Sapp
2026-04-16 19:54       ` Ilias Apalodimas
2026-04-16 20:32         ` Randolph Sapp
2026-04-17  8:12           ` Ilias Apalodimas
2026-04-17 16:53             ` Randolph Sapp
2026-04-16 21:02   ` Simon Glass
2026-04-16 21:12     ` Randolph Sapp
2026-04-16 21:20       ` Simon Glass
2026-04-16 21:30         ` Randolph Sapp
2026-04-16 21:35           ` Simon Glass
2026-04-19  3:52   ` Simon Glass
2026-04-13 20:35 ` [PATCHv3 3/6] efi_dt_fixup: use fdtdec_get_bool rs
2026-04-19  3:52   ` Simon Glass
2026-04-13 20:35 ` [PATCHv3 4/6] efi_selftest_memory: check for duplicates first rs
2026-04-16  8:55   ` Ilias Apalodimas
2026-04-16 20:26     ` Randolph Sapp
2026-04-17  8:17       ` Ilias Apalodimas
2026-04-17 16:51         ` Randolph Sapp [this message]
2026-04-19  3:52   ` Simon Glass
2026-04-13 20:35 ` [PATCHv3 5/6] efi_mem_sort: use list_for_each_entry_safe instead rs
2026-04-16 10:13   ` Ilias Apalodimas
2026-04-19  3:52   ` Simon Glass
2026-04-13 20:35 ` [PATCHv3 6/6] memory: reserve from start_addr_sp to end_addr_sp rs
2026-04-16 14:37   ` Ilias Apalodimas
2026-04-16 19:01     ` Randolph Sapp
2026-04-17 20:47       ` Randolph Sapp
2026-04-19  3:52   ` 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=DHVL32OQW0ON.F5MYYVTYU1JE@ti.com \
    --to=rs@ti.com \
    --cc=Erik.Welsh@octavosystems.com \
    --cc=afd@ti.com \
    --cc=anshuld@ti.com \
    --cc=ayush@beagleboard.org \
    --cc=bb@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=robertcnelson@gmail.com \
    --cc=trini@konsulko.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox