From: Wei Liu <wei.liu@kernel.org>
To: Wei Hu <weh@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Long Li <longli@microsoft.com>
Subject: Re: [PATCH v2 06/13] mshv: detect and report SEV-SNP support at init
Date: Mon, 10 Aug 2026 11:53:33 -0700 [thread overview]
Message-ID: <20260810185333.GB2496954@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <20260810124527.1409634-7-weh@linux.microsoft.com>
On Mon, Aug 10, 2026 at 12:45:00PM +0000, Wei Hu wrote:
> From: Wei Liu <wei.liu@kernel.org>
>
> 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 <wei.liu@kernel.org>
> ---
> 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
next prev parent reply other threads:[~2026-08-10 18:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 12:44 [PATCH v2 00/13] mshv: add SEV-SNP support for MSHV root partitions Wei Hu
2026-08-10 12:44 ` [PATCH v2 01/13] mshv: add SEV-SNP UAPI definitions Wei Hu
2026-08-10 12:59 ` sashiko-bot
2026-08-10 12:44 ` [PATCH v2 02/13] mshv: add SEV-SNP PSP request hypercall Wei Hu
2026-08-10 12:44 ` [PATCH v2 03/13] mshv: add SEV-SNP isolated page hypercalls Wei Hu
2026-08-10 12:58 ` sashiko-bot
2026-08-10 12:44 ` [PATCH v2 04/13] mshv: wire SEV-SNP partition ioctls Wei Hu
2026-08-10 13:07 ` sashiko-bot
2026-08-10 12:44 ` [PATCH v2 05/13] hyperv: fix hv_input_get_system_property layout for SNP status Wei Hu
2026-08-10 18:59 ` Wei Liu
2026-08-10 12:45 ` [PATCH v2 06/13] mshv: detect and report SEV-SNP support at init Wei Hu
2026-08-10 12:55 ` sashiko-bot
2026-08-10 18:53 ` Wei Liu [this message]
2026-08-10 12:45 ` [PATCH v2 07/13] mshv: default to safe partition CPU features Wei Hu
2026-08-10 12:57 ` sashiko-bot
2026-08-10 12:45 ` [PATCH v2 08/13] mshv: accept partial CPU feature banks Wei Hu
2026-08-10 12:45 ` [PATCH v2 09/13] mshv: define full processor and xsave feature masks Wei Hu
2026-08-10 12:45 ` [PATCH v2 10/13] mshv: unmap SNP memory before state teardown Wei Hu
2026-08-10 13:13 ` sashiko-bot
2026-08-10 12:45 ` [PATCH v2 11/13] mshv: unlock SNP pages on panic for crashdump collection Wei Hu
2026-08-10 13:10 ` sashiko-bot
2026-08-10 12:45 ` [PATCH v2 12/13] hyperv: add MSHV Dom0 root-partition boot enablement (EFI HvLoader) Wei Hu
2026-08-10 13:05 ` sashiko-bot
2026-08-10 18:50 ` Wei Liu
2026-08-10 12:45 ` [PATCH v2 13/13] mshv: set up own SynIC registers on a nested root partition Wei Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260810185333.GB2496954@liuwe-devbox-debian-v2.local \
--to=wei.liu@kernel.org \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=weh@linux.microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox