Re: [Patch v4 3/4] x86/sev: Add guest support for Enhanced SMT Protection

From: Pratik R. Sampat

Date: Fri Nov 13 2026 - 16:22:38 EST


Hi Boris and Sean,

On 11/13/26 11:46 AM, Sean Christopherson wrote:
> On Thu, Nov 12, 2026, Borislav Petkov wrote:
>> On Mon, Nov 09, 2026 at 08:35:13PM +0000, Pratik R. Sampat wrote:
>>> @@ -849,6 +850,18 @@ static int wakeup_cpu_via_vmgexit(u32 apic_id, unsigned long start_ip, unsigned
>>> vmsa->vmpl = snp_vmpl;
>>> vmsa->sev_features = sev_status >> 2;
>>>
>>> + if (sev_status & MSR_AMD64_SEV_SNP_ENABLED &&
>>> + (sev_status & MSR_AMD64_SNP_ESMT_PROT)) {
>>> + vmsa->vcpu_id = apic_id;
>>> + /*
>>> + * The mask fully set puts every vCPU in one group, so any two
>>> + * of them may be co-resident. A legal ESMTP sibling must
>>> + * also match on ASID, so the sibling of a vCPU in guest mode is
>>> + * always either another vCPU of this same guest or idle.
>>> + */
>>
>> This comment doesn't belong here.
>>

Ack, will get rid of it.

>> In any case, this set touches multiple trees so I'm open to suggestions from
>> KVM folks how we should do the patch merging tetris eventually.
>
> Post and merge the guest patches separately, and put any architectural collateral
> need for the guest code in those patches. This is not high on my todo list, i.e.
> the KVM patches can come later.

Sure this makes sense. In that case I'm thinking of splitting the patches by
flipping the order as follows:

Series 1
1. x86/sev: Add Enhanced SMT Protection fields to the VMSA (new) Moves the
vcpu_id and vcpu_sibling_mask VMSA definitions out of the KVM patch so the
guest side builds on its own.
2. Current guest support patch - no change, minus the comment
3. Hyper-V guest support patch - no change, may need the blessing from Hyper-V
folks to merge

Series 2 - to kvm later
1. KVM: SVM: Re-queue events that were never injected (unchanged)
2. KVM: SVM: Add host support for Enhanced SMT Protection - Unchanged apart
from dropping the VMSA definitions now in series 1

Boris, series 2 still carries the X86_FEATURE_AMD_ESMTP/scattered.c entry and
MSR_AMD64_IDLE_WAKEUP_ICR, which only KVM uses. I'll keep your ack on those so
they can go through the KVM tree.

Thanks,
--Pratik