lkml.org 
[lkml]   [2017]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 1/3] KVM: x86: prevent MWAIT in guest with buggy MONITOR
    Date
    The bug prevents MWAIT from waking up after a write to the monitored
    cache line.
    KVM might emulate a CPU model that shouldn't have the bug, so the guest
    would not employ a workaround and possibly miss wakeups.
    Better to avoid the situation.

    Reviewed-by: Alexander Graf <agraf@suse.de>
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    ---
    arch/x86/kvm/x86.h | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
    index d0b95b7a90b4..81f5f50794f6 100644
    --- a/arch/x86/kvm/x86.h
    +++ b/arch/x86/kvm/x86.h
    @@ -281,6 +281,9 @@ static inline bool kvm_mwait_in_guest(void)
    return false;
    }

    + if (boot_cpu_has_bug(X86_BUG_MONITOR))
    + return false;
    +
    /*
    * Intel CPUs without CPUID5_ECX_INTERRUPT_BREAK are problematic as
    * they would allow guest to stop the CPU completely by disabling
    --
    2.14.2
    \
     
     \ /
      Last update: 2017-11-29 22:25    [W:3.008 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site