On 04/03/2025 10:47 pm, Stefano Stabellini wrote:
> On Mon, 3 Mar 2025, Andrew Cooper wrote:
>> When a watchdog fires, the domain is crashed and can't dump any state.
>>
>> Xen allows a domain to have two separate watchdogs.  Therefore, for a
>> domain running multiple watchdogs (e.g. one based around network, one
>> for disk), it is important for diagnostics to know which watchdog
>> fired.
>>
>> As the printk() is in a timer callback, this is a bit awkward to
>> arrange, but there are 12 spare bits in the bottom of the domain
>> pointer owing to its alignment.
>>
>> Reuse these bits to encode the watchdog id too, so the one which fired
>> is identified when the domain is crashed.
>>
>> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
> The code looks like it would work as intended.

It's already deployed into production[1].  (Guess /why/ we need to
distinguish the two watchdogs.)

> I checked with the MISRA rules and it looks like it would fall under the
> allowed exception. Please have a run through ECLAIR to make sure it
> doesn't cause regressions (especially R11.2).

Eclair is happy:

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1700050949

~Andrew

[1] Actually, the version that took me 2 minute to write one evening
over beer after work when the initial request for help came in. 
Followed shortly by an explanation of how alignment works.

Reply via email to