]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: SEV: Add cond_resched() to loop in sev_clflush_pages()
authorPeter Gonda <pgonda@google.com>
Wed, 30 Mar 2022 16:43:06 +0000 (09:43 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Apr 2022 12:09:36 +0000 (08:09 -0400)
Add resched to avoid warning from sev_clflush_pages() with large number
of pages.

Signed-off-by: Peter Gonda <pgonda@google.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Message-Id: <20220330164306.2376085-1-pgonda@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c

index 75fa6dd268f056644446ef5db4c596658d08097b..c2fe89ecdb2dd860881ffee07df46c663082f8cf 100644 (file)
@@ -465,6 +465,7 @@ static void sev_clflush_pages(struct page *pages[], unsigned long npages)
                page_virtual = kmap_atomic(pages[i]);
                clflush_cache_range(page_virtual, PAGE_SIZE);
                kunmap_atomic(page_virtual);
+               cond_resched();
        }
 }