lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Dec 2022 19:52:41 -0600
From:   Samuel Holland <samuel@...lland.org>
To:     Andre Przywara <andre.przywara@....com>
Cc:     Chen-Yu Tsai <wens@...e.org>,
        Jernej Skrabec <jernej.skrabec@...il.com>,
        Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-sunxi@...ts.linux.dev
Subject: Re: [PATCH 1/5] clk: sunxi-ng: Remove duplicate ARCH_SUNXI
 dependencies

On 12/2/22 18:14, Andre Przywara wrote:
> On Sat, 26 Nov 2022 13:13:15 -0600
> Samuel Holland <samuel@...lland.org> wrote:
> 
> Hi,
> 
> thanks for addressing this!
> 
>> SUNXI_CCU already depends on ARCH_SUNXI, so adding the dependency to
>> individual SoC drivers is redundant.
>>
>> Signed-off-by: Samuel Holland <samuel@...lland.org>
>> ---
>>
>>  drivers/clk/sunxi-ng/Kconfig | 43 ++++++++++++++++++------------------
>>  1 file changed, 21 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig
>> index 461537679c04..64cfa022e320 100644
>> --- a/drivers/clk/sunxi-ng/Kconfig
>> +++ b/drivers/clk/sunxi-ng/Kconfig
>> @@ -14,43 +14,43 @@ config SUNIV_F1C100S_CCU
>>  
>>  config SUN20I_D1_CCU
>>  	tristate "Support for the Allwinner D1 CCU"
>> -	default RISCV && ARCH_SUNXI
>> -	depends on (RISCV && ARCH_SUNXI) || COMPILE_TEST
>> +	default RISCV
>> +	depends on RISCV || COMPILE_TEST
> 
> I agree on the "depends" part: Indeed the guard symbol already covers
> that, so it's redundant.
> However I am not so sure about the "default" part: When ARCH_SUNXI is
> deselected, but COMPILE_TEST in enabled, we default to every CCU driver
> being built-in. I am not sure this is the intention, or at least
> expected when doing compile testing?

SUNXI_CCU, which these depend on, is still "default ARCH_SUNXI", so if
you have ARCH_SUNXI disabled, you only get any drivers if you manually
enable SUNXI_CCU. I mentioned this in the patch 2 description, but maybe
I should move that comment here.

>>  
>>  config SUN20I_D1_R_CCU
>>  	tristate "Support for the Allwinner D1 PRCM CCU"
>> -	default RISCV && ARCH_SUNXI
>> -	depends on (RISCV && ARCH_SUNXI) || COMPILE_TEST
>> +	default RISCV
>> +	depends on RISCV || COMPILE_TEST
>>  
>>  config SUN50I_A64_CCU
>>  	tristate "Support for the Allwinner A64 CCU"
>> -	default ARM64 && ARCH_SUNXI
>> -	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
>> +	default ARM64
>> +	depends on ARM64 || COMPILE_TEST
> 
> I wonder if this "depends" line was always wrong and should be fixed:
> We can compile a 32-bit ARM kernel and run it on an A64. Granted this
> requires a special bootloader or a hacked U-Boot (tried that), and
> reveals some other issues with the decompressor, but technically there
> is no 64-bit dependency in here.
> The same goes for all the other ARM64 CCUs: Cortex-A53s can run AArch32
> in all exception levels.

I was trying to simplify things by hiding irrelevant options, and you
bring up an edge case of an edge case. :) I am okay with relaxing the
dependency, though I would want to leave them disabled by default for
32-bit kernels (excluding them from the change in patch 2).

> So shall we just completely remove the "depends" line for those, and
> let SUNXI_CCU do that job? Or use use !RISCV || COMPILE_TEST?

That, or we could add MACH_SUN8I to the condition. I don't have a strong
opinion.

Regards,
Samuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ