[PATCH 2/9] kernel: change CONFIG_HW_RANDOM default to y

Philip Prindeville philipp_subx at redfish-solutions.com
Sun Apr 30 21:44:11 PDT 2023



> On Apr 29, 2023, at 12:08 AM, Elliott Mitchell <ehem+openwrt at m5p.com> wrote:
> 
> On Fri, Apr 28, 2023 at 10:29:29AM -0600, Philip Prindeville wrote:
>> Why isn't this migrating upwards into target/linux/generic/config-5.15 and target/linux/generic/config-5.10 in that case?
>> 
>> And for the platforms where it was turned off, like target/linux/armvirt/32/config-5.15, why isn't that staying unchanged?
> 
> I'm guessing you're unaware of a subtlety of how the .config system
> actually works.  Take a second look, some handy examples:
> 
>>> On Apr 22, 2023, at 11:46 AM, Elliott Mitchell <ehem+openwrt at m5p.com> wrote:
> 
>>> diff --git a/target/linux/armvirt/32/config-5.10 b/target/linux/armvirt/32/config-5.10
>>> index 3c6443bcbf..2f7cd03b5f 100644
>>> --- a/target/linux/armvirt/32/config-5.10
>>> +++ b/target/linux/armvirt/32/config-5.10
>>> @@ -47,6 +47,7 @@ CONFIG_EDAC_ATOMIC_SCRUB=y
>>> CONFIG_GENERIC_VDSO_32=y
>>> CONFIG_HARDEN_BRANCH_PREDICTOR=y
>>> CONFIG_HAVE_SMP=y
>>> +CONFIG_HW_RANDOM=n
>>> CONFIG_HZ_FIXED=0
>>> CONFIG_HZ_PERIODIC=y
>>> CONFIG_MIGHT_HAVE_CACHE_L2X0=y
>>> diff --git a/target/linux/armvirt/32/config-5.15 b/target/linux/armvirt/32/config-5.15
>>> index bf6e2a5cde..bb2a7a320f 100644
>>> --- a/target/linux/armvirt/32/config-5.15
>>> +++ b/target/linux/armvirt/32/config-5.15
>>> @@ -49,6 +49,7 @@ CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
>>> CONFIG_GENERIC_VDSO_32=y
>>> CONFIG_HARDEN_BRANCH_PREDICTOR=y
>>> CONFIG_HAVE_SMP=y
>>> +CONFIG_HW_RANDOM=n
>>> CONFIG_HZ_FIXED=0
>>> CONFIG_HZ_PERIODIC=y
>>> CONFIG_MIGHT_HAVE_CACHE_L2X0=y
> 
> 
>>> diff --git a/target/linux/armvirt/64/config-5.10 b/target/linux/armvirt/64/config-5.10
>>> index 275fe4571d..af46939ad2 100644
>>> --- a/target/linux/armvirt/64/config-5.10
>>> +++ b/target/linux/armvirt/64/config-5.10
>>> @@ -102,7 +102,6 @@ CONFIG_GPIO_GENERIC=y
>>> CONFIG_GPIO_GENERIC_PLATFORM=y
>>> CONFIG_HDMI=y
>>> CONFIG_HOLES_IN_ZONE=y
>>> -CONFIG_HW_RANDOM=y
>>> CONFIG_HW_RANDOM_VIRTIO=y
>>> CONFIG_I2C=y
>>> CONFIG_I2C_ALGOBIT=y
>>> diff --git a/target/linux/armvirt/64/config-5.15 b/target/linux/armvirt/64/config-5.15
>>> index 19ae3dc0cf..88f2f64cde 100644
>>> --- a/target/linux/armvirt/64/config-5.15
>>> +++ b/target/linux/armvirt/64/config-5.15
>>> @@ -103,7 +103,6 @@ CONFIG_GENERIC_FIND_FIRST_BIT=y
>>> CONFIG_GPIO_GENERIC=y
>>> CONFIG_GPIO_GENERIC_PLATFORM=y
>>> CONFIG_HDMI=y
>>> -CONFIG_HW_RANDOM=y
>>> CONFIG_HW_RANDOM_ARM_SMCCC_TRNG=y
>>> CONFIG_HW_RANDOM_VIRTIO=y
>>> CONFIG_I2C=y
>>> diff --git a/target/linux/ath25/config-5.10 b/target/linux/ath25/config-5.10
>>> index ef764820e4..41e65c72ad 100644
> 
> 
>>> diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
>>> index f6f1fb0278..853c13852d 100644
>>> --- a/target/linux/generic/config-5.10
>>> +++ b/target/linux/generic/config-5.10
>>> @@ -2343,7 +2343,7 @@ CONFIG_HPET_MMAP_DEFAULT=y
>>> # CONFIG_HWSPINLOCK is not set
>>> # CONFIG_HWSPINLOCK_OMAP is not set
>>> CONFIG_HW_PERF_EVENTS=y
>>> -# CONFIG_HW_RANDOM is not set
>>> +CONFIG_HW_RANDOM=y
>>> # CONFIG_HW_RANDOM_AMD is not set
>>> # CONFIG_HW_RANDOM_ATMEL is not set
>>> # CONFIG_HW_RANDOM_BA431 is not set
>>> diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15
>>> index ac75a480a1..bf38732b31 100644
>>> --- a/target/linux/generic/config-5.15
>>> +++ b/target/linux/generic/config-5.15
>>> @@ -2444,7 +2444,7 @@ CONFIG_HPET_MMAP_DEFAULT=y
>>> # CONFIG_HWSPINLOCK is not set
>>> # CONFIG_HWSPINLOCK_OMAP is not set
>>> CONFIG_HW_PERF_EVENTS=y
>>> -# CONFIG_HW_RANDOM is not set
>>> +CONFIG_HW_RANDOM=y
>>> # CONFIG_HW_RANDOM_AMD is not set
>>> # CONFIG_HW_RANDOM_ARM_SMCCC_TRNG is not set
>>> # CONFIG_HW_RANDOM_ATMEL is not set
> 
> armvirt/32 previously had it off and it is still off.  armvirt/64
> previously had it on and it is still on.
> 
> Most similar systems would treat "# <option> is not set" as undefined or
> no preference (use the default value).  The Linux kernel system treats
> this as "no" due to the history of the system.  Yet it also honors "n"
> as "no".
> 
> I tend to prefer "n" as it hints at a value being deliberately chosen,
> instead of being left unset/undefined.



Enumerating it explicitly saves me having to get into the kernel sources and grep Config files for a default.




More information about the openwrt-devel mailing list