提交 628ade2d 编写于 作者: P Peter Xu 提交者: Paolo Bonzini

KVM: VMX: Fix x2APIC MSR intercept handling on !APICV platforms

Fix an inverted flag for intercepting x2APIC MSRs and intercept writes
by default, even when APICV is enabled.

Fixes: 3eb90017 ("KVM: x86: VMX: Prevent MSR passthrough when MSR access is denied")
Co-developed-by: NPeter Xu <peterx@redhat.com>
[sean: added changelog]
Signed-off-by: NSean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20201005195532.8674-2-sean.j.christopherson@intel.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 6a2e0923
......@@ -3787,9 +3787,10 @@ static void vmx_update_msr_bitmap_x2apic(struct kvm_vcpu *vcpu, u8 mode)
int msr;
for (msr = 0x800; msr <= 0x8ff; msr++) {
bool intercepted = !!(mode & MSR_BITMAP_MODE_X2APIC_APICV);
bool apicv = !!(mode & MSR_BITMAP_MODE_X2APIC_APICV);
vmx_set_intercept_for_msr(vcpu, msr, MSR_TYPE_RW, intercepted);
vmx_set_intercept_for_msr(vcpu, msr, MSR_TYPE_R, !apicv);
vmx_set_intercept_for_msr(vcpu, msr, MSR_TYPE_W, true);
}
if (mode & MSR_BITMAP_MODE_X2APIC) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册