On 26.09.25 09:37, Jan Beulich wrote:
On 25.09.2025 21:56, Grygorii Strashko wrote:
From: Grygorii Strashko <[email protected]>

According to the commit b66e28226dd9 ("x86/mem_sharing: gate enabling on
cpu_has_vmx") the Xen memory sharing support is only possible on platforms
with "Intel VT-x" (INTEL_VMX=y) enabled.
The same commit is also added runtime check for "cpu_has_vmx" in
mem_sharing_control() which blocks access to XENMEM_sharing_ops if
!cpu_has_vmx.

Hence add dependency from INTEL_VMX for MEM_SHARING Kconfig option.

Signed-off-by: Grygorii Strashko <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>

You should have Cc-ed Tamas, for being the maintainer of mem-sharing.

Sorry, I relied on add_maintainers.pl script.


--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -79,5 +79,6 @@ config MEM_PAGING
config MEM_SHARING
        bool "Xen memory sharing support (UNSUPPORTED)" if UNSUPPORTED
+       depends on INTEL_VMX
endif

Wouldn't this want accompanying by replacing the cpu_has_vmx in
mem_sharing_control() with using_vmx()? The gain in this case may not
be very high, but it would serve a doc purpose.

There are no benefits. if !INTEL_VMX the whole module will excluded from build,
if INTEL_VMX - it will end up calling "cpu_has_vmx".

What, potentially, might make sense is to move mem sharing code to HVM
x86/mm/mem_sharing.c -> x86/x86/hvm/mm/mem_sharing.c

As it is strictly HVM specific. Just is potential TODO item.

--
Best regards,
-grygorii


Reply via email to