···6363#include <linux/sched/mm.h>6464#include <linux/uaccess.h>6565#include <linux/nospec.h>6666-#include <linux/highmem.h>6766#include <linux/fsnotify.h>6867#include <linux/fadvise.h>6968#include <linux/task_work.h>···26562657 struct page **page_array;26572658 unsigned int nr_pages;26582659 void *page_addr;26592659- int ret, i, pinned;26602660+ int ret, pinned;2660266126612662 *npages = 0;26622663···26782679 goto free_pages;26792680 }2680268126812681- page_addr = page_address(page_array[0]);26822682- for (i = 0; i < nr_pages; i++) {26832683- ret = -EINVAL;26842684-26852685- /*26862686- * Can't support mapping user allocated ring memory on 32-bit26872687- * archs where it could potentially reside in highmem. Just26882688- * fail those with -EINVAL, just like we did on kernels that26892689- * didn't support this feature.26902690- */26912691- if (PageHighMem(page_array[i]))26922692- goto free_pages;26932693-26942694- /*26952695- * No support for discontig pages for now, should either be a26962696- * single normal page, or a huge page. Later on we can add26972697- * support for remapping discontig pages, for now we will26982698- * just fail them with EINVAL.26992699- */27002700- if (page_address(page_array[i]) != page_addr)27012701- goto free_pages;27022702- page_addr += PAGE_SIZE;26822682+ page_addr = vmap(page_array, nr_pages, VM_MAP, PAGE_KERNEL);26832683+ if (page_addr) {26842684+ *pages = page_array;26852685+ *npages = nr_pages;26862686+ return page_addr;27032687 }27042704-27052705- *pages = page_array;27062706- *npages = nr_pages;27072707- return page_to_virt(page_array[0]);27082708-26882688+ ret = -ENOMEM;27092689free_pages:27102690 io_pages_free(&page_array, pinned > 0 ? pinned : 0);27112691 return ERR_PTR(ret);···27142736 ctx->n_ring_pages = 0;27152737 io_pages_free(&ctx->sqe_pages, ctx->n_sqe_pages);27162738 ctx->n_sqe_pages = 0;27392739+ vunmap(ctx->rings);27402740+ vunmap(ctx->sq_sqes);27172741 }2718274227192743 ctx->rings = NULL;