]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Set @writable to false for non-visible accesses by L2
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 15 Apr 2020 21:44:13 +0000 (14:44 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Apr 2020 13:13:08 +0000 (09:13 -0400)
commit36e65ef3d17947180b3da3d3d56a23803fdb7370
tree9522a92fa5fd1316e12cd696a3c02c9488e91207
parentdf9223d6fde1c5edb658d7580fb4031ec3b1a4a2
KVM: x86/mmu: Set @writable to false for non-visible accesses by L2

Explicitly set @writable to false in try_async_pf() if the GFN->PFN
translation is short-circuited due to the requested GFN not being
visible to L2.

Leaving @writable ('map_writable' in the callers) uninitialized is ok
in that it's never actually consumed, but one has to track it all the
way through set_spte() being short-circuited by set_mmio_spte() to
understand that the uninitialized variable is benign, and relying on
@writable being ignored is an unnecessary risk.  Explicitly setting
@writable also aligns try_async_pf() with __gfn_to_pfn_memslot().

Jim Mattson <jmattson@google.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200415214414.10194-2-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c