|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 07/14] x86/mm: simplify create_perdomain_mapping() interface
On 02.09.2026 11:43, George Dunlap wrote: > From: Roger Pau Monné <roger.pau@xxxxxxxxxx> > > create_perdomain_mapping()'s interface is richer than any caller needs. > The paging structure for the requested range is built to a depth > selected by the pl1tab and ppg arguments, each of which distinguishes > NULL from NIL() from a real pointer: > > - nr == 0: only ensure the per-domain L3 exists; nothing else is > allocated, and the other arguments are ignored. > - pl1tab == a pointer: allocate the L1 tables covering the range from > the *xenheap*, and return their (stable, direct-map) addresses in > the array -- the mode that existed to build the GDT/LDT stash. > - pl1tab == NIL(): allocate the L1 tables from the domain heap, and > return nothing. > - pl1tab == NULL: do not plumb L1 tables for their own sake (they are > still allocated on demand if data-page population requires them). > - ppg == a pointer: allocate and install zeroed data pages across the > range, and return their struct page_info pointers in the array. > - ppg == NIL(): allocate and install the zeroed data pages, but hand > nothing back; the pages are reachable only through the mapping. > - ppg == NULL: do not allocate data pages. > - both NULL, nr > 0: stop after the slot's L2; do not plumb L1 tables > at all. > > Very few of these modes have users now. The last user of the > pl1tab capture mode was removed when we removed the GDT/LDT stash. > The ppg capture mode never had any users. Nothing uses the both-NULL > L2-only mode with nr != 0. What remains is exactly one bit of > information: whether the caller wants the range populated with zeroed, > area-owned data pages, or merely plumbed down to the L1 tables, ready > for populate_perdomain_mapping() to install caller-owned pages. > > Replace the two arguments with a boolean expressing that bit. With the > stashing mode gone the NIL()/IS_NIL() macros lose their last user, so > drop them as well; and document the resulting interface. > > No caller changes behaviour: every existing call maps onto the boolean > exactly. > > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> > Assisted-by: Claude Code:claude-fable-5 > Signed-off-by: George Dunlap <gwd@xxxxxxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |