On 4/30/2026 8:53 PM, Peter Maydell wrote:
> On Wed, 22 Apr 2026 at 04:08, Jinjie Ruan <[email protected]> wrote:
>>
>>
>>
>> On 3/18/2026 3:03 PM, Jinjie Ruan wrote:
>>> Gentle ping.
>>>
>>> On 2026/1/14 9:32, Jinjie Ruan wrote:
>>>> In get_guest_rtc_ns(), "s->base_rtc" is uint64_t, which multiplied by
>>>> "NANOSECONDS_PER_SECOND" may overflow the uint64_t type, which will
>>>> cause the QEMU Linux Virtual Machine's RTC time to jump and in turn
>>>> triggers a kernel Soft Lockup and ultimately leads to a crash.
>>>>
>>>> Fix it by avoiding adding s->base_rtc in get_guest_rtc_ns_offset(),
>>>> because get_guest_rtc_ns() is used either take the remainder of
>>>> NANOSECONDS_PER_SECOND or take the quotient of NANOSECONDS_PER_SECOND.
>>>>
>>>> Fixes: 56038ef6234e ("RTC: Update the RTC clock only when reading it")
>>>> Signed-off-by: Jinjie Ruan <[email protected]>
>>>> ---
>>>> v2:
>>>> - Add comment for get_guest_rtc_ns().
>>>> - Update the commit message.
>>
>> Hi, peter, do you have any further suggestions for this version, or is
>> it ready to be merged? Thanks!
>
> As the mc146818's main user is the x86 PC models, this ought
> to be reviewed by one of their maintainers. Paolo ?
That makes sense, as this change primarily impacts x86 platforms. I'll
wait for Paolo's feedback. @Paolo, please let me know if you have any
concerns.
>
> thanks
> -- PMM
>