On 29.08.2024 14:51, Andrew Cooper wrote:
> On 29/08/2024 1:01 pm, Jan Beulich wrote:
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -66,10 +66,10 @@ struct cpu_time {
>> struct platform_timesource {
>> const char *id;
>> const char *name;
>> - u64 frequency;
>> + uint64_t frequency;
>> /* Post-init this hook may only be invoked via the read_counter()
>> wrapper! */
>> - u64 (*read_counter)(void);
>> - s64 (*init)(struct platform_timesource *);
>> + uint64_t (*read_counter)(void);
>> + int64_t (*init)(struct platform_timesource *);
>> void (*resume)(struct platform_timesource *);
>
> I'm surprised that we haven't seen MISRA complaints about this. That,
> or I've not been paying enough attention.
What Misra concerns do you see here?
>> --- a/xen/common/ubsan/ubsan.c
>> +++ b/xen/common/ubsan/ubsan.c
>> @@ -21,7 +21,6 @@ static DEFINE_PER_CPU(struct xen_ubsan[1
>> #define current this_cpu(in_ubsan)
>> #define dump_stack dump_execution_state
>> #define u64 long long unsigned int
>> -#define s64 long long int
>
> This block of defines was my magic to use ubsan.c otherwise unmodified
> from Linux.
>
> It ought to use linux-compat.h now it exists, rather than swapping away
> from {u,s}64.
Except that this doesn't work without retaining the hunk adjusting
val_to_string(). I'm actually surprised Linux gets away with that, seeing
their include/uapi/asm-generic/int-l64.h (which is the model we use,
resulting in -Wformat warnings). Thoughts?
Jan