Skip to content
Snippets Groups Projects
Commit 56f6ef3e authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov
Browse files

KVM: x86: Only do MSR filtering when access MSR by rdmsr/wrmsr

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2074832



commit ac8d6cad
Author: Hou Wenlong <houwenlong.hwl@antgroup.com>
Date:   Mon Mar 7 20:26:33 2022 +0800

    KVM: x86: Only do MSR filtering when access MSR by rdmsr/wrmsr

    If MSR access is rejected by MSR filtering,
    kvm_set_msr()/kvm_get_msr() would return KVM_MSR_RET_FILTERED,
    and the return value is only handled well for rdmsr/wrmsr.
    However, some instruction emulation and state transition also
    use kvm_set_msr()/kvm_get_msr() to do msr access but may trigger
    some unexpected results if MSR access is rejected, E.g. RDPID
    emulation would inject a #UD but RDPID wouldn't cause a exit
    when RDPID is supported in hardware and ENABLE_RDTSCP is set.
    And it would also cause failure when load MSR at nested entry/exit.
    Since msr filtering is based on MSR bitmap, it is better to only
    do MSR filtering for rdmsr/wrmsr.

Signed-off-by: default avatarHou Wenlong <houwenlong.hwl@antgroup.com>
    Message-Id: <2b2774154f7532c96a6f04d71c82a8bec7d9e80b.1646655860.git.houwenlong.hwl@antgroup.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>

Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
parent 8d1e6a89
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment