On Tue, Feb 27, 2024 at 05:31:28PM -0800, Alexei Starovoitov wrote:
> What would it look like with a cookie?
> A static inline wrapper around get_vm_area() that returns area->addr ?
> And the start address of vmap range will be such a cookie?
Hmm, just making the kernel virtual address the cookie
On Tue, Feb 27, 2024 at 9:59 AM Christoph Hellwig wrote:
>
> > privately-managed pages into a sparse vm area with the following steps:
> >
> > area = get_vm_area(area_size, VM_SPARSE); // at bpf prog verification
> > time
> > vm_area_map_pages(area, kaddr, 1, page); // on demand
> >
> privately-managed pages into a sparse vm area with the following steps:
>
> area = get_vm_area(area_size, VM_SPARSE); // at bpf prog verification time
> vm_area_map_pages(area, kaddr, 1, page); // on demand
> // it will return an error if kaddr is out of range
>
From: Alexei Starovoitov
vmap/vmalloc APIs are used to map a set of pages into contiguous kernel virtual
space.
get_vm_area() with appropriate flag is used to request an area of kernel
address range.
It'se used for vmalloc, vmap, ioremap, xen use cases.
- vmalloc use case dominates the usage.