On Tue, Jul 04, 2023 at 07:34:05PM +0800, Qi Ai wrote: >Reproduce this problem need to use the cpu_pm=on in QEMU, so execute halt in vm doesn't >cause a vm exit, so mp_state will never be HLT. I am confused why mp_state is considered in this case. This is just current implementation. It is not necessary to be this way. If userspace can manipulate vmcs.ACTIVITY_STATE indirectly via mp_state, your issue will be fixed. But as Sean said, this solution will cause "cascading effect to a whole pile of things" > >And the bsp's vmcs.ACTIVITY_STATE need to reset to ACTIVITY to solve this problem. >We need a proper set of APIs as you say. In this case, do we only provide a reset ioctl, >or do we need to report vmcs.ACTIVITY_STATE to the userspace? The latter I believe. Then userspace can migrate the state. If we go with the former, the subtle bug pointed out by Sean won't be fixed: if a vCPU is live migrated, I'm pretty sure vmcs.ACTIVITY_STATE is lost, which is wrong. Definitely, we need Sean's confirmation here.