]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Yield in TDU MMU iter even if no SPTES changed
authorBen Gardon <bgardon@google.com>
Tue, 2 Feb 2021 18:57:20 +0000 (10:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:41 +0000 (05:27 -0500)
commitfc39f12925204eb105a074ae01dba1159af72426
tree4807a0d90ad215b5454cc7883247517653362455
parent75f0f3d796f468c869ed6207d488cae86a258b35
KVM: x86/mmu: Yield in TDU MMU iter even if no SPTES changed

Given certain conditions, some TDP MMU functions may not yield
reliably / frequently enough. For example, if a paging structure was
very large but had few, if any writable entries, wrprot_gfn_range
could traverse many entries before finding a writable entry and yielding
because the check for yielding only happens after an SPTE is modified.

Fix this issue by moving the yield to the beginning of the loop.

Fixes: 679d4157b88d ("kvm: x86/mmu: Support dirty logging for the TDP MMU")
Reviewed-by: Peter Feiner <pfeiner@google.com>
Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210202185734.1680553-15-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c