Cédric Le Goater's on March 17, 2020 3:59 am: > On 3/16/20 3:26 PM, Nicholas Piggin wrote: >> FWNMI machine check delivery misses a few things that will make it fail >> with TCG at least (which we would like to allow in future to improve >> testing). > > I don't understand which issues are addressed in the patch.
The existing code does not compute hflags, at least. There's a few possible other things, I didn't dig into qemu enough to know if they might be a problem (e.g., reservation and TLB). I figure it's better to keep these consistent. Keep in mind this is a bit academic right now, because we can't (AFAIKS) inject an MCE from TCG. It would be good to wire that up, but I didn't get to it. >> It's not nice to scatter interrupt delivery logic around the tree, so >> move it to excp_helper.c and share code where possible. > > It looks correct but this is touching the ugliest routine in the QEMU > PPC universe. I would split the patch in two to introduce the helper > powerpc_set_excp_state(). > > It does not seem to need to be an inline also. Yeah it's all pretty ugly. I didn't yet find a nice way to do split things up that did not require a lot of code churn, but that can come later. Inline was just because powerpc_excp is inline, I didn't want to change behaviour too much there (it obviously wants to do a lot of constant propagation but maybe only on the case statement). Anyway I just wanted to be minimal for now, it could be changed. Thanks, Nick