From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, v3, 5/7] efi_loader: Readd freed pages to memory pool
Date: Thu, 13 Oct 2016 16:34:53 +0200 [thread overview]
Message-ID: <20161013143452.35202.86284@achrid.arch.suse.de> (raw)
In-Reply-To: <2f2cfb59ecf0457095c9c09b0e310677@rwthex-w2-b.rwth-ad.de>
> Currently each allocation creates a new mapping. Readding the mapping
> as free memory (EFI_CONVENTIONAL_MEMORY) potentially allows to hand out
> an existing mapping, thus limiting the number of mapping descriptors in
> the memory map.
>
> Mitigates a problem with current (4.8rc7) linux kernels when doing an
> efi_get_memory map, resulting in an infinite loop. Space for the memory
> map is reserved with allocate_pool (implicitly creating a new mapping) and
> filled. If there is insufficient slack space (8 entries) in the map, the
> space is freed and a new round is started, with space for one more entry.
> As each round increases requirement and allocation by exactly one, there
> is never enough slack space. (At least 32 entries are allocated, so as
> long as there are less than 24 entries, there is enough slack).
> Earlier kernels reserved no slack, and did less allocations, so this
> problem was not visible.
>
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Reviewed-by: Alexander Graf <agraf@suse.de>
Thanks, applied to
next prev parent reply other threads:[~2016-10-13 14:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20161001213229.19522-1-stefan.bruens@rwth-aachen.de>
2016-10-01 21:32 ` [U-Boot] [PATCH v3 1/7] efi_loader: Update description of internal efi_mem_carve_out Stefan Brüns
2016-10-02 8:25 ` Alexander Graf
2016-10-13 14:35 ` [U-Boot] [U-Boot, v3, " Alexander Graf
2016-10-01 21:32 ` [U-Boot] [PATCH v3 2/7] efi_loader: Fix memory map size check to avoid out-of-bounds access Stefan Brüns
2016-10-02 8:53 ` Alexander Graf
2016-10-01 21:32 ` [U-Boot] [PATCH v3 3/7] efi_loader: Move efi_allocate_pool implementation to efi_memory.c Stefan Brüns
2016-10-02 8:54 ` Alexander Graf
2016-10-01 21:32 ` [U-Boot] [PATCH v3 4/7] efi_loader: Track size of pool allocations to allow freeing Stefan Brüns
2016-10-02 9:04 ` Alexander Graf
2016-10-01 21:32 ` [U-Boot] [PATCH v3 5/7] efi_loader: Readd freed pages to memory pool Stefan Brüns
2016-10-13 14:34 ` Alexander Graf [this message]
2016-10-01 21:32 ` [U-Boot] [PATCH v3 6/7] efi_loader: Keep memory mapping sorted when splitting an entry Stefan Brüns
2016-10-13 14:34 ` [U-Boot] [U-Boot, v3, " Alexander Graf
2016-10-01 21:32 ` [U-Boot] [PATCH v3 7/7] efi_loader: Do not leak memory when unlinking a mapping Stefan Brüns
2016-10-13 14:35 ` [U-Boot] [U-Boot, v3, " Alexander Graf
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=20161013143452.35202.86284@achrid.arch.suse.de \
--to=agraf@suse.de \
--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