On Fri, 2020-12-04 at 15:24 -0800, Sean Christopherson wrote: > On Fri, Nov 20, 2020, Rick Edgecombe wrote: > > +struct perm_allocation { > > + struct page **pages; > > + virtual_perm cur_perm; > > + virtual_perm orig_perm; > > + struct vm_struct *area; > > + unsigned long offset; > > + unsigned long size; > > + void *writable; > > +}; > > + > > +/* > > + * Allocate a special permission kva region. The region may not be > > mapped > > + * until a call to perm_writable_finish(). A writable region will > > be mapped > > + * immediately at the address returned by perm_writable_addr(). > > The allocation > > + * will be made between the start and end virtual addresses. > > + */ > > +struct perm_allocation *perm_alloc(unsigned long vstart, unsigned > > long vend, unsigned long page_cnt, > > + virtual_perm perms); > > IMO, 'perm' as the root namespace is too generic, and perm_ is > already very > prevelant throughout the kernel. E.g. it's not obvious when looking > at the > callers that perm_alloc() is the first step in setting up an > alternate kernel > VA->PA mapping. > > I don't have a suggestion for a more intuitive name, but in the > absence of a > perfect name, I'd vote for an acronym that is easy to > grep. Something like > pvmap? That isn't currently used in the kernel, though I can't help > but read it > as "paravirt map"... Good point, thanks. After Christoph's comments to return a vm_struct pointer, I was going to try to pick some more vmalloc-like names. Like vmalloc_perm(), vmalloc_writable_finish(), etc. Still have to play around with it some more.