This commit was first released with 5.0: commit 9ebdfe5230f2e50e3ba05c57723a06e90946815a Author: Jim Mattson <jmattson@xxxxxxxxxx> Date: Mon Nov 26 11:22:32 2018 -0800 kvm: nVMX: NMI-window and interrupt-window exiting should wake L2 from HLT According to the SDM, "NMI-window exiting" VM-exits wake a logical processor from the same inactive states as would an NMI and "interrupt-window exiting" VM-exits wake a logical processor from the same inactive states as would an external interrupt. Specifically, they wake a logical processor from the shutdown state and from the states entered using the HLT and MWAIT instructions. Fixes: 6dfacadd5858 ("KVM: nVMX: Add support for activity state HLT") Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx> Reviewed-by: Peter Shier <pshier@xxxxxxxxxx> Suggested-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> [Squashed comments of two Jim's patches and used the simplified code hunk provided by Sean. - Radim] Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx> This commit does not apply clean to 4.19, only due to restructuring that split out a portion of arch/x86/kvm/vmx.c into arch/x86/kvm/vmx/nested.c. The following procedure can be followed to allow the patch to apply clean to 4.19: git checkout linux-4.19.y git format-patch -1 9ebdfe5230f2e50e3ba05c57723a06e90946815a perl -pi -e 's[arch/x86/kvm/vmx/nested.c][arch/x86/kvm/vmx.c]g' 0001-kvm-nVMX-NMI-window-and-interrupt-window-exiting-sho.patch git am 0001-kvm-nVMX-NMI-window-and-interrupt-window-exiting-sho.patch I have been using this patch in our own 4.19-based production environment (which heavily uses nested KVM for product simulation) since January, 2019, along with several other nVMX patches. All of the other nVMX patches have since made it into 4.19 except for this one. I expect this one did not make the stable list because it did not apply cleanly without help. I don't have a specific test to reproduce the problem that this fix addresses. I had specific problems that were addressed by other nVMX patches, but this was one I chose to add as a preventative measure based upon the description and the likelihood that the problem might impact us. Please consider including this patch into 4.19. I don't mind maintaining it local if there is some reason it doesn't qualify for stable. But, if this could help others, I'm happy to share the above method of getting it into 4.19 safely. Thank you! -- Mark Mielke <mark.mielke@xxxxxxxxx>