mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
KVM: Annotate that all paths in hva_to_pfn() might sleep
Now that hva_to_pfn() no longer supports being called in atomic context, move the might_sleep() annotation from hva_to_pfn_slow() to hva_to_pfn(). Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Sean Christopherson <seanjc@google.com> Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20241010182427.1434605-14-seanjc@google.com>
This commit is contained in:
parent
e2d2ca71ac
commit
eec1e5db46
@ -2804,8 +2804,6 @@ static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault,
|
||||
struct page *page;
|
||||
int npages;
|
||||
|
||||
might_sleep();
|
||||
|
||||
if (writable)
|
||||
*writable = write_fault;
|
||||
|
||||
@ -2939,6 +2937,8 @@ kvm_pfn_t hva_to_pfn(unsigned long addr, bool interruptible, bool *async,
|
||||
kvm_pfn_t pfn;
|
||||
int npages, r;
|
||||
|
||||
might_sleep();
|
||||
|
||||
if (hva_to_pfn_fast(addr, write_fault, writable, &pfn))
|
||||
return pfn;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user