On 12/08/2025 10:19 am, Jan Beulich wrote:
> On 08.08.2025 22:23, Andrew Cooper wrote:
>> Switch it to Xen coding style and fix MISRA violations.
> That were all ul -> UL suffix transformations, afaics?

Yes.

>
>>  Make it static as
>> there are no external caller now.
>>
>> Since commit a35816b5cae8 ("x86/traps: Introduce early_traps_init() and
>> simplify setup"), load_system_tables() is called later on the BSP, so the
>> SYS_STATE_early_boot check can be dropped from the safety BUG_ON().
>>
>> Move the BUILD_BUG_ON() into build_assertions(),
> I'm not quite convinced of this move - having the related BUILD_BUG_ON()
> and BUG_ON() next to each other would seem better to me.

I don't see a specific reason for them to be together, and the comment
explains what's going on.

With FRED, we want a related BUILD_BUG_ON(), but there's no equivalent
BUG_ON() because MSR_RSP_SL0 will #GP on being misaligned.

>> @@ -139,3 +258,16 @@ void asmlinkage ap_early_traps_init(void)
>>  {
>>      load_system_tables();
>>  }
>> +
>> +static void __init __maybe_unused build_assertions(void)
>> +{
>> +    /*
>> +     * This is best-effort (it doesn't cover some padding corner cases), but
>> +     * is preforable to hitting the check at boot time.
> Nit: "preferable"

Fixed.

~Andrew

Reply via email to