KVM: SEV: Add cond_resched() to loop in sev_clflush_pages()

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>
This commit is contained in:
Peter Gonda 2022-03-30 09:43:06 -07:00 committed by Paolo Bonzini
parent 3123109284
commit 00c2201346
1 changed files with 1 additions and 0 deletions

View File

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