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?
> --- 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?
Jan