Re: [RFC PATCH v2 16/48] lmb: config: add lmb config symbols for SPL

2024-07-08 Thread Sughosh Ganu
On Sat, 6 Jul 2024 at 01:18, Tom Rini wrote: > > On Thu, Jul 04, 2024 at 01:05:12PM +0530, Sughosh Ganu wrote: > > > Add separate config symbols for enabling the LMB module for the SPL > > phase. The LMB module implementation now relies on alloced list data > > structu

[RFC PATCH v2 48/48] temp: mx6sabresd: bump up the size limit of the board

2024-07-04 Thread Sughosh Ganu
With the changes to add notifications for any changes to the LMB map, the size of the image exceeds the limit set. Bump up the image size limit for now to get the platform to build. This is not for committing. Signed-off-by: Sughosh Ganu --- Changes since V1: None configs/mx6sabresd_defconfig

[RFC PATCH v2 47/48] test: event: update the expected event dump output

2024-07-04 Thread Sughosh Ganu
With the addition of two events for notification of any changes to memory that is occupied and is free, the output of the event_dump.py script has changed. Update the expected event log to incorporate this change. Signed-off-by: Sughosh Ganu --- Changes since V1: * Remove the line for EFI mem

[RFC PATCH v2 46/48] lmb: mark the EFI runtime memory regions as reserved

2024-07-04 Thread Sughosh Ganu
Mark the EFI runtime memory region as reserved memory during board init so that it does not get allocated by the LMB module on subsequent memory requests. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch lib/lmb.c | 41 - 1 file changed, 20

[RFC PATCH v2 45/48] efi_memory: do not add RAM memory to the memory map

2024-07-04 Thread Sughosh Ganu
The EFI_CONVENTIONAL_MEMORY type, which is the usable RAM memory is now being managed by the LMB module. Remove the addition of this memory type to the EFI memory map. This memory now gets added to the EFI memory map as part of the LMB memory map update event handler. Signed-off-by: Sughosh Ganu

[RFC PATCH v2 44/48] x86: e820: use the lmb API for adding RAM memory

2024-07-04 Thread Sughosh Ganu
The EFI_CONVENTIONAL_MEMORY type is now being managed through the LMB module. Add a separate function, lmb_add_memory() to add the RAM memory to the LMB memory map. The efi_add_known_memory() function is now used for adding any other memory type to the EFI memory map. Signed-off-by: Sughosh Ganu

[RFC PATCH v2 43/48] layerscape: use the lmb API's to add RAM memory

2024-07-04 Thread Sughosh Ganu
The EFI memory allocations are now being done through the LMB module, and hence the memory map is maintained by the LMB module. Use the lmb_add_memory() API function to add the usable RAM memory to the LMB's memory map. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch arch/arm/cpu

[RFC PATCH v2 42/48] ti: k3: remove efi_add_known_memory() function definition

2024-07-04 Thread Sughosh Ganu
. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch arch/arm/mach-k3/common.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index eaa7d36176..a5c0170cd2 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3

[RFC PATCH v2 41/48] efi_memory: add an event handler to update memory map

2024-07-04 Thread Sughosh Ganu
-by: Sughosh Ganu --- Changes since V1: * Handle the addition of memory to the LMB memory map. * Pass the overlap_only_ram parameter to the efi_add_memory_map_pg() based on the type of operation. lib/efi_loader/Kconfig | 1 + lib/efi_loader/efi_memory.c | 34 ++ 2

[RFC PATCH v2 40/48] lmb: notify of any changes to the LMB memory map

2024-07-04 Thread Sughosh Ganu
then be used by the other module to keep track of available and used memory. Signed-off-by: Sughosh Ganu --- Changes since V1: * Notify addition of memory to the LMB memory map. * Add a function lmb_notify() to check if notification has to be sent. lib/lmb.c | 61

[RFC PATCH v2 39/48] add a function to check if an address is in RAM memory

2024-07-04 Thread Sughosh Ganu
Add a function to check if a given address falls within the RAM address used by U-Boot. This will be used to notify other modules if the address gets allocated, so as to not get re-allocated by some other module. Signed-off-by: Sughosh Ganu --- Changes since V1: * Have a common weak function

[RFC PATCH v2 38/48] lib: Kconfig: add a config symbol for getting lmb memory map updates

2024-07-04 Thread Sughosh Ganu
Add a Kconfig symbol to enable getting updates on any memory map changes that might be done by the LMB module. This notification mechanism can then be used to have a synchronous view of allocated and free memory. Signed-off-by: Sughosh Ganu --- Changes since V1: * Change the description

[RFC PATCH v2 37/48] event: add event to notify lmb memory map changes

2024-07-04 Thread Sughosh Ganu
Add an event which would be used for notifying changes in the LMB modules' memory map. This is to be used for having a synchronous view of the memory that is currently in use, and that is available for allocations. Signed-off-by: Sughosh Ganu --- Changes since V1: * Remove the event for EFI

[RFC PATCH v2 36/48] efi: memory: use the lmb API's for allocating and freeing memory

2024-07-04 Thread Sughosh Ganu
Use the LMB API's for allocating and freeing up memory. With this, the LMB module becomes the common backend for managing non U-Boot image memory that might be requested by other modules. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch lib/efi_loader/Kconfig | 1 + lib

[RFC PATCH v2 35/48] lmb: add a flag to allow suppressing memory map change notification

2024-07-04 Thread Sughosh Ganu
Add a flag LMB_NONOTIFY that can be passed to the LMB API's for reserving memory. This will then result in no notification being sent from the LMB module for the changes to the LMB's memory map. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch include/lmb.h | 1 + 1 file changed, 1

[RFC PATCH v2 34/48] lmb: add versions of the lmb API with flags

2024-07-04 Thread Sughosh Ganu
functions with flags for allocating and freeing up memory. The caller can then use these API's for specifying the type of memory that is required. For now, these functions will be used by the EFI memory module. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch include/lmb.h | 6

[RFC PATCH v2 33/48] test: bdinfo: dump the global LMB memory map

2024-07-04 Thread Sughosh Ganu
The LMB code has been changed to make the memory reservations persistent and global. Make corresponding change the the lmb_test_dump_all() function to print the global LMB available and used memory. Signed-off-by: Sughosh Ganu --- Changes since V1: * Corresponding changes needed to work

[RFC PATCH v2 32/48] test: lmb: invoke the LMB unit tests from a separate script

2024-07-04 Thread Sughosh Ganu
With the LMB tests moved under a separate class of unit tests, invoke these from a separate script which would allow for a system reset once the tests have been run. This enables clearing up the LMB memory map after having run the tests. Signed-off-by: Sughosh Ganu --- Changes since V1: New

[RFC PATCH v2 31/48] test: lmb: add a separate class of unit tests for lmb

2024-07-04 Thread Sughosh Ganu
on completion of these tests. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch include/test/suites.h| 1 + test/Kconfig | 9 ++ test/Makefile| 1 + test/cmd_ut.c| 7 + test/lib/Makefile| 1 - test/{lib/lmb.c

[RFC PATCH v2 30/48] test: lmb: run lmb tests only manually

2024-07-04 Thread Sughosh Ganu
be invoked through a separate test, and thus would not interfere with the running of the rest of the tests. Signed-off-by: Sughosh Ganu --- Changes since V1: None test/lib/lmb.c | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/test

[RFC PATCH v2 29/48] test: lmb: tweak the tests for the persistent lmb memory map

2024-07-04 Thread Sughosh Ganu
to initialise and cleanup the lists. These functions will be invoked from every test to start the memory map from a clean slate. Signed-off-by: Sughosh Ganu --- Changes since V1: * Make changes to the lmb_init() function for working with alist based lmb lists. * Add a lmb_uninit() function to clear out

[RFC PATCH v2 28/48] test: cedit: use allocated address for reading file

2024-07-04 Thread Sughosh Ganu
and then read the file to that address. Signed-off-by: Sughosh Ganu --- Changes since V1: * Free up the memory allocated once done with it. test/boot/cedit.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index fd19da0a0c..923ddd1481 100644

[RFC PATCH v2 27/48] zynq: lmb: do not add to lmb map before relocation

2024-07-04 Thread Sughosh Ganu
The LMB memory is typically not needed very early in the platform's boot. Do not add memory to the LMB map before relocation. Reservation of common areas and adding of memory is done after relocation. Signed-off-by: Sughosh Ganu --- Changes since V1: None board/xilinx/common/board.c | 31

[RFC PATCH v2 26/48] sandbox: iommu: remove lmb allocation in the driver

2024-07-04 Thread Sughosh Ganu
this memory range has other side effects. On the other hand, the sandbox iommu test expects to see this particular value of the DVA. Use the DVA address directly, instead of mapping it in the LMB memory map, and then have it allocated. Signed-off-by: Sughosh Ganu --- Changes since V1: None drivers/iommu

[RFC PATCH v2 25/48] sandbox: spl: enable lmb in SPL

2024-07-04 Thread Sughosh Ganu
Enable the LMB module in the SPL stage. This will allow the LMB code to be exercised and tested in the SPL stage. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch configs/sandbox_spl_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox_spl_defconfig b

[RFC PATCH v2 24/48] lmb: add a common implementation of arch_lmb_reserve()

2024-07-04 Thread Sughosh Ganu
of using the current value of stack pointer for starting the reserved region, have a fixed value, considering the stack size config value. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch arch/arc/lib/cache.c| 14 -- arch/arm/lib/stack.c| 14

[RFC PATCH v2 23/48] lmb: use the BIT macro for lmb flags

2024-07-04 Thread Sughosh Ganu
Use the BIT macro for assigning values to the LMB flags instead of assigning random values to them. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch based on review comment from Heinrich include/lmb.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include

[RFC PATCH v2 22/48] lmb: init: initialise the lmb data structures during board init

2024-07-04 Thread Sughosh Ganu
the board init. Signed-off-by: Sughosh Ganu --- Changes since V1: * Initialise the lmb structures as part of board init. * Initialise the lmb structure durint SPL init when enabled. common/board_r.c | 4 common/spl/spl.c | 4 include/lmb.h| 11 +++ lib/lmb.c| 20

[RFC PATCH v2 21/48] lmb: remove lmb_init_and_reserve_range() function

2024-07-04 Thread Sughosh Ganu
With the move to make the LMB allocations persistent and the common memory regions being reserved during board init, there is no need for an explicit reservation of a memory range. Remove the lmb_init_and_reserve_range() function. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas

[RFC PATCH v2 20/48] lmb: reserve common areas during board init

2024-07-04 Thread Sughosh Ganu
in the board's DTB. Mark these regions of memory with the LMB_NOOVERWRITE flag to indicate that these regions cannot be re-requested or overwritten. Signed-off-by: Sughosh Ganu --- Changes since V1: * Mark the reserved regions as LMB_NOOVERWRITE. * Call the lmb_reserve_common() function in U-Boot proper

[RFC PATCH v2 19/48] lmb: remove the lmb_init_and_reserve() function

2024-07-04 Thread Sughosh Ganu
With the changes to make the LMB reservations persistent, the common memory regions are being added during board init. Remove the now superfluous lmb_init_and_reserve() function. Signed-off-by: Sughosh Ganu --- Changes since V1: * Removed the replacement of lmb_init_and_reserve

[RFC PATCH v2 18/48] lmb: introduce a function to add memory to the lmb memory map

2024-07-04 Thread Sughosh Ganu
Introduce a function lmb_add_memory() to add available memory to the LMB memory map. Call this function during board init once the LMB data structures have been initialised. Signed-off-by: Sughosh Ganu --- Changes since V1: * Add memory only till ram_top to the LMB memory map, instead of all

[RFC PATCH v2 17/48] lmb: allow lmb module to be used in SPL

2024-07-04 Thread Sughosh Ganu
With the introduction of separate config symbols for the SPL phase of U-Boot, the condition checks need to be tweaked so that platforms that enable the LMB module in SPL are also able to call the LMB API's. Use the appropriate condition checks to achieve this. Signed-off-by: Sughosh Ganu

[RFC PATCH v2 16/48] lmb: config: add lmb config symbols for SPL

2024-07-04 Thread Sughosh Ganu
a heap in SPL. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch lib/Kconfig | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig b/lib/Kconfig index 072ed0ecfa..7eea517b3b 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1103,7 +1103,17 @@ config

[RFC PATCH v2 15/48] test: lmb: remove the test for max regions

2024-07-04 Thread Sughosh Ganu
The LMB memory map is now persistent and global, and the CONFIG_LMB_USE_MAX_REGIONS config symbol has now been removed. Remove the corresponding lmb test case. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch test/lib/lmb.c | 67 -- 1

[RFC PATCH v2 14/48] lmb: remove config symbols used for lmb region count

2024-07-04 Thread Sughosh Ganu
with the earlier implementation of static arrays. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch configs/a3y17lte_defconfig | 1 - configs/a5y17lte_defconfig | 1 - configs/a7y17lte_defconfig | 1 - configs/apple_m1_defconfig | 1 - configs

[RFC PATCH v2 13/48] lmb: make LMB memory map persistent and global

2024-07-04 Thread Sughosh Ganu
for the available(free) memory, and one for the used memory. Once full, the list can then be extended at runtime. Signed-off-by: Sughosh Ganu --- Changes since V1: * Use alloced list structure for the available and reserved memory lists instead of static arrays. * Corresponding changes in the code

[RFC PATCH v2 12/48] lmb: allow for resizing lmb regions

2024-07-04 Thread Sughosh Ganu
with this attribute would indicate that the region cannot be resized. Signed-off-by: Sughosh Ganu --- Changes since V1: * Do the check for the region flags in lmb_resize_regions() and lmb_merge_overlap_regions() to decide on merging the overlapping regions. include/lmb.h | 1 + lib/lmb.c | 116

[RFC PATCH v2 11/48] lmb: pass a flag to image_setup_libfdt() for lmb reservations

2024-07-04 Thread Sughosh Ganu
if the region occupied by the FDT blob is to be marked as reserved by the LMB module. Signed-off-by: Sughosh Ganu --- Changes since V1: * Use true/false identifiers for bool instead of 1/0 * Fix the argument passed to the function in arch/mips/lib/bootm.c arch/mips/lib/bootm.c | 2 +- boot

[RFC PATCH v2 10/48] lmb: remove local instances of the lmb structure variable

2024-07-04 Thread Sughosh Ganu
With the move of the LMB structure to a persistent state, there is no need to declare the variable locally, and pass it as part of the LMB API's. Remove all local variable instances and change the API's correspondingly. Signed-off-by: Sughosh Ganu --- Changes since V1: None arch/arc/lib

[RFC PATCH v2 09/48] lmb: remove call to lmb_init()

2024-07-04 Thread Sughosh Ganu
The LMB module will be changed to have persistent and global memory maps of available and used memory. With this change, there won't be any need to explicitly initialise the LMB memory maps. Remove the call to the lmb_init() function. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch

[RFC PATCH v2 08/48] lmb: staticize __lmb_alloc_base()

2024-07-04 Thread Sughosh Ganu
The __lmb_alloc_base() function is only called from within the lmb module. Moreover, the lmb_alloc() and lmb_alloc_base() API's are good enough for the allocation API calls. Make the __lmb_alloc_base() function static. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas --- Changes since

[RFC PATCH v2 07/48] lmb: remove the unused lmb_is_reserved() function

2024-07-04 Thread Sughosh Ganu
The lmb_is_reserved() API is not used. There is another API, lmb_is_reserved_flags() which can be used to check if a particular memory region is reserved. Remove the unused API. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas --- Changes since V1: None include/lmb.h | 11

[RFC PATCH v2 06/48] alist: add a function declaration for alist_expand_by()

2024-07-04 Thread Sughosh Ganu
The alist_expand_by() function is a global function. Add a declaration for the function in the header. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch include/alist.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/alist.h b/include/alist.h index bab146c35d

[RFC PATCH v2 05/48] alist: add a couple of helper functions

2024-07-04 Thread Sughosh Ganu
Add a couple of helper functions to detect an empty and full alist. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch include/alist.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/alist.h b/include/alist.h index a68afc9fff..bab146c35d 100644

[RFC PATCH v2 04/48] lib: Convert str_to_list() to use alist

2024-07-04 Thread Sughosh Ganu
From: Simon Glass Use this new data structure in the utility function. Signed-off-by: Simon Glass Signed-off-by: Sughosh Ganu --- lib/strto.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/strto.c b/lib/strto.c index f83ac67c66

[RFC PATCH v2 03/48] alist: Add support for an allocated pointer list

2024-07-04 Thread Sughosh Ganu
the code. Introduce a new data structure, which is a variable-sized list of structs each of the same, pre-set size. It provides O(1) access and is reasonably efficient at expanding linearly, since it doubles in size when it runs out of space. Signed-off-by: Simon Glass Signed-off-by: Sughosh Ganu

[RFC PATCH v2 02/48] lib: Handle a special case with str_to_list()

2024-07-04 Thread Sughosh Ganu
From: Simon Glass The current implementation can return an extra result at the end when the string ends with a space. Fix this by adding a special case. Signed-off-by: Simon Glass Signed-off-by: Sughosh Ganu --- lib/strto.c | 4 +++- test/str_ut.c | 4 +--- 2 files changed, 4 insertions

[RFC PATCH v2 01/48] malloc: Support testing with realloc()

2024-07-04 Thread Sughosh Ganu
From: Simon Glass At present in tests it is possible to cause an out-of-memory condition with malloc() but not realloc(). Add support to realloc() too, so code which uses that function can be tested. Signed-off-by: Simon Glass Signed-off-by: Sughosh Ganu --- common/dlmalloc.c | 4 1

[RFC PATCH v2 00/48] Make U-Boot memory reservations coherent

2024-07-04 Thread Sughosh Ganu
tr_to_list() alist: Add support for an allocated pointer list lib: Convert str_to_list() to use alist Sughosh Ganu (44): alist: add a couple of helper functions alist: add a function declaration for alist_expand_by() lmb: remove the unused lmb_is_reserved() function lmb: staticize __lmb_

Re: [PATCH v3 07/18] binman: Keep the efi_capsule input file

2024-06-21 Thread Sughosh Ganu
11b27a ("binman: capsule: Add support for generating...") > --- Acked-by: Sughosh Ganu Although I don't think this warrants a Fixes tag. It is not fixing any issue as such. -sughosh > > (no changes since v1) > > tools/binman/etype/efi_capsule.py | 1 - > 1 file change

Re: [RFC PATCH 04/31] lmb: remove local instances of the lmb structure variable

2024-06-13 Thread Sughosh Ganu
On Thu, 13 Jun 2024 at 22:57, Heinrich Schuchardt wrote: > > On 13.06.24 18:59, Simon Glass wrote: > > Hi Tom, > > > > On Thu, 13 Jun 2024 at 09:42, Tom Rini wrote: > >> > >> On Thu, Jun 13, 2024 at 09:22:15AM -0600, Simon Glass wrote: > >>> Hi Tom, > >>> > >>> On Wed, 12 Jun 2024 at 15:40, Tom

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-12 Thread Sughosh Ganu
On Wed, 12 Jun 2024 at 12:16, Ilias Apalodimas wrote: > > On Mon, 10 Jun 2024 at 18:54, Simon Glass wrote: > > > > Hi, > > > > On Mon, 10 Jun 2024 at 09:42, Sughosh Ganu wrote: > > > > > > On Mon, 10 Jun 2024 at 20:47, Heinrich Schuchardt

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-12 Thread Sughosh Ganu
hi Ilias, On Wed, 12 Jun 2024 at 11:19, Ilias Apalodimas wrote: > > [...] > > > > > > > > > > + struct event_lmb_map_update *lmb_map = > > > > > > > > > >data.lmb_map; > > > > > > > > > + > > > > > > > > > + addr = (uintptr_t)map_sysmem(lmb_map->base, 0); > > > > > > > > > + pages =

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-11 Thread Sughosh Ganu
On Tue, 11 Jun 2024 at 15:47, Heinrich Schuchardt wrote: > > On 07.06.24 20:52, Sughosh Ganu wrote: > > There are events that would be used to notify other interested modules > > of any changes in available and occupied memory. This would happen > > when a module allo

Re: [RFC PATCH 22/31] test: lmb: run the LMB tests only on sandbox

2024-06-11 Thread Sughosh Ganu
On Tue, 11 Jun 2024 at 15:31, Heinrich Schuchardt wrote: > > On 11.06.24 10:55, Sughosh Ganu wrote: > > On Mon, 10 Jun 2024 at 23:14, Tom Rini wrote: > >> > >> On Sat, Jun 08, 2024 at 12:22:31AM +0530, Sughosh Ganu wrote: > >> > >>> The L

Re: [RFC PATCH 09/31] lmb: allow for resizing lmb regions

2024-06-11 Thread Sughosh Ganu
On Tue, 11 Jun 2024 at 14:47, Heinrich Schuchardt wrote: > > On 07.06.24 20:52, Sughosh Ganu wrote: > > Allow for resizing of LMB regions if the region attributes match. The > > current code returns a failure status on detecting an overlapping > > address. This worked up

Re: [RFC PATCH 17/31] lmb: remove call to efi_lmb_reserve()

2024-06-11 Thread Sughosh Ganu
On Tue, 11 Jun 2024 at 14:42, Heinrich Schuchardt wrote: > > On 07.06.24 20:52, Sughosh Ganu wrote: > > The changes in the EFI memory map are now notified to the LMB > > module. There is therefore no need to explicitly get the efi memory > > map and set aside

Re: [RFC PATCH 00/31] Make U-Boot memory reservations coherent

2024-06-11 Thread Sughosh Ganu
On Tue, 11 Jun 2024 at 02:35, Tom Rini wrote: > > On Sat, Jun 08, 2024 at 12:22:09AM +0530, Sughosh Ganu wrote: > > > The aim of this patch series is to fix the current state of > > incoherence between modules when it comes to memory usage. The primary > > issue that t

Re: [RFC PATCH 22/31] test: lmb: run the LMB tests only on sandbox

2024-06-11 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 23:14, Tom Rini wrote: > > On Sat, Jun 08, 2024 at 12:22:31AM +0530, Sughosh Ganu wrote: > > > The LMB memory map is now persistent and global. Running the tests for > > the LMB module will result in the memory map getting reset, and this >

Re: [RFC PATCH 08/31] lmb: replcace the lmb_init_and_reserve() function

2024-06-11 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 23:01, Tom Rini wrote: > > On Sat, Jun 08, 2024 at 12:22:17AM +0530, Sughosh Ganu wrote: > > With the changes to make the Logical Memory Block(LMB) allocations > > persistent and with the common memory regions being reserved during > > board init,

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-10 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 20:47, Heinrich Schuchardt wrote: > > On 07.06.24 20:52, Sughosh Ganu wrote: > > There are events that would be used to notify other interested modules > > of any changes in available and occupied memory. This would happen > > when a module allo

Re: Proposal: U-Boot memory management

2024-06-10 Thread Sughosh Ganu
hi Simon, On Mon, 10 Jun 2024 at 20:33, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 10 Jun 2024 at 08:40, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Mon, 10 Jun 2024 at 19:25, Simon Glass wrote: > > > > > > Hi Sughosh, > &

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-10 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 20:22, Sughosh Ganu wrote: > > hi Ilias, > > On Mon, 10 Jun 2024 at 19:48, Ilias Apalodimas > wrote: > > > > Hi Sughosh > > > > On Mon, 10 Jun 2024 at 15:25, Sughosh Ganu wrote: > > > > > > On

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-10 Thread Sughosh Ganu
hi Ilias, On Mon, 10 Jun 2024 at 19:48, Ilias Apalodimas wrote: > > Hi Sughosh > > On Mon, 10 Jun 2024 at 15:25, Sughosh Ganu wrote: > > > > On Mon, 10 Jun 2024 at 17:40, Ilias Apalodimas > > wrote: > > > > > > On Fri, 7 Jun 2024 at 21:54, Sugho

Re: Proposal: U-Boot memory management

2024-06-10 Thread Sughosh Ganu
hi Simon, On Mon, 10 Jun 2024 at 19:25, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 6 Jun 2024 at 13:18, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Wed, 29 May 2024 at 22:00, Simon Glass wrote: > > > > > > +Sughosh Ganu for referen

Re: [RFC PATCH 09/31] lmb: allow for resizing lmb regions

2024-06-10 Thread Sughosh Ganu
hi Ilias, On Mon, 10 Jun 2024 at 19:52, Ilias Apalodimas wrote: > > Hi Sughosh > > On Mon, 10 Jun 2024 at 15:57, Sughosh Ganu wrote: > > > > On Mon, 10 Jun 2024 at 18:17, Ilias Apalodimas > > wrote: > > > > > > On Mon, 10 Jun 2024 at 15:20, Sugh

Re: [RFC PATCH 09/31] lmb: allow for resizing lmb regions

2024-06-10 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 18:29, Heinrich Schuchardt wrote: > > On 10.06.24 14:20, Sughosh Ganu wrote: > > hi Ilias, > > > > On Mon, 10 Jun 2024 at 17:34, Ilias Apalodimas > > wrote: > >> > >> Hi Sughosh > >> > >> > >> On Fr

Re: [RFC PATCH 09/31] lmb: allow for resizing lmb regions

2024-06-10 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 18:17, Ilias Apalodimas wrote: > > On Mon, 10 Jun 2024 at 15:20, Sughosh Ganu wrote: > > > > hi Ilias, > > > > On Mon, 10 Jun 2024 at 17:34, Ilias Apalodimas > > wrote: > > > > > > Hi Sughosh > > &g

Re: [RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-10 Thread Sughosh Ganu
On Mon, 10 Jun 2024 at 17:40, Ilias Apalodimas wrote: > > On Fri, 7 Jun 2024 at 21:54, Sughosh Ganu wrote: > > > > There are events that would be used to notify other interested modules > > of any changes in available and occupied memory. This would happen > > when

Re: [RFC PATCH 09/31] lmb: allow for resizing lmb regions

2024-06-10 Thread Sughosh Ganu
hi Ilias, On Mon, 10 Jun 2024 at 17:34, Ilias Apalodimas wrote: > > Hi Sughosh > > > On Fri, 7 Jun 2024 at 21:54, Sughosh Ganu wrote: > > > > Allow for resizing of LMB regions if the region attributes match. The > > current code returns a failure status on det

Re: [RFC PATCH 11/31] lib: Kconfig: add a config symbol for getting memory map updates

2024-06-10 Thread Sughosh Ganu
hi Ilias, On Mon, 10 Jun 2024 at 17:15, Ilias Apalodimas wrote: > > On Fri, 7 Jun 2024 at 21:54, Sughosh Ganu wrote: > > > > Add a Kconfig symbol to enable getting updates on any memory map > > changes that might be done by some other module. This notification > &

Re: [RFC PATCH 31/31] temp: cmd: efi: add a command to dump EFI memory map

2024-06-10 Thread Sughosh Ganu
On Sat, 8 Jun 2024 at 09:03, Heinrich Schuchardt wrote: > > > > Am 7. Juni 2024 20:52:40 MESZ schrieb Sughosh Ganu : > >Add a command to dump the EFI memory map. > > What are you missing in 'efidebug memmap'? Nothing. I wasn't aware of this sub-command. Thanks for po

Re: [RFC PATCH 30/31] temp: cmd: efi_mem: add a command to test efi alloc/free

2024-06-10 Thread Sughosh Ganu
On Sat, 8 Jun 2024 at 09:07, Heinrich Schuchardt wrote: > > > > Am 7. Juni 2024 20:52:39 MESZ schrieb Sughosh Ganu : > >Not for committing. > > Best put "DON'T MERGE" into the title to avoid mishaps in future versions. Will do. > > In the final seri

Re: [RFC PATCH 26/31] test: lmb: run lmb tests only manually

2024-06-10 Thread Sughosh Ganu
On Sat, 8 Jun 2024 at 10:09, Heinrich Schuchardt wrote: > > On 6/7/24 20:52, Sughosh Ganu wrote: > > The LMB code has been changed so that the memory reservations and > > allocations are now persistent and global. With this change, the > > design of the LMB tests needs t

[RFC PATCH 31/31] temp: cmd: efi: add a command to dump EFI memory map

2024-06-07 Thread Sughosh Ganu
Add a command to dump the EFI memory map. Not for committing. Signed-off-by: Sughosh Ganu --- cmd/Makefile| 1 + cmd/efi_map_dump.c | 28 include/efi_loader.h| 2 ++ lib/efi_loader/efi_memory.c | 32

[RFC PATCH 30/31] temp: cmd: efi_mem: add a command to test efi alloc/free

2024-06-07 Thread Sughosh Ganu
Not for committing. Signed-off-by: Sughosh Ganu --- cmd/Makefile | 1 + cmd/efi_memory.c | 155 +++ 2 files changed, 156 insertions(+) create mode 100644 cmd/efi_memory.c diff --git a/cmd/Makefile b/cmd/Makefile index 87133cc27a..35fcc4af5a

[RFC PATCH 29/31] temp: mx6sabresd: bump up the size limit of the board

2024-06-07 Thread Sughosh Ganu
With the changes to add notifications for any changes to the LMB map, the size of the image exceeds the limit set. Bump up the image size limit for now to get the platform to build. This is not for committing. Signed-off-by: Sughosh Ganu --- Note: @Fabio Estevam, please check if it would

[RFC PATCH 28/31] cmd: bdinfo: only dump the current LMB memory

2024-06-07 Thread Sughosh Ganu
The LMB memory map is now persistent and global. There is therefore no need to add memory to the LMB memory map as part of the bdinfo command. Only dump the current available and reserved memory as part of the bdinfo command. Signed-off-by: Sughosh Ganu --- cmd/bdinfo.c | 1 - 1 file changed, 1

[RFC PATCH 27/31] test: bdinfo: dump the global LMB memory map

2024-06-07 Thread Sughosh Ganu
The LMB code has been changed to make the memory reservations persistent and global. Make corresponding change the the lmb_test_dump_all() function to print the global LMB added and reserved memory. Signed-off-by: Sughosh Ganu --- test/cmd/bdinfo.c | 12 ++-- 1 file changed, 6

[RFC PATCH 26/31] test: lmb: run lmb tests only manually

2024-06-07 Thread Sughosh Ganu
, and thus would not interfere with the running of the rest of the tests. Signed-off-by: Sughosh Ganu --- test/lib/lmb.c | 49 - 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/test/lib/lmb.c b/test/lib/lmb.c index 67a6be5bc3..813f7e3100

[RFC PATCH 25/31] test: lmb: adjust the test case to handle overlapping regions

2024-06-07 Thread Sughosh Ganu
The LMB code can now accept reserving and adding overlapping regions of memory. Adjust the test for checking the reservation of overlapping memory regions to work with this corresponding change in the LMB code. Signed-off-by: Sughosh Ganu --- test/lib/lmb.c | 8 1 file changed, 4

[RFC PATCH 24/31] test: lmb: add a test case for checking overlapping region add

2024-06-07 Thread Sughosh Ganu
Memory managed by LMB is now persistent and global. With that, it could be possible for multiple callers to try to add memory that has already been added. Add a test case to check that the LMB module handles it as expected. Signed-off-by: Sughosh Ganu --- test/lib/lmb.c | 16 1

[RFC PATCH 23/31] test: lmb: initialise the lmb structure before tests

2024-06-07 Thread Sughosh Ganu
of every test. Signed-off-by: Sughosh Ganu --- include/lmb.h | 4 lib/lmb.c | 17 + test/lib/lmb.c | 18 ++ 3 files changed, 39 insertions(+) diff --git a/include/lmb.h b/include/lmb.h index 1d4cd255d2..08ece0a90b 100644 --- a/include/lmb.h +++ b/include

[RFC PATCH 22/31] test: lmb: run the LMB tests only on sandbox

2024-06-07 Thread Sughosh Ganu
of tests. Signed-off-by: Sughosh Ganu --- test/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/Makefile b/test/lib/Makefile index e75a263e6a..9154e07993 100644 --- a/test/lib/Makefile +++ b/test/lib/Makefile @@ -9,7 +9,7 @@ obj-$(CONFIG_EFI_LOADER

[RFC PATCH 21/31] test: event: update the expected event dump output

2024-06-07 Thread Sughosh Ganu
With the addition of two events for notification of any changes to memory that is occupied and is free, the output of the event_dump.py script has changed. Update the expected event log to incorporate this change. Signed-off-by: Sughosh Ganu --- test/py/tests/test_event_dump.py | 2 ++ 1 file

[RFC PATCH 20/31] test: cedit: use allocated address for reading file

2024-06-07 Thread Sughosh Ganu
and then read the file to that address. Signed-off-by: Sughosh Ganu --- test/boot/cedit.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index aa41719048..1f4147da89 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -8,6 +8,7

[RFC PATCH 19/31] zynq: lmb: do not add to lmb map before relocation

2024-06-07 Thread Sughosh Ganu
The LMB memory is typically not needed very early in the platform's boot. Do not add memory to the LMB map before relocation. Reservation of common areas and adding of memory is done after relocation. Signed-off-by: Sughosh Ganu --- board/xilinx/common/board.c | 31

[RFC PATCH 18/31] sandbox: iommu: remove lmb allocation in the driver

2024-06-07 Thread Sughosh Ganu
this memory range has other side effects. On the other hand, the sandbox iommu test expects to see this particular value of the DVA. Use the DVA address directly, instead of mapping it in the LMB memory map, and then have it allocated. Signed-off-by: Sughosh Ganu --- drivers/iommu/sandbox_iommu.c | 7

[RFC PATCH 17/31] lmb: remove call to efi_lmb_reserve()

2024-06-07 Thread Sughosh Ganu
The changes in the EFI memory map are now notified to the LMB module. There is therefore no need to explicitly get the efi memory map and set aside the EFI allocated memory. Signed-off-by: Sughosh Ganu --- lib/lmb.c | 35 --- 1 file changed, 35 deletions(-) diff

[RFC PATCH 16/31] lmb: add an event handler to update memory map

2024-06-07 Thread Sughosh Ganu
-by: Sughosh Ganu --- lib/Kconfig | 1 + lib/lmb.c | 34 ++ 2 files changed, 35 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index 9ea02ae006..9e465a748b 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -,6 +,7 @@ config LMB bool "Enable the lo

[RFC PATCH 15/31] efi_memory: add an event handler to update memory map

2024-06-07 Thread Sughosh Ganu
-by: Sughosh Ganu --- lib/efi_loader/efi_memory.c | 70 ++--- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 435e580fb3..93244161b0 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib

[RFC PATCH 14/31] lmb: notify of any changes to the LMB memory map

2024-06-07 Thread Sughosh Ganu
then be used by the other module to allocate memory only from available regions, instead of overwriting already allocated memory. Signed-off-by: Sughosh Ganu --- lib/lmb.c | 49 +++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/lmb.c b

[RFC PATCH 13/31] efi_memory: notify of any changes to the EFI memory map

2024-06-07 Thread Sughosh Ganu
then be used by the other module to allocate memory only from available regions, instead of overwriting already allocated memory. Signed-off-by: Sughosh Ganu --- lib/efi_loader/efi_memory.c | 25 + 1 file changed, 25 insertions(+) diff --git a/lib/efi_loader/efi_memory.c b

[RFC PATCH 12/31] add a function to check if an address is in RAM memory

2024-06-07 Thread Sughosh Ganu
Add a function to check if a given address falls within the RAM address used by U-Boot. This will be used to notify other modules if the address gets allocated, so as to not get re-allocated by some other module. Signed-off-by: Sughosh Ganu --- arch/sandbox/cpu/cpu.c | 5 + common/board_r.c

[RFC PATCH 11/31] lib: Kconfig: add a config symbol for getting memory map updates

2024-06-07 Thread Sughosh Ganu
Add a Kconfig symbol to enable getting updates on any memory map changes that might be done by some other module. This notification mechanism can then be used to have a synchronous view of allocated and free memory. Signed-off-by: Sughosh Ganu --- lib/Kconfig | 9 + 1 file changed, 9

[RFC PATCH 10/31] event: add events to notify memory map changes

2024-06-07 Thread Sughosh Ganu
Add events which would be used for notifying changes in the respective modules' memory map. This is to be used for having a synchronous view of the memory that is currently in use, and that is available for allocations. Signed-off-by: Sughosh Ganu --- common/event.c | 4 include/event.h

[RFC PATCH 09/31] lmb: allow for resizing lmb regions

2024-06-07 Thread Sughosh Ganu
with this attribute would indicate that the region cannot be resized. Signed-off-by: Sughosh Ganu --- include/lmb.h | 1 + lib/lmb.c | 120 -- 2 files changed, 107 insertions(+), 14 deletions(-) diff --git a/include/lmb.h b/include/lmb.h index

[RFC PATCH 08/31] lmb: replcace the lmb_init_and_reserve() function

2024-06-07 Thread Sughosh Ganu
-off-by: Sughosh Ganu --- arch/arm/mach-apple/board.c | 2 +- arch/arm/mach-snapdragon/board.c | 2 +- arch/arm/mach-stm32mp/stm32mp1/cpu.c | 2 +- cmd/bdinfo.c | 2 +- cmd/load.c | 2 +- fs/fs.c | 2

[RFC PATCH 07/31] lmb: remove lmb_init_and_reserve_range() function

2024-06-07 Thread Sughosh Ganu
With the move to make the LMB allocations persistent and the common memory regions being reserved during board init, the lmb_init_and_reserve_range() API can be replaced with a simple lmb_add() call. Signed-off-by: Sughosh Ganu --- boot/bootm.c | 2 +- include/lmb.h | 2 -- lib/lmb.c | 8

  1   2   3   4   5   6   7   8   9   10   >