[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/domctl: Conditionalise x86 domctl using DCE rather than ifdef


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Tue, 10 Feb 2026 18:06:36 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LsPgQMSQ/Ud3LiqV7TLiHwOqf0ZsclNkla8xSgflwro=; b=cLF2uW/kzwlMsxlSVxAagdjHlNA3lyp9QLwRClU7Fk8Zo0GIq0BfCfpvwgZmjmxNysfU2JccH65grVUtRW5C48oxlRkfQuEhHVtGaWIVx1ULHWkl1sj9cehMlgFpPvl3DX4VWwdbHA4vk27AdtmiUNdB1GCNV0WDKBje8hpZAC/YHieWzqWJtVqIfvFX5iPq6uVQtNGZMY8h1EttJG9u07Wsq0PE0xXM9opipVhwFUO+/lqZAXy+BQHPkZDpXiEoPYW78dlPSzhHyfaKLPM5ZiA8990vwuLzkhNKFZHYENi2d6zmfPMHObNuSPJVPdJuDr4ADcpqZ9he095o9sjt7w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bfWYo31uYAqXLWynwInYvtlNsXdZRJ6zYfepDQgmVFf08chtt3YfTduzhQ7WGsDL31cCRcdvdC26s23LSHPMrPAo6TP+XW+js3S/UCyVmnH2tZnUZ0VsgvZL8H9bbB7Hz42TEI4m1PU6OUz6WGjMRGAUNHs9VD1NLi9cGpFTLXOjZPSpMLI7UbY2t3zUEpD5yaHY70b4pr6SR6a6derQCArGhNBqVXPA3TUgeg4QcHunk+9R3l5w7+AHsFGrPZjAyjfu2FiWpMkG/xajn6RWYvkjtcYpjNQIy9hAweanubi7XLmtIo3zzSx7R45u17byF+2Piq89aiLLIx12uoHE/g==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Feb 2026 17:11:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.