aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/hyperv_timer.c
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2019-11-11 22:12:27 +0000
committerPaolo Bonzini <[email protected]>2019-11-12 09:17:42 +0000
commita78986aae9b2988f8493f9f65a587ee433e83bc3 (patch)
treea630d421bde6adbf63834c840e3276096ecae4b1 /drivers/clocksource/hyperv_timer.c
parentKVM: VMX: Introduce pi_is_pir_empty() helper (diff)
downloadkernel-a78986aae9b2988f8493f9f65a587ee433e83bc3.tar.gz
kernel-a78986aae9b2988f8493f9f65a587ee433e83bc3.zip
KVM: MMU: Do not treat ZONE_DEVICE pages as being reserved
Explicitly exempt ZONE_DEVICE pages from kvm_is_reserved_pfn() and instead manually handle ZONE_DEVICE on a case-by-case basis. For things like page refcounts, KVM needs to treat ZONE_DEVICE pages like normal pages, e.g. put pages grabbed via gup(). But for flows such as setting A/D bits or shifting refcounts for transparent huge pages, KVM needs to to avoid processing ZONE_DEVICE pages as the flows in question lack the underlying machinery for proper handling of ZONE_DEVICE pages. This fixes a hang reported by Adam Borowski[*] in dev_pagemap_cleanup() when running a KVM guest backed with /dev/dax memory, as KVM straight up doesn't put any references to ZONE_DEVICE pages acquired by gup(). Note, Dan Williams proposed an alternative solution of doing put_page() on ZONE_DEVICE pages immediately after gup() in order to simplify the auditing needed to ensure is_zone_device_page() is called if and only if the backing device is pinned (via gup()). But that approach would break kvm_vcpu_{un}map() as KVM requires the page to be pinned from map() 'til unmap() when accessing guest memory, unlike KVM's secondary MMU, which coordinates with mmu_notifier invalidations to avoid creating stale page references, i.e. doesn't rely on pages being pinned. [*] http://lkml.kernel.org/r/[email protected] Reported-by: Adam Borowski <[email protected]> Analyzed-by: David Hildenbrand <[email protected]> Acked-by: Dan Williams <[email protected]> Cc: [email protected] Fixes: 3565fce3a659 ("mm, x86: get_user_pages() for dax mappings") Signed-off-by: Sean Christopherson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'drivers/clocksource/hyperv_timer.c')
0 files changed, 0 insertions, 0 deletions