[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191106170727.14457-1-sean.j.christopherson@intel.com>
Date: Wed, 6 Nov 2019 09:07:25 -0800
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>
Cc: Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Adam Borowski <kilobyte@...band.pl>,
David Hildenbrand <david@...hat.com>,
Dan Williams <dan.j.williams@...el.com>
Subject: [PATCH 0/2] KVM: MMU: Fix a refcount bug with ZONE_DEVICE pages
This mini-series fixes a suspected, but technically unconfirmed, bug in
KVM related to ZONE_DEVICE pages. The suspected issue is that KVM treats
ZONE_DEVICE pages as reserved PFNs, and so doesn't put references to such
pages when dropping references via KVM's generic kvm_release_pfn_clean().
David Hildenbrand uncovered the bug during a discussion about removing
PG_reserved from ZONE_DEVICE pages, after Dan Williams pointed out[1] that
there was a bug report from Adam Borowski[2] that was likely related to
KVM's interaction with PageReserved().
Patch 1/2 contains the actual fix, patch 2/2 is a minor cleanup that is
mostly unrelated, but dependent and prompted by the fix in patch 1/2.
The fix itself is a bit more aggressive than what was proposed by David
and Dan, but I'm fairly confident it's the right direction for the long
term, and it also plays nice with the original PG_reserved removal series
that exposed the bug.
To be 100% clear, I haven't actually confirmed this fixes the bug reported
by Adam.
[1] http://lkml.kernel.org/r/20190919115547.GA17963@angband.pl
[2] https://lkml.kernel.org/r/01adb4cb-6092-638c-0bab-e61322be7cf5@redhat.com
Sean Christopherson (2):
KVM: MMU: Do not treat ZONE_DEVICE pages as being reserved
KVM: x86/mmu: Add helper to consolidate huge page promotion
arch/x86/kvm/mmu.c | 15 +++++++++------
include/linux/kvm_host.h | 1 +
virt/kvm/kvm_main.c | 19 +++++++++++++++----
3 files changed, 25 insertions(+), 10 deletions(-)
--
2.24.0
Powered by blists - more mailing lists