On Tue Feb 10, 2026 at 4:39 PM CET, Jan Beulich wrote:
> On 10.02.2026 16:10, Alejandro Vallejo wrote:
>> @@ -1033,11 +1035,13 @@ long arch_do_domctl(
>>          break;
>>      }
>>  
>> -#ifdef CONFIG_MEM_SHARING
>>      case XEN_DOMCTL_mem_sharing_op:
>> +        ret = -EOPNOTSUPP;
>> +        if ( !IS_ENABLED(CONFIG_MEM_SHARING) )
>> +            break;
>> +
>>          ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
>>          break;
>> -#endif
>>  
>>  #if P2M_AUDIT
>>      case XEN_DOMCTL_audit_p2m:
>
> What about this #if, though?

It missed the grep. Should've been changed too.

>
>> --- a/xen/arch/x86/include/asm/mem_sharing.h
>> +++ b/xen/arch/x86/include/asm/mem_sharing.h
>> @@ -9,8 +9,13 @@
>>  #ifndef __MEM_SHARING_H__
>>  #define __MEM_SHARING_H__
>>  
>> -#include <public/domctl.h>
>> -#include <public/memory.h>
>> +#include <xen/sched.h>
>
> As it looks this is for mem_sharing_is_fork(). Can this then please move ...
>
>> +struct xen_domctl_mem_sharing_op;
>> +struct xen_mem_sharing_op;
>> +
>> +int mem_sharing_domctl(struct domain *d,
>> +                       struct xen_domctl_mem_sharing_op *mec);
>>  
>>  #ifdef CONFIG_MEM_SHARING
>
> ... inside this #ifdef? The mem_sharing_domctl() decl may then want moving to
> the bottom of the file.

Sure.

> Otoh I wonder whether supplying a stub wouldn't be
> neater for the single use site.
>
> Jan

Stubs make it really awkward to read the headers. I'd rather not make an
already overcomplicated one worse.

Cheers,
Alejandro

Reply via email to