[Skiboot] [PATCH 1/4] ipmi: Fix potential infinite loop in sync_msg polling

Stewart Smith stewart at flamingspork.com
Mon May 15 06:29:00 AEST 2023


> On May 13, 2023, at 05:12, Nicholas Piggin <npiggin at gmail.com> wrote:
> 
> Current gcc with -Os happens to generate code that re-loads the variable
> in the loop, but that could change without notice, and with -O2 it does
> infinite loop if sync_msg is !NULL, because it is not declared volatile
> and there is no compiler barrier in the loop.

I guess it’s a good thing we only ever had size constraints rather than performance ones :)

> Add the usual cpu_relax() there to provide the compiler barrier.

I’m trying to remember if we needed a call to go do background work if only one CPU thread but it turns out my memory is getting hazy on the details, and I 100% need more coffee right now.

> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>

Feel free to have my first skiboot reviewed by in a while though :)

Reviewed-by: Stewart Smith <stewart at flamingspork.com <mailto:stewart at flamingspork.com>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20230514/7e49bd8b/attachment.htm>


More information about the Skiboot mailing list