Re: [patch 0/6] Cure kexec() vs. mwait_play_dead() troubles

From: Ashok Raj
Date: Fri Jun 16 2023 - 11:09:16 EST


On Wed, Jun 07, 2023 at 08:46:22PM -0700, Sean Christopherson wrote:
>
> https://lore.kernel.org/all/BYAPR12MB301441A16CE6CFFE17147888A0A09@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> > If there is a specific test you want done, let me know.
>
> Smoke testing is all I was thinking. I wouldn't put too much effort into trying
> to make sure this all works. Like I said earlier, nice to have, but certainly not
> necessary.

+ Vijay who was helping with testing this inside the VM.
+ Paolo, Laszlo

I haven't found the exact method to test with secure boot/trusted boot yet.
But here is what we were able to test thus far.

Vijay was able to get OVMF recompiled with SMM included.

Thanks to Laszlo for pointing me in the right direction. And Paolo for
helping with some basic questions.

https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt

Surprisingly SMM emulation is sadly damn good :-)

Recipe is to generate SMI by writing to port 0xb2.

- On native, this does generate a broadcast SMI, the SMI_COUNT MSR 0x34
goes up by 1 on all logical CPUs.
- Turn off SMT by #echo off > /sys/devices/system/cpu/smt/control
- Do another port 0xb2, we don't see any hangs
- Bring up SMT by echo on > control, and we can see even the offline CPUs
got the SMI as indicated by MSR 0x34. (Which is as expected)

On guest, the only difference was when we turn on HT again, waking the CPUs
from INIT, SMI_COUNT has zeroed as opposed to the native. (Which is
perfectly fine) All I was looking for was "no hang". And a normal kexec
with newly updated code works well inside a guest.

Would this qualify for the smoke test pass? I'll continue to look for a
secure boot install if this doesn't close it, just haven't landed at the
right spot yet.

--
Cheers,
Ashok