KVM: X86: Provide a capability to disable MWAIT intercepts

Allowing a guest to execute MWAIT without interception enables a guest
to put a (physical) CPU into a power saving state, where it takes
longer to return from than what may be desired by the host.

Don't give a guest that power over a host by default. (Especially,
since nothing prevents a guest from using MWAIT even when it is not
advertised via CPUID.)

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Wanpeng Li
2018-03-12 04:53:02 -07:00
committed by Paolo Bonzini
parent 4956aa3b8b
commit 4d5422cea3
8 changed files with 53 additions and 25 deletions

View File

@@ -811,6 +811,8 @@ struct kvm_arch {
gpa_t wall_clock;
bool mwait_in_guest;
bool ept_identity_pagetable_done;
gpa_t ept_identity_map_addr;