On 10.06.2025 15:05, Oleksii Kurochko wrote: > @@ -18,10 +20,20 @@ struct arch_vcpu_io { > struct arch_vcpu { > }; > > +struct paging_domain { > + spinlock_t lock; > + /* Free P2M pages from the pre-allocated P2M pool */ > + struct page_list_head p2m_freelist; > + /* Number of pages from the pre-allocated P2M pool */ > + unsigned long p2m_total_pages; > +}; > + > struct arch_domain { > struct hvm_domain hvm; > > struct p2m_domain p2m; > + > + struct paging_domain paging;
With the separate structures, do you have plans to implement e.g. shadow paging? Or some other paging mode beyond the basic one based on the H extension? If the structures are to remain separate, may I suggest that you keep things properly separated (no matter how e.g. Arm may have it) in terms of naming? I.e. no single "p2m" inside struct paging_domain. > @@ -105,6 +106,9 @@ int p2m_init(struct domain *d) > struct p2m_domain *p2m = p2m_get_hostp2m(d); > int rc; > > + spin_lock_init(&d->arch.paging.lock); > + INIT_PAGE_LIST_HEAD(&d->arch.paging.p2m_freelist); If you want p2m and paging to be separate, you will want to put these in a new paging_init(). Jan