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]
Message-ID: <f57e8a74-4124-457c-b5c9-d193505ba093@inbox.ru>
Date: Mon, 7 Apr 2025 10:25:32 +0300
From: Maxim Kochetkov <fido_max@...ox.ru>
To: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
 linux-riscv@...ts.infradead.org, peterz@...radead.org, elver@...gle.com,
 namcao@...utronix.de, samuel.holland@...ive.com, daniel.lezcano@...aro.org,
 apatel@...tanamicro.com
Subject: Re: [PATCH 1/1] time/sched_clock: move sched_clock_register() out of
 .init section

07.04.2025 09:26, Thomas Gleixner wrote:
> On Fri, Apr 04 2025 at 08:05, Maxim Kochetkov wrote:
>> The sched_clock_register() is widely used by clocksource timer
>> drivers. The __init prefix forces them to be initialized using
>> macro TIMER_OF_DECLARE with __init prefixed function.
> 
> No, it does not. It requires that they are built in, not more.

Thank you for review.

Let me explain some more. I'm trying to solve similar problem, as 
described at 
https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240312192519.1602493-1-samuel.holland@sifive.com/#25759271

I have both PLIC and clocksource module configured as Y (not m) in 
Kconfig. So both of them are included in kernel Image binary. But I 
still unable to probe clocksource device because it depends of PLIC irq.
And PLIC probes much later than TIMER_OF_DECLARE part of the clocksource 
driver. I tried to convert clocksource driver to regular platform device 
and it works fine except warning:

WARNING: modpost: vmlinux: section mismatch in reference: 
dw_apb_timer_probe+0x136 (section: .text.unlikely) -> 
sched_clock_register (section: .init.text)

Dropping __init from sched_clock_register() helps to solve this issue.

Is there any real point to keep __init in sched_clock_register()? I see 
no issues to call this function at any time later after kernel boot.

Is there better way to solve this issue?

>> So lets drop __init prefix to allow platform device drivers to use
>> sched_clock_register().
> 
> s/So let's//
> 
> "So let's" means nothing.
> 
> Also this has nothing to do with platform device drivers. It's all about
> modules and nothing else.

Anyway, this patch opens opportunity to compile clocksource drivers as 
modules and probe them much later.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ