[PATCH] kvm: mmu: Ensure try_async_pf initializes *writable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the writable argument is non-NULL, set *writable to false when
exiting early from try_async_pf with *pfn set to KVM_PFN_NOSLOT.
Cf. commit b2740d3533a3 ("KVM: ensure __gfn_to_pfn_memslot initializes
*writable").

Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 arch/x86/kvm/mmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 8af8c8f88bd7..dcc397bfeecc 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3811,6 +3811,8 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
 	 * Don't expose private memslots to L2.
 	 */
 	if (is_guest_mode(vcpu) && !kvm_is_visible_gfn(vcpu->kvm, gfn)) {
+		if (writable)
+			*writable = false;
 		*pfn = KVM_PFN_NOSLOT;
 		return false;
 	}
-- 
2.17.0.441.gb46fe60e1d-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux