[PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY

Oleksii Kurochko posted 26 patches 1 month ago
There is a newer version of this series
[PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY
Posted by Oleksii Kurochko 1 month ago
Introduce HAS_STATIC_MEMORY so that STATIC_MEMORY can be enabled or
disabled on a per-architecture basis. ARM selects the new flag; RISC-V
does not, so CONFIG_STATIC_MEMORY is unavailable on RISC-V and
randconfig builds no longer require an explicit STATIC_MEMORY=n override
to avoid a compilation error.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v5:
 - Add R-by: Jan and Michal.
---
Changes in v4:
 - Reword the commit message to explain that HAS_STATIC_MEMORY allows
   STATIC_MEMORY to be {en,dis}abled per-arch, dropping the reference to
   guest_physmap_add_pages().
 - Split the STATIC_MEMORY dependency into two separate "depends on"
   lines.
---
Changes in v3:
 - New patch.
---
---
 xen/arch/arm/Kconfig | 1 +
 xen/common/Kconfig   | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 683ab7d25a1e..d748404e82da 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -22,6 +22,7 @@ config ARM
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_SHARED_INFO
 	select HAS_STACK_PROTECTOR
+	select HAS_STATIC_MEMORY
 	select HAS_UBSAN
 
 config ARCH_DEFCONFIG
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 8b48d84c79e8..5b289e444fa5 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -161,6 +161,9 @@ config HAS_SCHED_GRANULARITY
 config HAS_SHARED_INFO
 	bool
 
+config HAS_STATIC_MEMORY
+	bool
+
 config HAS_SOFT_RESET
 	bool
 
@@ -196,6 +199,7 @@ config NUMA
 
 config STATIC_MEMORY
 	bool "Static Allocation Support (UNSUPPORTED)" if UNSUPPORTED
+	depends on HAS_STATIC_MEMORY
 	depends on DOM0LESS_BOOT && HAS_DEVICE_TREE_DISCOVERY
 	help
 	  Static Allocation refers to system or sub-system(domains) for
-- 
2.54.0
Re: [PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY
Posted by Jan Beulich 1 month ago
On 06.07.2026 17:57, Oleksii Kurochko wrote:
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -22,6 +22,7 @@ config ARM
>  	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
>  	select HAS_SHARED_INFO
>  	select HAS_STACK_PROTECTOR
> +	select HAS_STATIC_MEMORY
>  	select HAS_UBSAN

Both here and ...

> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -161,6 +161,9 @@ config HAS_SCHED_GRANULARITY
>  config HAS_SHARED_INFO
>  	bool
>  
> +config HAS_STATIC_MEMORY
> +	bool
> +

... here it is clearly visible from context that this patch is assumed
to go on top of "xen: introduce CONFIG_HAS_SHARED_INFO for archs without
a shared page", yet that's not said anywhere. Perhaps that other patch
would better have been part of this series?

Jan
Re: [PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY
Posted by Oleksii Kurochko 1 month ago

On 7/7/26 11:52 AM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -22,6 +22,7 @@ config ARM
>>   	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
>>   	select HAS_SHARED_INFO
>>   	select HAS_STACK_PROTECTOR
>> +	select HAS_STATIC_MEMORY
>>   	select HAS_UBSAN
> 
> Both here and ...
> 
>> --- a/xen/common/Kconfig
>> +++ b/xen/common/Kconfig
>> @@ -161,6 +161,9 @@ config HAS_SCHED_GRANULARITY
>>   config HAS_SHARED_INFO
>>   	bool
>>   
>> +config HAS_STATIC_MEMORY
>> +	bool
>> +
> 
> ... here it is clearly visible from context that this patch is assumed
> to go on top of "xen: introduce CONFIG_HAS_SHARED_INFO for archs without
> a shared page", yet that's not said anywhere. Perhaps that other patch
> would better have been part of this series?

Good point, I think you are right and it would be better to put "xen: 
introduce CONFIG_HAS_SHARED_INFO for archs without a shared page" just 
into this series.
I will do that during preparation of next version of this series.

Thanks.

~ Oleksii