|
@@ -1637,8 +1637,8 @@ int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
|
|
|
ghc->generation = slots->generation;
|
|
|
ghc->len = len;
|
|
|
ghc->memslot = gfn_to_memslot(kvm, start_gfn);
|
|
|
- ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, &nr_pages_avail);
|
|
|
- if (!kvm_is_error_hva(ghc->hva) && nr_pages_avail >= nr_pages_needed) {
|
|
|
+ ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, NULL);
|
|
|
+ if (!kvm_is_error_hva(ghc->hva) && nr_pages_needed <= 1) {
|
|
|
ghc->hva += offset;
|
|
|
} else {
|
|
|
/*
|