On Mon, Aug 10, 2026 at 12:45:00PM +0000, Wei Hu wrote:
> From: Wei Liu <[email protected]>
> 
> Query Hyper-V dynamic processor features during mshv initialization to

s/Hyper-V/MSHV/

> determine SEV-SNP availability, and report the result: on success log the
> maximum number of encrypted partitions, otherwise log the decoded SNP
> status string so misconfigurations are diagnosable. Cloud Hypervisor
> expects the root driver to perform this capability check before SEV-SNP
> child partition setup.

No need to reference Cloud Hypervisor here. This applies to all VMMs.

> 
> Signed-off-by: Wei Liu <[email protected]>
> ---
>  drivers/hv/mshv_root_main.c | 96 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 96 insertions(+)
> 
[...]
> +static void __init mshv_check_sev_snp_support(struct device *dev)
> +{
> +     struct hv_input_get_system_property *input;
> +     struct hv_output_get_system_property *output;
> +     unsigned long flags;
> +     enum hv_snp_status snp_status;
> +     u64 status;
> +
> +     local_irq_save(flags);
> +     input = *this_cpu_ptr(hyperv_pcpu_input_arg);
> +     output = *this_cpu_ptr(hyperv_pcpu_output_arg);
> +
> +     memset(input, 0, sizeof(*input));
> +     input->property_id = HV_DYNAMIC_PROCESSOR_FEATURE_PROPERTY;
> +     input->hv_processor_feature = 
> HV_X64_DYNAMIC_PROCESSOR_FEATURE_SNP_STATUS;
> +
> +     status = hv_do_hypercall(HVCALL_GET_SYSTEM_PROPERTY, input, output);
> +     local_irq_restore(flags);
> +     if (!hv_result_success(status)) {
> +             dev_warn(dev, "Failed to get SNP support: %s\n",
> +                      hv_result_to_string(status));
> +             return;
> +     }
> +

Our internal testing has shown that running this on an L1VH partition
gets an error.

The error should be non-fatal. Please squash my internal patch to this
in the next revision.

Wei

Reply via email to