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

Re: [XEN][PATCH] x86/hvm: mem_sharing: add dependency from CONFIG_INTEL_VMX


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Fri, 26 Sep 2025 13:15:32 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=kqsp/BiTQvzhn/fc4wT8/PjtXP2QjbmzR8ieVMF8EUo=; b=KgUpS+r5817omUBeblvFSfX+L6EPBPm5jVw+pdovLB2olko2/blP4ec25U7gGysXO5tO4wKyfFmFOv9eKWfG3z3gshLmAIJF2m3ee2DeuxuPNn5UetB8LmAxAETwznFmLNuHHJmW9x6ryDuBaplmA84H4ditZBTYP7MqK6z9GkAqWq5MXKfuiV/VXrNx+AKvPW9T0v8ftDkTkKWArjBHzk6oYS7QBOqnBXUOZ7S/OHpKaIHSnBpceZpx2xtPes94rBA1wYJ7qkhqBEYBdgYZ6a18qSG71E/Pxt82TL3Nvcvu1Oq7DxH1OyIdJwIr51kjTwNsTNdunLu2cpEoSt2fqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ORgHvWrk1G1kxq/4cyIEU2/Ik2R5OGKxLNEibf2KJn7V1q1ba2mh+vmTnF/qlbO/Jbxuy0PjRrt4ok9y3XXO/Ms6KJP/qCy4b/AXGWyAu0fsrxJjcYSlF+MFoHAENvpUGvjwf0+Zrepq2f2PKoXg6LuuCU4Oyd6+GleYFV1z9KlFaEpLr1R/V1u9WPZWSHMpVkRRgIzJl47PF/k5mMBUp7+1X6217azUrGRAdAWvqx0s6GHfl93Ox+LlnHz/AoGgX5O+eDj0peHz1VPGOIDpw4ETuavqRv41lR6UDSRjv2Io06tsbxGK6mhTS/ksAHqyBA8BtIe+S79+f/rGW1JNkQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 26 Sep 2025 10:15:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 26.09.25 09:37, Jan Beulich wrote:
On 25.09.2025 21:56, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

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 <grygorii_strashko@xxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

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




 


Rackspace

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