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

Re: [PATCH v5] x86: make Viridian support optional


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Thu, 9 Oct 2025 19:33:55 +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=H8hUAPdMt8LeEXvyjXzf+ru/B10BfoHbRgXUTt7HCbM=; b=exK6r8GNgYGXlUnXER4DmRcNrnjs7iyVYs94FtrnLPZGDlgSFj1Rd720BvPjzmP6xEBQ5AIEUlovyfhRriwpfAQLAMxRvCkKuoKf6jLfUZgpZeUf34O+qag84vHzUz9KeaywdmMWSEB7PPaxZZW8iTEdO6q3nAkpf4lZX7I2OeFWzCzvhXzSWe4n5ngpyAA78gFgB1Dt2MMdaTeC3Tv2cP+T1FXDnfoC+17ZukFtoTwx6EILoyIyPu/BwJwgnK0Y+VaLzCB+USAJJL/39ak/iv1jk5/+wwTcGTE7thQjGKUmtZj40iXpOOnBl4sGtzq4SnDI7ps5BufbAgH8MQ5OlA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d1XkAsj1ubDCdtfGjsjzWk02VMHrbOibNKJ0IYK0ivbKdenWiLxqszoWdGXlPT8RMotrbd7WP/3NvkYHuatwPYtlsFgZ5USagThnYoGE5pmEnbZvL4GExocPxfw/ByWJRTSB1tPVc8VFJChbEFa46F+W+8Pfck3d0nHwZ4tp4dJgUO3T7HghkemAYlYFqFKitYBqomvtCU/GUMcwA75ouYQoWr4BhwY8Div1pdtqS+FMoUs+hQez2zQNPmuoBjBD3YLdge+P3iq66LGW8r5FyJVLToQdsEOnWpG8kaWpOhT1CNCej39X2LwSHx69Hcij9PzTR27qVPsoMbIAjLyHlA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Sergiy Kibrik <Sergiy_Kibrik@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 09 Oct 2025 16:34:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 08.10.25 19:04, Jan Beulich wrote:
On 30.09.2025 14:52, Grygorii Strashko wrote:
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -62,6 +62,16 @@ config ALTP2M
If unsure, stay with defaults. +config VIRIDIAN
+       bool "Hyper-V enlightenments for guests" if EXPERT
+       default y
+       help
+         Support optimizations for Hyper-V guests such as faster hypercalls,
+         efficient timer and interrupt handling, and enhanced paravirtualized
+         I/O. This is to improve performance and compatibility of Windows VMs.

What is "paravirtualized I/O" about in this context?

It was phrased this way and agreed upon from the very beginning [1]

[1] 
https://patchwork.kernel.org/project/xen-devel/patch/20250317071919.3766976-1-Sergiy_Kibrik@xxxxxxxx/#26305207


--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -701,9 +701,12 @@ int hvm_domain_initialise(struct domain *d,
      if ( hvm_tsc_scaling_supported )
          d->arch.hvm.tsc_scaling_ratio = hvm_default_tsc_scaling_ratio;
- rc = viridian_domain_init(d);
-    if ( rc )
-        goto fail2;
+    if ( is_viridian_domain(d) )
+    {
+        rc = viridian_domain_init(d);
+        if ( rc )
+            goto fail2;
+    }

While this looks okay to me, ...

@@ -739,7 +742,8 @@ void hvm_domain_relinquish_resources(struct domain *d)
      if ( hvm_funcs.nhvm_domain_relinquish_resources )
          alternative_vcall(hvm_funcs.nhvm_domain_relinquish_resources, d);
- viridian_domain_deinit(d);
+    if ( is_viridian_domain(d) )
+        viridian_domain_deinit(d);

... I wonder if viridian_{domain,vcpu}_deinit() better wouldn't be tolerant
to be called anyway, thus avoiding the need for conditionals here and below
(and perhaps being a little more robust overall). Thoughts?

I think There are no limits for perfection. But at some point - need to stop.

Hence Viridian code will be removed from build when !VIRIDIAN - changing above 
code will
require to add stubs for viridian_{domain,vcpu}_deinit().

FYI: Xen pipeline for this patch
https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2090362213

--
Best regards,
-grygorii




 


Rackspace

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