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

Re: [PATCH v5 08/10] xen: Split HAS_DEVICE_TREE in two


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Wed, 2 Jul 2025 17:28:25 +0200
  • 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=cTqD5zRKnyxuaAEmCCOCJf6eylJekqzkFmU0x9U6Cqg=; b=Cq6cia7UNI14+KbpyD8MbAJlbNhG58hOWaHLgnvrh4BWI7y9drBSBQI21uiFhgHoHTyEqSBr3zV6a1EJwtvZaaOWCy4SKw9mhIaARQk8TWsSjV238+AbeRZx+DkC0f0D1ollVMhQRWQddWr9HoEwytnsPkA/Q2NJ6V9XylDUA5zL4CJi9atMHEmpgixMz+bdjBZMzG6dSHWNMkAIfTIT8XnSYeinfKMxGdZyyJ0jZ9603/YZwniVQrD2FILjp383Gt4OJX1DR9o1ZXv/NaPNDCWUMoJRZ7vcETIhs81IrwkFM8cY9YfR8ZLD4Dn+3dhHAuAp7F95Tr2S4GdIFt6+AA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y3JJbmqv2caBj8GyOW5OluvC8um7rxGHLgdnRWYfsSHpkJhRb5PnqI07XgjLavbLPh6XCzEVxQwaV9YmLvD5EuGZsY1PZ9qZn9McUzsGTid8JdK3fT/X+cX8WNYxddEnW9DnDnfC6DVlmMbW55ek963R475tW8o4KRXWGCSsyA9Jd/otSwWpYsXMKJk/Vl5KUFK0rgAUR8FmGEZSKsHPyWDHEhG3ecWDGHEjnEyI5Nl9jcf5mZ/AK1BoawG7zZan83BxyTKgwCB6yQ3BFoIvOZ46o28aey8JD/BVmDbLV53wybbzNIE5YJVcahCd2F3RcLN2XYB6gkU9xHKVYAqV8A==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Bertrand Marquis" <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, "Connor Davis" <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 02 Jul 2025 15:28:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed Jul 2, 2025 at 3:30 PM CEST, Jan Beulich wrote:
> On 01.07.2025 12:57, Alejandro Vallejo wrote:
>> @@ -85,7 +86,11 @@ config HAS_ALTERNATIVE
>>  config HAS_COMPAT
>>      bool
>>  
>> -config HAS_DEVICE_TREE
>> +config HAS_DEVICE_TREE_DISCOVERY
>> +    bool
>> +    select DEVICE_TREE_PARSE
>> +
>> +config DEVICE_TREE_PARSE
>>      bool
>>      select LIBFDT
>>  
>
> We're in the middle of various ([almost] alphabetically sorted) HAS_* here.
> Thus DEVICE_TREE_PARSE wants to move elsewhere. Or we want to move back to
> naming it HAS_DEVICE_TREE_PARSE, but I think there was a reason why we didn't
> want it like that? Just that I don't recall what that reason was ...

AIUI, HAS_X are options selected by your architecture. Things that tell you
whether X is supported in your arch or not. In this case, HAS_DEVICE_TREE_PARSE
would be supported everywhere, while DEVICE_TREE_PARSE is not an arch property,
but an option selected by DOM0LESS_BOOT (which appears in menuconfig) and
HAS_DEVICE_TREE_DISCOVERY.

I can move it elsewhere, but it's unfortunate to separate two so closely
related options.

>
>> --- a/xen/common/sched/Kconfig
>> +++ b/xen/common/sched/Kconfig
>> @@ -67,7 +67,7 @@ endmenu
>>  
>>  config BOOT_TIME_CPUPOOLS
>>      bool "Create cpupools at boot time"
>> -    depends on HAS_DEVICE_TREE
>> +    depends on HAS_DEVICE_TREE_DISCOVERY
>
> Is this correct? CPU pool creation isn't driven by DT discovery, I thought,
> but is a software-only thing much like dom0less?

In principle it would be possible. But I haven't tested the configuration, so
I'd rather err on the side of caution and not enable features prematurely.

In time, this should become DOM0LESS_BOOT || HAS_DEVICE_TREE_DISCOVERY.

>
>> --- a/xen/include/xsm/dummy.h
>> +++ b/xen/include/xsm/dummy.h
>> @@ -423,7 +423,7 @@ static XSM_INLINE int cf_check xsm_deassign_device(
>>  
>>  #endif /* HAS_PASSTHROUGH && HAS_PCI */
>>  
>> -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
>> +#if defined(CONFIG_HAS_PASSTHROUGH) && 
>> defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
>>  static XSM_INLINE int cf_check xsm_assign_dtdevice(
>>      XSM_DEFAULT_ARG struct domain *d, const char *dtpath)
>>  {
>> @@ -438,7 +438,7 @@ static XSM_INLINE int cf_check xsm_deassign_dtdevice(
>>      return xsm_default_action(action, current->domain, d);
>>  }
>>  
>> -#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
>> +#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY */
>
> Here I'm similarly unsure: Pass-through again isn't a platform thing, is it?

This has to do strictly with passthrough of devices discovered via DT.

>
>> @@ -789,7 +789,7 @@ int xsm_multiboot_policy_init(
>>      struct boot_info *bi, void **policy_buffer, size_t *policy_size);
>>  #endif
>>  
>> -#ifdef CONFIG_HAS_DEVICE_TREE
>> +#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
>>  /*
>>   * Initialize XSM
>>   *
>> @@ -839,7 +839,7 @@ static inline int xsm_multiboot_init(struct boot_info 
>> *bi)
>>  }
>>  #endif
>>  
>> -#ifdef CONFIG_HAS_DEVICE_TREE
>> +#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
>>  static inline int xsm_dt_init(void)
>>  {
>>      return 0;
>> @@ -849,7 +849,7 @@ static inline bool has_xsm_magic(paddr_t start)
>>  {
>>      return false;
>>  }
>> -#endif /* CONFIG_HAS_DEVICE_TREE */
>> +#endif /* CONFIG_HAS_DEVICE_TREE_DISCOVERY */
>
> The situation is yet less clear to me here

XSM segregates multibooting and DT-booting, this refers strictly to the latter.

By DT-booting I mean platforms where the DT is given by the platform rather
than the user as a module.

Cheers,
Alejandro



 


Rackspace

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