All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] lib: reduce SPL size
@ 2020-04-15 16:46 Heinrich Schuchardt
  2020-04-15 16:46 ` [PATCH 1/5] lib: do not build OID registry in SPL Heinrich Schuchardt
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-15 16:46 UTC (permalink / raw)
  To: u-boot

Several configuration options inject code into SPL even if it is not
needed.

Heinrich Schuchardt (5):
  lib: do not build OID registry in SPL
  lib: date functions in SPL
  common: image_sign_info helper functions in SPL
  lib: do not provide hexdump in SPL
  dlmalloc: remove unit test support in SPL

 Kconfig           |  2 +-
 common/Kconfig    | 11 +++++++++++
 common/Makefile   |  2 +-
 common/dlmalloc.c |  2 +-
 lib/Makefile      |  6 +++---
 lib/hexdump.c     |  2 +-
 6 files changed, 18 insertions(+), 7 deletions(-)

--
2.25.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/5] lib: do not build OID registry in SPL
  2020-04-15 16:46 [PATCH 0/5] lib: reduce SPL size Heinrich Schuchardt
@ 2020-04-15 16:46 ` Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
  2020-04-24 17:11   ` Tom Rini
  2020-04-15 16:46 ` [PATCH 2/5] lib: date functions " Heinrich Schuchardt
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-15 16:46 UTC (permalink / raw)
  To: u-boot

The OID registry is only used by crypto functions that are not built in
SPL. So we should not build it in SPL.

Fixes: a9b45e6e8382 ("lib: add oid registry utility")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index 32bf3f3693..5d4bb3232c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -119,6 +119,7 @@ obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o
 else
 # Main U-Boot always uses the full printf support
 obj-y += vsprintf.o strto.o
+obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
 endif

 obj-y += date.o
@@ -127,8 +128,6 @@ obj-$(CONFIG_LIB_ELF) += elf.o
 #
 # Build a fast OID lookup registry from include/linux/oid_registry.h
 #
-obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
-
 $(obj)/oid_registry.o: $(obj)/oid_registry_data.c

 $(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
--
2.25.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/5] lib: date functions in SPL
  2020-04-15 16:46 [PATCH 0/5] lib: reduce SPL size Heinrich Schuchardt
  2020-04-15 16:46 ` [PATCH 1/5] lib: do not build OID registry in SPL Heinrich Schuchardt
@ 2020-04-15 16:46 ` Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
  2020-04-15 16:46 ` [PATCH 3/5] common: image_sign_info helper " Heinrich Schuchardt
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-15 16:46 UTC (permalink / raw)
  To: u-boot

Date functions are only needed in SPL if SPL contains RTC drivers.

Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/Makefile b/lib/Makefile
index 5d4bb3232c..dbea69f52c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -116,13 +116,14 @@ else
 obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o
 endif
 obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o
+obj-$(CONFIG_$(SPL_TPL_)RTC_SUPPORT) += date.o
 else
 # Main U-Boot always uses the full printf support
 obj-y += vsprintf.o strto.o
 obj-$(CONFIG_OID_REGISTRY) += oid_registry.o
+obj-y += date.o
 endif

-obj-y += date.o
 obj-$(CONFIG_LIB_ELF) += elf.o

 #
--
2.25.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/5] common: image_sign_info helper functions in SPL
  2020-04-15 16:46 [PATCH 0/5] lib: reduce SPL size Heinrich Schuchardt
  2020-04-15 16:46 ` [PATCH 1/5] lib: do not build OID registry in SPL Heinrich Schuchardt
  2020-04-15 16:46 ` [PATCH 2/5] lib: date functions " Heinrich Schuchardt
@ 2020-04-15 16:46 ` Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
  2020-04-24 17:11   ` Tom Rini
  2020-04-15 16:46 ` [PATCH 4/5] lib: do not provide hexdump " Heinrich Schuchardt
  2020-04-15 16:46 ` [PATCH 5/5] dlmalloc: remove unit test support " Heinrich Schuchardt
  4 siblings, 2 replies; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-15 16:46 UTC (permalink / raw)
  To: u-boot

Do not build image_sign_info helper functions in SPL if not needed.

Fixes: b983cc2da0ba ("lib: rsa: decouple rsa from FIT image verification")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 Kconfig         |  2 +-
 common/Kconfig  | 11 +++++++++++
 common/Makefile |  2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Kconfig b/Kconfig
index 1b0b6999d8..6038e93afb 100644
--- a/Kconfig
+++ b/Kconfig
@@ -447,7 +447,7 @@ config SPL_FIT_SIGNATURE
 	select SPL_FIT
 	select SPL_RSA
 	select SPL_RSA_VERIFY
-	select IMAGE_SIGN_INFO
+	select SPL_IMAGE_SIGN_INFO

 config SPL_LOAD_FIT
 	bool "Enable SPL loading U-Boot as a FIT (basic fitImage features)"
diff --git a/common/Kconfig b/common/Kconfig
index 3072651082..75d9dfdc33 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1053,3 +1053,14 @@ config IMAGE_SIGN_INFO
 	select SHA256
 	help
 	  Enable image_sign_info helper functions.
+
+if IMAGE_SIGN_INFO
+
+config SPL_IMAGE_SIGN_INFO
+	bool
+	select SHA1
+	select SHA256
+	help
+	  Enable image_sign_info helper functions in SPL.
+
+endif
diff --git a/common/Makefile b/common/Makefile
index 702f2396cf..ad030e05eb 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -112,7 +112,7 @@ obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
 obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o
 obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o
-obj-$(CONFIG_IMAGE_SIGN_INFO) += image-sig.o
+obj-$(CONFIG_$(SPL_TPL_)IMAGE_SIGN_INFO) += image-sig.o
 obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-fit-sig.o
 obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o
 obj-$(CONFIG_IO_TRACE) += iotrace.o
--
2.25.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/5] lib: do not provide hexdump in SPL
  2020-04-15 16:46 [PATCH 0/5] lib: reduce SPL size Heinrich Schuchardt
                   ` (2 preceding siblings ...)
  2020-04-15 16:46 ` [PATCH 3/5] common: image_sign_info helper " Heinrich Schuchardt
@ 2020-04-15 16:46 ` Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
  2020-04-24 17:11   ` Tom Rini
  2020-04-15 16:46 ` [PATCH 5/5] dlmalloc: remove unit test support " Heinrich Schuchardt
  4 siblings, 2 replies; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-15 16:46 UTC (permalink / raw)
  To: u-boot

SPL should not be enlarged by building with CONFIG_HEXDUMP=y.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/hexdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/hexdump.c b/lib/hexdump.c
index bf14b5bdbd..a3f219a874 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -18,7 +18,7 @@
 const char hex_asc[] = "0123456789abcdef";
 const char hex_asc_upper[] = "0123456789ABCDEF";

-#ifdef CONFIG_HEXDUMP
+#if CONFIG_IS_ENABLED(HEXDUMP)
 /**
  * hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory
  * @buf: data blob to dump
--
2.25.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 5/5] dlmalloc: remove unit test support in SPL
  2020-04-15 16:46 [PATCH 0/5] lib: reduce SPL size Heinrich Schuchardt
                   ` (3 preceding siblings ...)
  2020-04-15 16:46 ` [PATCH 4/5] lib: do not provide hexdump " Heinrich Schuchardt
@ 2020-04-15 16:46 ` Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
  2020-04-24 17:11   ` Tom Rini
  4 siblings, 2 replies; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-15 16:46 UTC (permalink / raw)
  To: u-boot

We cannot run unit tests in SPL. So remove the unit test support.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 common/dlmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index dade68faf7..db5ab55ed3 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1,6 +1,6 @@
 #include <common.h>

-#if defined(CONFIG_UNIT_TEST)
+#if CONFIG_IS_ENABLED(UNIT_TEST)
 #define DEBUG
 #endif

--
2.25.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/5] lib: do not build OID registry in SPL
  2020-04-15 16:46 ` [PATCH 1/5] lib: do not build OID registry in SPL Heinrich Schuchardt
@ 2020-04-16  2:32   ` Tom Rini
  2020-04-16 15:49     ` Heinrich Schuchardt
  2020-04-24 17:11   ` Tom Rini
  1 sibling, 1 reply; 24+ messages in thread
From: Tom Rini @ 2020-04-16  2:32 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:19PM +0200, Heinrich Schuchardt wrote:

> The OID registry is only used by crypto functions that are not built in
> SPL. So we should not build it in SPL.
> 
> Fixes: a9b45e6e8382 ("lib: add oid registry utility")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  lib/Makefile | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

This problem shows up with the full secure boot patch series, yes?
Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200415/cfa8e174/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 2/5] lib: date functions in SPL
  2020-04-15 16:46 ` [PATCH 2/5] lib: date functions " Heinrich Schuchardt
@ 2020-04-16  2:32   ` Tom Rini
  2020-04-16 16:30     ` Heinrich Schuchardt
  0 siblings, 1 reply; 24+ messages in thread
From: Tom Rini @ 2020-04-16  2:32 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:20PM +0200, Heinrich Schuchardt wrote:

> Date functions are only needed in SPL if SPL contains RTC drivers.
> 
> Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Does this show up as a problem somewhere?  I don't see this resulting in
size savings anywhere, thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200415/d910b6e4/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 3/5] common: image_sign_info helper functions in SPL
  2020-04-15 16:46 ` [PATCH 3/5] common: image_sign_info helper " Heinrich Schuchardt
@ 2020-04-16  2:32   ` Tom Rini
  2020-04-24 17:11   ` Tom Rini
  1 sibling, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-16  2:32 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:21PM +0200, Heinrich Schuchardt wrote:

> Do not build image_sign_info helper functions in SPL if not needed.
> 
> Fixes: b983cc2da0ba ("lib: rsa: decouple rsa from FIT image verification")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200415/99f9e104/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 4/5] lib: do not provide hexdump in SPL
  2020-04-15 16:46 ` [PATCH 4/5] lib: do not provide hexdump " Heinrich Schuchardt
@ 2020-04-16  2:32   ` Tom Rini
  2020-04-16 16:27     ` Heinrich Schuchardt
  2020-04-24 17:11   ` Tom Rini
  1 sibling, 1 reply; 24+ messages in thread
From: Tom Rini @ 2020-04-16  2:32 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:22PM +0200, Heinrich Schuchardt wrote:

> SPL should not be enlarged by building with CONFIG_HEXDUMP=y.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  lib/hexdump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Does this show up as a problem somewhere?  I don't see this resulting in
size savings anywhere, thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200415/d4e59364/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 5/5] dlmalloc: remove unit test support in SPL
  2020-04-15 16:46 ` [PATCH 5/5] dlmalloc: remove unit test support " Heinrich Schuchardt
@ 2020-04-16  2:32   ` Tom Rini
  2020-04-16 15:37     ` Heinrich Schuchardt
  2020-04-24 17:11   ` Tom Rini
  1 sibling, 1 reply; 24+ messages in thread
From: Tom Rini @ 2020-04-16  2:32 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:23PM +0200, Heinrich Schuchardt wrote:

> We cannot run unit tests in SPL. So remove the unit test support.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  common/dlmalloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Does this show up as a problem somewhere?  I don't see this resulting in
size savings anywhere, thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200415/dd165c8e/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 5/5] dlmalloc: remove unit test support in SPL
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-16 15:37     ` Heinrich Schuchardt
  2020-04-16 17:00       ` Tom Rini
  0 siblings, 1 reply; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-16 15:37 UTC (permalink / raw)
  To: u-boot

On 4/16/20 4:32 AM, Tom Rini wrote:
> On Wed, Apr 15, 2020 at 06:46:23PM +0200, Heinrich Schuchardt wrote:
>
>> We cannot run unit tests in SPL. So remove the unit test support.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  common/dlmalloc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Does this show up as a problem somewhere?  I don't see this resulting in
> size savings anywhere, thanks.
>

pine64-lts_defconfig + CONFIG_UNIT_TEST=y:

without patch:
1487904 spl/u-boot-spl

with patch:
1485712 spl/u-boot-spl

The difference seems to be in the size of debug sections.

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/5] lib: do not build OID registry in SPL
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-16 15:49     ` Heinrich Schuchardt
  2020-04-16 17:00       ` Tom Rini
  0 siblings, 1 reply; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-16 15:49 UTC (permalink / raw)
  To: u-boot

On 4/16/20 4:32 AM, Tom Rini wrote:
> On Wed, Apr 15, 2020 at 06:46:19PM +0200, Heinrich Schuchardt wrote:
>
>> The OID registry is only used by crypto functions that are not built in
>> SPL. So we should not build it in SPL.
>>
>> Fixes: a9b45e6e8382 ("lib: add oid registry utility")
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  lib/Makefile | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> This problem shows up with the full secure boot patch series, yes?
> Thanks.
>

Take origin/master:

pine64-lts_defconfig
+ CONFIG_RSA=y
+ CONFIG_ASYMMETRIC_KEY_TYPE=y
+ CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
+ CONFIG_RSA_PUBLIC_KEY_PARSER=y

and you will see spl/lib/oid_registry.o being built.

These settings will in future be needed for UEFI secure boot.

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 4/5] lib: do not provide hexdump in SPL
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-16 16:27     ` Heinrich Schuchardt
  2020-04-16 17:02       ` Tom Rini
  0 siblings, 1 reply; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-16 16:27 UTC (permalink / raw)
  To: u-boot

On 4/16/20 4:32 AM, Tom Rini wrote:
> On Wed, Apr 15, 2020 at 06:46:22PM +0200, Heinrich Schuchardt wrote:
>
>> SPL should not be enlarged by building with CONFIG_HEXDUMP=y.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>  lib/hexdump.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Does this show up as a problem somewhere?  I don't see this resulting in
> size savings anywhere, thanks.
>

I checked for origin/master pine64_defconfig

with HEXDUMP
1493728 spl/u-boot-spl

without HEXDUMP
1485712 spl/u-boot-spl

Currently no driver is actually calling the hexdump function is SPL. So
the code seems to be removed in the final binary.

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 2/5] lib: date functions in SPL
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-16 16:30     ` Heinrich Schuchardt
  2020-04-16 17:04       ` Tom Rini
  0 siblings, 1 reply; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-16 16:30 UTC (permalink / raw)
  To: u-boot

On 4/16/20 4:32 AM, Tom Rini wrote:
> On Wed, Apr 15, 2020 at 06:46:20PM +0200, Heinrich Schuchardt wrote:
>
>> Date functions are only needed in SPL if SPL contains RTC drivers.
>>
>> Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> Does this show up as a problem somewhere?  I don't see this resulting in
> size savings anywhere, thanks.
>

We are compiling ./spl/lib/date.o for no good reason since said patch.
It may be that the when creating u-boot-spl.bin from u-boot-spl this
gets deleted again due to linker optimization.

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 5/5] dlmalloc: remove unit test support in SPL
  2020-04-16 15:37     ` Heinrich Schuchardt
@ 2020-04-16 17:00       ` Tom Rini
  2020-04-16 17:19         ` Heinrich Schuchardt
  0 siblings, 1 reply; 24+ messages in thread
From: Tom Rini @ 2020-04-16 17:00 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 16, 2020 at 05:37:56PM +0200, Heinrich Schuchardt wrote:
> On 4/16/20 4:32 AM, Tom Rini wrote:
> > On Wed, Apr 15, 2020 at 06:46:23PM +0200, Heinrich Schuchardt wrote:
> >
> >> We cannot run unit tests in SPL. So remove the unit test support.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>  common/dlmalloc.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Does this show up as a problem somewhere?  I don't see this resulting in
> > size savings anywhere, thanks.
> >
> 
> pine64-lts_defconfig + CONFIG_UNIT_TEST=y:
> 
> without patch:
> 1487904 spl/u-boot-spl
> 
> with patch:
> 1485712 spl/u-boot-spl
> 
> The difference seems to be in the size of debug sections.

Interesting, what toolchain are you using?  That doesn't show up here.
Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200416/77e46cd4/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/5] lib: do not build OID registry in SPL
  2020-04-16 15:49     ` Heinrich Schuchardt
@ 2020-04-16 17:00       ` Tom Rini
  0 siblings, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-16 17:00 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 16, 2020 at 05:49:13PM +0200, Heinrich Schuchardt wrote:
> On 4/16/20 4:32 AM, Tom Rini wrote:
> > On Wed, Apr 15, 2020 at 06:46:19PM +0200, Heinrich Schuchardt wrote:
> >
> >> The OID registry is only used by crypto functions that are not built in
> >> SPL. So we should not build it in SPL.
> >>
> >> Fixes: a9b45e6e8382 ("lib: add oid registry utility")
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>  lib/Makefile | 3 +--
> >>  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > This problem shows up with the full secure boot patch series, yes?
> > Thanks.
> >
> 
> Take origin/master:
> 
> pine64-lts_defconfig
> + CONFIG_RSA=y
> + CONFIG_ASYMMETRIC_KEY_TYPE=y
> + CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
> + CONFIG_RSA_PUBLIC_KEY_PARSER=y
> 
> and you will see spl/lib/oid_registry.o being built.
> 
> These settings will in future be needed for UEFI secure boot.

Thanks.

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200416/2ad8bdcc/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 4/5] lib: do not provide hexdump in SPL
  2020-04-16 16:27     ` Heinrich Schuchardt
@ 2020-04-16 17:02       ` Tom Rini
  0 siblings, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-16 17:02 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 16, 2020 at 06:27:00PM +0200, Heinrich Schuchardt wrote:
> On 4/16/20 4:32 AM, Tom Rini wrote:
> > On Wed, Apr 15, 2020 at 06:46:22PM +0200, Heinrich Schuchardt wrote:
> >
> >> SPL should not be enlarged by building with CONFIG_HEXDUMP=y.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>  lib/hexdump.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Does this show up as a problem somewhere?  I don't see this resulting in
> > size savings anywhere, thanks.
> >
> 
> I checked for origin/master pine64_defconfig
> 
> with HEXDUMP
> 1493728 spl/u-boot-spl
> 
> without HEXDUMP
> 1485712 spl/u-boot-spl
> 
> Currently no driver is actually calling the hexdump function is SPL. So
> the code seems to be removed in the final binary.

OK, thanks.

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200416/5e07babe/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 2/5] lib: date functions in SPL
  2020-04-16 16:30     ` Heinrich Schuchardt
@ 2020-04-16 17:04       ` Tom Rini
  0 siblings, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-16 17:04 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 16, 2020 at 06:30:48PM +0200, Heinrich Schuchardt wrote:
> On 4/16/20 4:32 AM, Tom Rini wrote:
> > On Wed, Apr 15, 2020 at 06:46:20PM +0200, Heinrich Schuchardt wrote:
> >
> >> Date functions are only needed in SPL if SPL contains RTC drivers.
> >>
> >> Fixes: 05429b6cf5b3 ("rtc: move date.c from drivers/rtc/ to lib/")
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >
> > Does this show up as a problem somewhere?  I don't see this resulting in
> > size savings anywhere, thanks.
> >
> 
> We are compiling ./spl/lib/date.o for no good reason since said patch.
> It may be that the when creating u-boot-spl.bin from u-boot-spl this
> gets deleted again due to linker optimization.

It is discarded at link time, yes.  I'm generally dis-inclined to grab
patches like this when it adds more to the Makefile without a size
savings.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200416/952b4f4c/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 5/5] dlmalloc: remove unit test support in SPL
  2020-04-16 17:00       ` Tom Rini
@ 2020-04-16 17:19         ` Heinrich Schuchardt
  0 siblings, 0 replies; 24+ messages in thread
From: Heinrich Schuchardt @ 2020-04-16 17:19 UTC (permalink / raw)
  To: u-boot

On 16.04.20 19:00, Tom Rini wrote:
> On Thu, Apr 16, 2020 at 05:37:56PM +0200, Heinrich Schuchardt
> wrote:
>> On 4/16/20 4:32 AM, Tom Rini wrote:
>>> On Wed, Apr 15, 2020 at 06:46:23PM +0200, Heinrich Schuchardt
>>> wrote:
>>>
>>>> We cannot run unit tests in SPL. So remove the unit test
>>>> support.
>>>>
>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> ---
>>>> common/dlmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1
>>>> deletion(-)
>>>
>>> Does this show up as a problem somewhere?  I don't see this
>>> resulting in size savings anywhere, thanks.
>>>
>>
>> pine64-lts_defconfig + CONFIG_UNIT_TEST=y:
>>
>> without patch: 1487904 spl/u-boot-spl
>>
>> with patch: 1485712 spl/u-boot-spl
>>
>> The difference seems to be in the size of debug sections.
>
> Interesting, what toolchain are you using?  That doesn't show up
> here. Thanks!
>

I am on Debian Bullseye gcc-9.2.

As you already remarked replying to another patch the linker is
stripping the differences. My idea is that we should only compile the
necessary.

Best regards

Heinrich

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/5] lib: do not build OID registry in SPL
  2020-04-15 16:46 ` [PATCH 1/5] lib: do not build OID registry in SPL Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-24 17:11   ` Tom Rini
  1 sibling, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-24 17:11 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:19PM +0200, Heinrich Schuchardt wrote:

> The OID registry is only used by crypto functions that are not built in
> SPL. So we should not build it in SPL.
> 
> Fixes: a9b45e6e8382 ("lib: add oid registry utility")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200424/3e22d7aa/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 3/5] common: image_sign_info helper functions in SPL
  2020-04-15 16:46 ` [PATCH 3/5] common: image_sign_info helper " Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-24 17:11   ` Tom Rini
  1 sibling, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-24 17:11 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:21PM +0200, Heinrich Schuchardt wrote:

> Do not build image_sign_info helper functions in SPL if not needed.
> 
> Fixes: b983cc2da0ba ("lib: rsa: decouple rsa from FIT image verification")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200424/f1be360a/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 4/5] lib: do not provide hexdump in SPL
  2020-04-15 16:46 ` [PATCH 4/5] lib: do not provide hexdump " Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-24 17:11   ` Tom Rini
  1 sibling, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-24 17:11 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:22PM +0200, Heinrich Schuchardt wrote:

> SPL should not be enlarged by building with CONFIG_HEXDUMP=y.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200424/5a646dfb/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 5/5] dlmalloc: remove unit test support in SPL
  2020-04-15 16:46 ` [PATCH 5/5] dlmalloc: remove unit test support " Heinrich Schuchardt
  2020-04-16  2:32   ` Tom Rini
@ 2020-04-24 17:11   ` Tom Rini
  1 sibling, 0 replies; 24+ messages in thread
From: Tom Rini @ 2020-04-24 17:11 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 15, 2020 at 06:46:23PM +0200, Heinrich Schuchardt wrote:

> We cannot run unit tests in SPL. So remove the unit test support.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200424/e19571eb/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-04-24 17:11 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 16:46 [PATCH 0/5] lib: reduce SPL size Heinrich Schuchardt
2020-04-15 16:46 ` [PATCH 1/5] lib: do not build OID registry in SPL Heinrich Schuchardt
2020-04-16  2:32   ` Tom Rini
2020-04-16 15:49     ` Heinrich Schuchardt
2020-04-16 17:00       ` Tom Rini
2020-04-24 17:11   ` Tom Rini
2020-04-15 16:46 ` [PATCH 2/5] lib: date functions " Heinrich Schuchardt
2020-04-16  2:32   ` Tom Rini
2020-04-16 16:30     ` Heinrich Schuchardt
2020-04-16 17:04       ` Tom Rini
2020-04-15 16:46 ` [PATCH 3/5] common: image_sign_info helper " Heinrich Schuchardt
2020-04-16  2:32   ` Tom Rini
2020-04-24 17:11   ` Tom Rini
2020-04-15 16:46 ` [PATCH 4/5] lib: do not provide hexdump " Heinrich Schuchardt
2020-04-16  2:32   ` Tom Rini
2020-04-16 16:27     ` Heinrich Schuchardt
2020-04-16 17:02       ` Tom Rini
2020-04-24 17:11   ` Tom Rini
2020-04-15 16:46 ` [PATCH 5/5] dlmalloc: remove unit test support " Heinrich Schuchardt
2020-04-16  2:32   ` Tom Rini
2020-04-16 15:37     ` Heinrich Schuchardt
2020-04-16 17:00       ` Tom Rini
2020-04-16 17:19         ` Heinrich Schuchardt
2020-04-24 17:11   ` Tom Rini

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.