OSDN Git Service

KVM: x86/mmu: Set mmio_value to '0' if reserved #PF can't be generated
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 27 May 2020 08:49:09 +0000 (01:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jun 2020 13:33:10 +0000 (15:33 +0200)
commitbe0bcec4a5ba3fe931262ef0a3a7f119d9745958
treebf01dddff61644cca407fd1d1f4ffc5374efdad8
parent940ed58a08dde24575d9c727b6e69c101c1b4711
KVM: x86/mmu: Set mmio_value to '0' if reserved #PF can't be generated

[ Upstream commit 6129ed877d409037b79866327102c9dc59a302fe ]

Set the mmio_value to '0' instead of simply clearing the present bit to
squash a benign warning in kvm_mmu_set_mmio_spte_mask() that complains
about the mmio_value overlapping the lower GFN mask on systems with 52
bits of PA space.

Opportunistically clean up the code and comments.

Cc: stable@vger.kernel.org
Fixes: d43e2675e96fc ("KVM: x86: only do L1TF workaround on affected processors")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200527084909.23492-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/mmu.c