KVM: x86: always allow writing '0' to MSR_KVM_ASYNC_PF_EN
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 11 Sep 2020 09:31:47 +0000 (11:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 11:55:31 +0000 (13:55 +0200)
commitc0823ab23d47ad0ada835b00d1ca0193f8430881
tree12a24af98aefbebb7e4dfbd7f9161f8f1ca7c8de
parent485d953c997e160404d83d7f4ff417257d047bab
KVM: x86: always allow writing '0' to MSR_KVM_ASYNC_PF_EN

[ Upstream commit d831de177217cd494bfb99f2c849a0d40c2a7890 ]

Even without in-kernel LAPIC we should allow writing '0' to
MSR_KVM_ASYNC_PF_EN as we're not enabling the mechanism. In
particular, QEMU with 'kernel-irqchip=off' fails to start
a guest with

qemu-system-x86_64: error: failed to set MSR 0x4b564d02 to 0x0

Fixes: 9d3c447c72fb2 ("KVM: X86: Fix async pf caused null-ptr-deref")
Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20200911093147.484565-1-vkuznets@redhat.com>
[Actually commit the version proposed by Sean Christopherson. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/x86.c