lmb: Bump CONFIG_LMB_MAX_REGIONS
PATCH 1/1 lmb: Bump CONFIG_LMB_MAX_REGIONS
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit 06d514d77c ("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.
--- lib/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig +1 -1
@@ -1038,7 +1038,7 @@ config LMB_USE_MAX_REGIONS config LMB_MAX_REGIONS int "Number of memory and reserved regions in lmb lib" depends on LMB && LMB_USE_MAX_REGIONS - default 8 + default 16 help Define the number of supported regions, memory and reserved, in the library logical memory blocks.
Signature · 1 line
2.39.0
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.
Signature · 1 line
Tom
Francesco Dolcini
Reviewed-byHello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>
Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Thanks,
Francesco
Quoted 22 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in test/lib/lmb.c doesn't scale past 8, and I just now figured out what that should look like instead, I believe.
Signature · 1 line
Tom
Hello,
Quoted 23 lines · Tom Rini
Quoted 22 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.
Quoted 8 lines
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in
test/lib/lmb.cdoesn't scale past 8, and I just now figured out what that should look like instead, I believe.
reportedly neither fixes the problem in all cases, and raising CONFIG_LMB_RESERVED_REGIONS is required.
Looks like the mechanism to add regions above the default number does not work as intended.
The test is to boot rPi 4 from USB directly with recent firmware.
Thanks
Michal
Quoted 35 lines · Michal Suchánek
Hello,
Quoted 23 lines · Tom Rini
Quoted 22 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.Quoted 8 lines
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in
test/lib/lmb.cdoesn't scale past 8, and I just now figured out what that should look like instead, I believe.
Quoted 7 lines
reportedly neither fixes the problem in all cases, and raising
CONFIG_LMB_RESERVED_REGIONSis required.Looks like the mechanism to add regions above the default number does not work as intended.
The test is to boot rPi 4 from USB directly with recent firmware.
Well, given 0089affee275 ("configs: stm32mp15: increase the number of reserved memory region in lmb") I guess this has been run in to before, but not resolved more generically.
Signature · 1 line
Tom
Quoted 39 lines · Tom Rini
Quoted 38 lines · Michal Suchánek
Hello,
Quoted 23 lines · Tom Rini
Quoted 22 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.Quoted 8 lines
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in
test/lib/lmb.cdoesn't scale past 8, and I just now figured out what that should look like instead, I believe.reportedly neither fixes the problem in all cases, and raising
CONFIG_LMB_RESERVED_REGIONSis required.
Quoted 8 lines
Quoted 4 lines
Looks like the mechanism to add regions above the default number does not work as intended.
The test is to boot rPi 4 from USB directly with recent firmware.
Well, given
0089affee275("configs: stm32mp15: increase the number of reserved memory region in lmb") I guess this has been run in to before, but not resolved more generically.
I wonder if
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
is what will finish dealing with these issues, even the ones that had perhaps shown up before and been addressed in the commit I mentioned above?
Signature · 1 line
Tom
Hello,
Quoted 49 lines · Tom Rini
Quoted 39 lines · Tom Rini
Quoted 38 lines · Michal Suchánek
Hello,
Quoted 23 lines · Tom Rini
Quoted 22 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.Quoted 8 lines
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in
test/lib/lmb.cdoesn't scale past 8, and I just now figured out what that should look like instead, I believe.reportedly neither fixes the problem in all cases, and raising
CONFIG_LMB_RESERVED_REGIONSis required.Quoted 8 lines
Quoted 4 lines
Looks like the mechanism to add regions above the default number does not work as intended.
The test is to boot rPi 4 from USB directly with recent firmware.
Well, given
0089affee275("configs: stm32mp15: increase the number of reserved memory region in lmb") I guess this has been run in to before, but not resolved more generically.
Quoted 5 lines
I wonder if
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
is what will finish dealing with these issues, even the ones that had perhaps shown up before and been addressed in the commit I mentioned above?
Looks like this together with raising the maximum number of regions works, that is v2023.04-rc2 should be fixed.
Thanks
Michal
Hi,
Quoted 51 lines · Michal Suchánek
Hello,
Quoted 40 lines · Tom Rini
Quoted 39 lines · Tom Rini
Quoted 38 lines · Michal Suchánek
Hello,
Quoted 21 lines · Tom Rini
Quoted 20 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.Quoted 7 lines
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in
test/lib/lmb.cdoesn't scale past 8, and I just now figured out what that should look like instead, I believe.reportedly neither fixes the problem in all cases, and raising
CONFIG_LMB_RESERVED_REGIONSis required.Looks like the mechanism to add regions above the default number does not work as intended.
The test is to boot rPi 4 from USB directly with recent firmware.
Quoted 8 lines
Quoted 3 lines
Well, given
0089affee275("configs: stm32mp15: increase the number of reserved memory region in lmb") I guess this has been run in to before, but not resolved more generically.I wonder if
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
is what will finish dealing with these issues, even the ones that had perhaps shown up before and been addressed in the commit I mentioned above?
Quoted 6 lines
Looks like this together with raising the maximum number of regions works, that is v2023.04-rc2 should be fixed.
Thanks
Michal
For STM32MP15x platform with have the same issue when the number of reserved regions increased in Linux device tree.
I try to increase the region by default with CONFIG_LMB_MAX_REGIONS,
but my patch increase the used RAM size for some platform (with compilation issue).
For Tom ask me to propose a backward compatible configuration
https://lore.kernel.org/all/[email protected]/
=> CONFIG_USE_LMB_MAX_REGIONS
Moreover, if you increased CONFIG_LMB_MAX_REGIONS
the same number of region (N) is used for reserved regions (N) and for memory region (N)
=> the total size used = 2 * N * size of each memory region descriptor.
But for most of case only the number reserved regions need to be increased to parse the device tree.
With my patch the number of regions are statically managed by 2 array independently
- reserved regions = CONFIG_LMB_RESERVED_REGIONS
- memory region = CONFIG_LMB_MEMORY_REGIONS
And the total number of region (size of struct in memory) =
CONFIG_LMB_RESERVED_REGIONS + CONFIG_LMB_MEMORY_REGIONS
I think a good solution to have by default, if you want managed more reserved memory by default in U-Boot for all platform:
=> LMB_USE_MAX_REGIONS=n instead of 'y' today
=> LMB_MEMORY_REGIONS=8
=> LMB_RESERVED_REGIONS=16 or 32 instead of 8 today by default
And change the defconfig for the size constraint platforms
to use the previous behavior with LMB_USE_MAX_REGIONS=y.
NB: I define the default value with 8 to keep the previous limit and
I just increase the number of region for the STM32MP platform:
configs/stm32mp15_defconfig:170:CONFIG_LMB_RESERVED_REGIONS=16 configs/stm32mp15_trusted_defconfig:170:CONFIG_LMB_RESERVED_REGIONS=16 configs/stm32mp13_defconfig:81:CONFIG_LMB_RESERVED_REGIONS=16 configs/stm32mp15_basic_defconfig:194:CONFIG_LMB_RESERVED_REGIONS=16
I use the default value for CONFIG_LMB_MEMORY_REGIONS =8
Reference = https://lore.kernel.org/all/[email protected]/
Patrick
Quoted 129 lines · Patrick DELAUNAY
Hi,
Quoted 51 lines · Michal Suchánek
Hello,
Quoted 40 lines · Tom Rini
Quoted 39 lines · Tom Rini
Quoted 38 lines · Michal Suchánek
Hello,
Quoted 21 lines · Tom Rini
Quoted 20 lines · Francesco Dolcini
Hello,
Quoted 10 lines · Tom Rini
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Francesco Dolcini <[email protected]>Quoted 5 lines
I plan to pick up
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as the alternative fix for this issue and would suggest that any distro hitting the problem on v2023.01 apply the above instead of increasing the limit.Quoted 7 lines
Quoted 3 lines
Tom, my understanding is that you plan to merge this or an equivalent change, correct? Otherwise I would need to send some more patches to update a few board defconfig that are affected by this specific issue.
Yes, I was hoping to push the equivalent of this patch a few hours ago, along with the revert. Then I noticed the test in
test/lib/lmb.cdoesn't scale past 8, and I just now figured out what that should look like instead, I believe.reportedly neither fixes the problem in all cases, and raising
CONFIG_LMB_RESERVED_REGIONSis required.Looks like the mechanism to add regions above the default number does not work as intended.
The test is to boot rPi 4 from USB directly with recent firmware.
Quoted 8 lines
Quoted 3 lines
Well, given
0089affee275("configs: stm32mp15: increase the number of reserved memory region in lmb") I guess this has been run in to before, but not resolved more generically.I wonder if
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
is what will finish dealing with these issues, even the ones that had perhaps shown up before and been addressed in the commit I mentioned above?Quoted 6 lines
Looks like this together with raising the maximum number of regions works, that is v2023.04-rc2 should be fixed.
Thanks
Michal
For STM32MP15x platform with have the same issue when the number of reserved regions increased in Linux device tree.
I try to increase the region by default with
CONFIG_LMB_MAX_REGIONS,but my patch increase the used RAM size for some platform (with compilation issue).
For Tom ask me to propose a backward compatible configuration
https://lore.kernel.org/all/[email protected]/
=>
CONFIG_USE_LMB_MAX_REGIONSMoreover, if you increased
CONFIG_LMB_MAX_REGIONSthe same number of region (N) is used for reserved regions (N) and for memory region (N)
=> the total size used = 2 * N * size of each memory region descriptor.
But for most of case only the number reserved regions need to be increased to parse the device tree.
With my patch the number of regions are statically managed by 2 array independently
- reserved regions =
CONFIG_LMB_RESERVED_REGIONS- memory region =
CONFIG_LMB_MEMORY_REGIONSAnd the total number of region (size of struct in memory) =
CONFIG_LMB_RESERVED_REGIONS+CONFIG_LMB_MEMORY_REGIONSI think a good solution to have by default, if you want managed more reserved memory by default in U-Boot for all platform:
=> LMB_USE_MAX_REGIONS=n instead of 'y' today
=> LMB_MEMORY_REGIONS=8
=> LMB_RESERVED_REGIONS=16 or 32 instead of 8 today by default
And change the defconfig for the size constraint platforms
to use the previous behavior with LMB_USE_MAX_REGIONS=y.
NB: I define the default value with 8 to keep the previous limit and
I just increase the number of region for the STM32MP platform:
configs/stm32mp15_defconfig:170:CONFIG_LMB_RESERVED_REGIONS=16 configs/stm32mp15_trusted_defconfig:170:CONFIG_LMB_RESERVED_REGIONS=16 configs/stm32mp13_defconfig:81:CONFIG_LMB_RESERVED_REGIONS=16 configs/stm32mp15_basic_defconfig:194:CONFIG_LMB_RESERVED_REGIONS=16
Quoted 4 lines
I use the default value for
CONFIG_LMB_MEMORY_REGIONS=8Reference = https://lore.kernel.org/all/[email protected]/
Ah, OK, thanks for explaining.
Signature · 1 line
Tom
Quoted 9 lines · Michal Suchanek
It is reported that in some configurations it is not possible to boot because u-boot runs out of lmbs.
commit
06d514d77c("lmb: consider EFI memory map") increases lmb usage, hence is likely the cause of the lmb overflow.Fixes 06d514d77c ("lmb: consider EFI memory map")Signed-off-by Michal Suchanek <[email protected]>
In the interest of completeness, I was wrong in what I was thinking was the wider fix and have taken
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
as it was posted first, but added the fixes/link to that commit as well.
Signature · 1 line
Tom