All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: "Pratik R. Sampat" <prsampat@amd.com>,
	kameroncarr@linux.microsoft.com, decui@microsoft.com,
	ltykernel@gmail.com
Cc: x86@kernel.org, kvm@vger.kernel.org,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, haiyangz@microsoft.com,
	wei.liu@kernel.org, seanjc@google.com, pbonzini@redhat.com,
	thomas.lendacky@amd.com, kim.phillips@amd.com, nikunj@amd.com,
	michael.roth@amd.com, ashish.kalra@amd.com
Subject: Re: [Patch v5 3/3] x86/hyperv: Add guest support for Enhanced SMT Protection
Date: Mon, 30 Nov 2026 13:43:12 -0800	[thread overview]
Message-ID: <20261130214312.GD5355@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <c03379e62765c3408889baef5f582abc8bc19916.1794935627.git.prsampat@amd.com>

Dexuan, Tianyu and Kameron please take a look.

On Tue, Nov 17, 2026 at 05:57:00PM +0000, Pratik R. Sampat wrote:
> Add corresponding hyperv support for Enhanced SMT protection. A fully
> enlightened SEV-SNP guest on Hyper-V builds the VMSA itself when
> bringing up an AP, so populate both fields there, before the page is
> turned into a VMSA and while it is still writable.
> 
> Similar to KVM, fully set the sibling mask so that all threads of the
> same guest trust each other.
> 
> Signed-off-by: Pratik R. Sampat <prsampat@amd.com>
> ---
> v4..v5:
> * Remove comment about vCPU sibling mask configuration - Boris
> 
> v3..v4: No change
> ---
>  arch/x86/hyperv/ivm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c
> index 2ce4dfe53472..bd57cac18181 100644
> --- a/arch/x86/hyperv/ivm.c
> +++ b/arch/x86/hyperv/ivm.c
> @@ -347,6 +347,11 @@ int hv_snp_boot_ap(u32 apic_id, unsigned long start_ip, unsigned int cpu)
>  	vmsa->vmpl = 0;
>  	vmsa->sev_features = sev_status >> 2;
>  
> +	if (sev_status & MSR_AMD64_SNP_ESMT_PROT) {
> +		vmsa->vcpu_id = apic_id;
> +		vmsa->vcpu_sibling_mask = U32_MAX;
> +	}
> +
>  	ret = snp_set_vmsa(vmsa, true);
>  	if (ret) {
>  		pr_err("RMPADJUST(%llx) failed: %llx\n", (u64)vmsa, ret);
> -- 
> 2.43.0
> 
> 

      reply	other threads:[~2026-11-30 21:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 17:56 [Patch v5 0/3] Guest support for Enhanced SMT Protection Pratik R. Sampat
2026-11-17 17:56 ` [Patch v5 1/3] x86/sev: Add Enhanced SMT Protection fields to the VMSA Pratik R. Sampat
2026-11-17 17:56 ` [Patch v5 2/3] x86/sev: Add guest support for Enhanced SMT Protection Pratik R. Sampat
2026-11-17 17:57 ` [Patch v5 3/3] x86/hyperv: " Pratik R. Sampat
2026-11-30 21:43   ` Wei Liu [this message]

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=20261130214312.GD5355@liuwe-devbox-debian-v2.local \
    --to=wei.liu@kernel.org \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kameroncarr@linux.microsoft.com \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltykernel@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=prsampat@amd.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.