[Public] > -----Original Message----- > From: Jan Beulich <[email protected]> > Sent: Thursday, October 30, 2025 8:44 PM > To: Penny, Zheng <[email protected]> > Cc: Huang, Ray <[email protected]>; [email protected]; Stefano > Stabellini <[email protected]>; Julien Grall <[email protected]>; Bertrand > Marquis <[email protected]>; Orzel, Michal <[email protected]>; > Volodymyr Babchuk <[email protected]>; Andrew Cooper > <[email protected]>; Anthony PERARD <[email protected]>; > Roger Pau Monné <[email protected]>; Shawn Anastasio > <[email protected]>; Alistair Francis > <[email protected]>; > Bob Eshleman <[email protected]>; Connor Davis > <[email protected]>; Tamas K Lengyel <[email protected]>; xen- > [email protected] > Subject: Re: [PATCH v3 15/28] xen/domctl: wrap domain_kill() with > CONFIG_MGMT_HYPERCALLS > > > --- a/xen/arch/x86/mm/paging.c > > +++ b/xen/arch/x86/mm/paging.c > > @@ -768,6 +768,7 @@ void paging_vcpu_teardown(struct vcpu *v) > > shadow_vcpu_teardown(v); > > } > > > > +#ifdef CONFIG_MGMT_HYPERCALLS > > /* Call when destroying a domain */ > > int paging_teardown(struct domain *d) { @@ -794,6 +795,7 @@ int > > paging_teardown(struct domain *d) > > > > return rc; > > } > > +#endif /* CONFIG_MGMT_HYPERCALLS */ > > > > /* Call once all of the references to the domain have gone away */ > > void paging_final_teardown(struct domain *d) > > This is irritating, and could hence have done with some clarification in the > description (to aid review, if nothing else): On the surface, why would > paging_teardown() need excluding, but paging_vcpu_teardown() and > paging_final_teardown() would (need to) stay? Yes, the latter two are used on > failure > paths of certain functions. (Same e.g. for domain_teardown() and hence > arch_domain_teardown().) >
The reason for domain_teardown() is that its another usage is in the failure path of domain_create() The exclusion of paging_final_teardown() is blocked by domain_destroy(), which will be triggered when refcnt equals zero. > Jan
