On 19.03.2025 18:29, Oleksii Kurochko wrote:
> 
> On 3/17/25 4:24 PM, Jan Beulich wrote:
>> On 11.03.2025 17:19, Oleksii Kurochko wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/riscv/time.c
>>> @@ -0,0 +1,38 @@
>>> +#include <xen/device_tree.h>
>>> +#include <xen/init.h>
>>> +#include <xen/lib.h>
>>> +#include <xen/sections.h>
>>> +
>>> +unsigned long __ro_after_init cpu_khz; /* CPU clock frequency in kHz. */
>>> +unsigned long __read_mostly boot_count;
>> Why not also __ro_after_init? And what is this variable actually needed
>> for? Common code doesn't use it, so a better name (describing what it
>> really holds) might be desirable, even if this then means not being in
>> sync with Arm code.
> 
> To calculate more accurate amount of time since boot.

Okay. But how does the name of the variable reflect that? I.e. what it
is that the count of is being stored? The only meaning I could associate
to a variable of this name is the number of boot cycles a system went
through. I.e. nothing that an OS (or hypervisor) would normally count.

Jan

> I think it can be __ro_after_init as it is going to be initialized once.
> 
>>
>> Furthermore, I can't spot a declaration of this variable. Was it meant
>> to be static?
> 
> It is going to be used for vtimer functionality and in repogram_timer()
> so it can't be static.
> 
> I will add a declaration to asm/time.h:
> ```
>    /* Counter value at boot time */
>    extern uint64_t boot_count;
> ```
> 
> Thanks.
> 
> ~ Oleksii
> 


Reply via email to