On 8/25/25 13:07, Jan Beulich wrote: > On 24.08.2025 16:56, Dmytro Prokopchuk1 wrote: >> --- a/docs/misra/deviations.rst >> +++ b/docs/misra/deviations.rst >> @@ -97,6 +97,19 @@ Deviations related to MISRA C:2012 Rules: >> Xen expects developers to ensure code remains safe and reliable in >> builds, >> even when debug-only assertions like `ASSERT_UNREACHABLE() are >> removed. >> >> + * - R2.1 >> + - The 'BUG()' macro is intentionally used in the 'prepare_acpi()' >> function >> + in specific build configuration (when the config CONFIG_ACPI is not >> + defined) to trigger an error if ACPI-related features are used >> incorrectly. >> + - Tagged as `deliberate` for ECLAIR. > > With > > #define acpi_disabled true > > in xen/acpi.h I don't see why we even have that inline stub. When it's dropped > and the declaration left in place without #ifdef CONFIG_ACPI around it, the > compiler will DCE the code (much like we arrange for in many other places). No > deviation needed then. > > If such a deviation was to be added, it would need disambiguating. A function > of the given name could appear in x86 as well. That wouldn't be covered by the > Eclair config then, but it would be covered by the text here. > >> + * - R2.1 >> + - The 'BUG()' macro is intentionally used in 'gicv3_do_LPI'() and >> + 'gicv3_its_setup_collection()' functions in specific build >> configuration >> + (when the config CONFIG_HAS_ITS is not defined) to catch and prevent >> any >> + unintended execution of code that should only run when ITS is >> available. >> + - Tagged as `deliberate` for ECLAIR. > > I didn't look at this, but I would very much hope that something similar could > be done there as well. > > Jan
Thank you for review, Jan. I'll pay attention on it. Dmytro.