[Devel] [PATCH hci-8.1 04/14] ms/KVM: x86/mmu: Cap number of parent PTEs per SP at 1000 (the arbitrary rmap limit)
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Tue Dec 1 03:36:13 MSK 2026
> From: Sean Christopherson <seanjc at google.com>
>
> [ Upstream commit e4558c3d7198ed9a0adc3304681f561f4e4d80e1 ]
>
> When potentially reusing a shadow page, zap the shadow page if its number
> of parent PTEs exceeds KVM's (mostly) arbitrary rmap recycling threshold.
> Letting the guest create a (mostly) unbounded number of parent PTEs allows
> the guest to coerce KVM into creating lists containing millions of PTEs,
> effectively bounded only by the maximum number of shadow pages.
>
> Because PTE lists are simple singly linked lists, removal is O(n). Even
> worse, if a list is constructed just so, teardown can be O(n^2), e.g. if
> SPTEs are built such that zapping child SPTEs always zaps the last entry
> in the list. To cap things off, all paths that walk PTE lists do so
> while holding mmu_lock, without conditionally rescheduling.
> [ ... ]
> (cherry picked from commit edf87e07376054eedcd5306e0794a26e3004d97b)
>
> https://virtuozzo.atlassian.net/browse/VSTOR-157287
> Feature: fix ms/kvm
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
Sashiko has reviewed this patch and found no issues.
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261126-khorenko-vstor-157133-klp-and-kvm-fixes-v1-0-0ec8eaadf1bc@virtuozzo.com?part=4
More information about the Devel
mailing list