On 06.08.2025 18:55, Andrew Cooper wrote: > --- a/xen/arch/x86/domctl.c > +++ b/xen/arch/x86/domctl.c > @@ -372,6 +372,14 @@ long arch_do_domctl( > struct page_info *page; > void *hypercall_page; > > + /* > + * Kernels should use the MSR method to get a hypercall page. The > + * toolstack should not be using the DOMCTL on itself. > + */ > + ret = -EINVAL; > + if ( d == currd ) > + break;
Isn't what the comment says more generally true? To act on themselves, most domctl-s are inappropriate to use, I think. There are a few exceptions, where alternatives simply don't exist (and where, if a kernel wanted to use a domctl [or sysctl], it would need to go through hoops to deal with the interface versioning). Yet there's still the question of whether we shouldn't apply this restriction in a broader fashion. Jan