[MINI-OS PATCH 11/19] mini-os: config: add support for config items with numerical values

Juergen Gross posted 19 patches 4 months ago
There is a newer version of this series
[MINI-OS PATCH 11/19] mini-os: config: add support for config items with numerical values
Posted by Juergen Gross 4 months ago
Add support for a Mini-OS config file containing config items with
numerical values, e.g. CONFIG_FOO=7.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 Config.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Config.mk b/Config.mk
index e2afb1b4..b9675e61 100644
--- a/Config.mk
+++ b/Config.mk
@@ -178,6 +178,7 @@ endif
 # CONFIG-y contains all items defaulting to "y"
 # CONFIG-n contains all items defaulting to "n"
 # CONFIG-x contains all items being calculated if not set explicitly
+# CONFIG-val-y contains all items with numerical values, defaulting to 0
 CONFIG-y += CONFIG_START_NETWORK
 CONFIG-y += CONFIG_SPARSE_BSS
 CONFIG-y += CONFIG_BLKFRONT
@@ -219,6 +220,8 @@ CONFIG-$(lwip) += CONFIG_LWIP
 $(foreach i,$(CONFIG-y),$(eval $(i) ?= y))
 $(foreach i,$(CONFIG-n),$(eval $(i) ?= n))
 
+$(foreach i,$(CONFIG-val-y),$(eval $(i) ?= 0))
+
 CONFIG-x += CONFIG_LIBXS
 CONFIG_LIBXS ?= $(CONFIG_XENBUS)
 
@@ -226,6 +229,7 @@ CONFIG-all := $(CONFIG-y) $(CONFIG-n) $(CONFIG-x)
 
 # Export config items as compiler directives
 $(foreach i,$(CONFIG-all),$(eval DEFINES-$($(i)) += -D$(i)))
+$(foreach i,$(CONFIG-val-y),$(eval DEFINES-y += -D$(i)=$($(i))))
 
 DEFINES-y += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
 
-- 
2.43.0
Re: [MINI-OS PATCH 11/19] mini-os: config: add support for config items with numerical values
Posted by Jan Beulich 3 months, 3 weeks ago
On 02.07.2025 10:12, Juergen Gross wrote:
> Add support for a Mini-OS config file containing config items with
> numerical values, e.g. CONFIG_FOO=7.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Albeit I'm puzzled by the use in the next patch. Besides me perhaps simply
not knowing where the new CONFIG_* would actually have its value set, I
wonder why, ...

> --- a/Config.mk
> +++ b/Config.mk
> @@ -178,6 +178,7 @@ endif
>  # CONFIG-y contains all items defaulting to "y"
>  # CONFIG-n contains all items defaulting to "n"
>  # CONFIG-x contains all items being calculated if not set explicitly
> +# CONFIG-val-y contains all items with numerical values, defaulting to 0
>  CONFIG-y += CONFIG_START_NETWORK
>  CONFIG-y += CONFIG_SPARSE_BSS
>  CONFIG-y += CONFIG_BLKFRONT
> @@ -219,6 +220,8 @@ CONFIG-$(lwip) += CONFIG_LWIP
>  $(foreach i,$(CONFIG-y),$(eval $(i) ?= y))
>  $(foreach i,$(CONFIG-n),$(eval $(i) ?= n))
>  
> +$(foreach i,$(CONFIG-val-y),$(eval $(i) ?= 0))

... with this and ...

> @@ -226,6 +229,7 @@ CONFIG-all := $(CONFIG-y) $(CONFIG-n) $(CONFIG-x)
>  
>  # Export config items as compiler directives
>  $(foreach i,$(CONFIG-all),$(eval DEFINES-$($(i)) += -D$(i)))
> +$(foreach i,$(CONFIG-val-y),$(eval DEFINES-y += -D$(i)=$($(i))))

... this, kexec.h still needs to have a fallback #define there.

Jan
Re: [MINI-OS PATCH 11/19] mini-os: config: add support for config items with numerical values
Posted by Jürgen Groß 3 months, 3 weeks ago
On 11.07.25 08:24, Jan Beulich wrote:
> On 02.07.2025 10:12, Juergen Gross wrote:
>> Add support for a Mini-OS config file containing config items with
>> numerical values, e.g. CONFIG_FOO=7.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> Albeit I'm puzzled by the use in the next patch. Besides me perhaps simply
> not knowing where the new CONFIG_* would actually have its value set, I
> wonder why, ...
> 
>> --- a/Config.mk
>> +++ b/Config.mk
>> @@ -178,6 +178,7 @@ endif
>>   # CONFIG-y contains all items defaulting to "y"
>>   # CONFIG-n contains all items defaulting to "n"
>>   # CONFIG-x contains all items being calculated if not set explicitly
>> +# CONFIG-val-y contains all items with numerical values, defaulting to 0
>>   CONFIG-y += CONFIG_START_NETWORK
>>   CONFIG-y += CONFIG_SPARSE_BSS
>>   CONFIG-y += CONFIG_BLKFRONT
>> @@ -219,6 +220,8 @@ CONFIG-$(lwip) += CONFIG_LWIP
>>   $(foreach i,$(CONFIG-y),$(eval $(i) ?= y))
>>   $(foreach i,$(CONFIG-n),$(eval $(i) ?= n))
>>   
>> +$(foreach i,$(CONFIG-val-y),$(eval $(i) ?= 0))
> 
> ... with this and ...
> 
>> @@ -226,6 +229,7 @@ CONFIG-all := $(CONFIG-y) $(CONFIG-n) $(CONFIG-x)
>>   
>>   # Export config items as compiler directives
>>   $(foreach i,$(CONFIG-all),$(eval DEFINES-$($(i)) += -D$(i)))
>> +$(foreach i,$(CONFIG-val-y),$(eval DEFINES-y += -D$(i)=$($(i))))
> 
> ... this, kexec.h still needs to have a fallback #define there.

Thanks for catching.

I had an intermediate version using CONFIG_KEXEC_MODULE_PAGES outside
kexec.c, but moved the related code later.

I'll remove the fallback.


Juergen