From: Kim Phillips <kim.phillips@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: <linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<linux-coco@lists.linux.dev>, <x86@kernel.org>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Nikunj A Dadhania <nikunj@amd.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Michael Roth <michael.roth@amd.com>,
Naveen Rao <naveen.rao@amd.com>,
David Kaplan <david.kaplan@amd.com>, <stable@kernel.org>
Subject: Re: [PATCH 1/2] KVM: SEV: IBPB-on-Entry guest support
Date: Wed, 28 Jan 2026 18:38:29 -0600 [thread overview]
Message-ID: <e7acf7ed-103b-46aa-a1f6-35bb6292d30f@amd.com> (raw)
In-Reply-To: <20260128192312.GQaXpiIL4YFmQB2LKL@fat_crate.local>
Hi Boris,
On 1/28/26 1:23 PM, Borislav Petkov wrote:
> On Mon, Jan 26, 2026 at 04:42:04PM -0600, Kim Phillips wrote:
>> The SEV-SNP IBPB-on-Entry feature does not require a guest-side
>> implementation. The feature was added in Zen5 h/w, after the first
>> SNP Zen implementation, and thus was not accounted for when the
>> initial set of SNP features were added to the kernel.
>>
>> In its abundant precaution, commit 8c29f0165405 ("x86/sev: Add SEV-SNP
>> guest feature negotiation support") included SEV_STATUS' IBPB-on-Entry
>> bit as a reserved bit, thereby masking guests from using the feature.
>>
>> Unmask the bit, to allow guests to take advantage of the feature on
>> hypervisor kernel versions that support it: Amend the SEV_STATUS MSR
>> SNP_RESERVED_MASK to exclude bit 23 (IbpbOnEntry).
> Do not explain what the patch does.
For that last paragraph, how about:
"Allow guests to make use of IBPB-on-Entry when supported by the
hypervisor, as the bit is now architecturally defined and safe to
expose."
?
>> Fixes: 8c29f0165405 ("x86/sev: Add SEV-SNP guest feature negotiation support")
>> Cc: Nikunj A Dadhania <nikunj@amd.com>
>> Cc: Tom Lendacky <thomas.lendacky@amd.com>
>> CC: Borislav Petkov (AMD) <bp@alien8.de>
>> CC: Michael Roth <michael.roth@amd.com>
>> Cc: stable@kernel.org
> I guess...
Hopefully a bitfield will be carved out for these
no-explicit-guest-implementation-required bits by hardware such that we
won't need to do this again.
>> diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
>> index 4d3566bb1a93..9016a6b00bc7 100644
>> --- a/arch/x86/include/asm/msr-index.h
>> +++ b/arch/x86/include/asm/msr-index.h
>> @@ -735,7 +735,10 @@
>> #define MSR_AMD64_SNP_SMT_PROT BIT_ULL(MSR_AMD64_SNP_SMT_PROT_BIT)
>> #define MSR_AMD64_SNP_SECURE_AVIC_BIT 18
>> #define MSR_AMD64_SNP_SECURE_AVIC BIT_ULL(MSR_AMD64_SNP_SECURE_AVIC_BIT)
>> -#define MSR_AMD64_SNP_RESV_BIT 19
>> +#define MSR_AMD64_SNP_RESERVED_BITS19_22 GENMASK_ULL(22, 19)
>> +#define MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT 23
>> +#define MSR_AMD64_SNP_IBPB_ON_ENTRY BIT_ULL(MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT)
> Why isn't this part of SNP_FEATURES_PRESENT?
>
> If this feature doesn't require guest-side support, then it is trivially
> present, no?
SNP_FEATURES_PRESENT is for the non-trivial variety: Its bits get set as
part of the patchseries that add the explicit guest support *code*.
I believe 'features' like PREVENT_HOST_IBS are similar in this regard.
>> +#define MSR_AMD64_SNP_RESV_BIT 24
>> #define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
>> #define MSR_AMD64_SAVIC_CONTROL 0xc0010138
>> #define MSR_AMD64_SAVIC_EN_BIT 0
>> --
> I guess this is a fix of sorts and I could take it in now once all review
> comments have been addressed...
Cool, thanks.
Kim
next prev parent reply other threads:[~2026-01-29 0:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 22:42 [PATCH 0/2] KVM: SEV: Add support for IBPB-on-Entry Kim Phillips
2026-01-26 22:42 ` [PATCH 1/2] KVM: SEV: IBPB-on-Entry guest support Kim Phillips
2026-01-27 6:19 ` Nikunj A. Dadhania
2026-01-28 19:02 ` Tom Lendacky
2026-01-28 19:23 ` Borislav Petkov
2026-01-29 0:38 ` Kim Phillips [this message]
2026-01-29 10:51 ` Borislav Petkov
2026-01-29 22:32 ` Kim Phillips
2026-01-30 12:32 ` Borislav Petkov
2026-01-30 14:56 ` Tom Lendacky
2026-01-30 15:45 ` Borislav Petkov
2026-02-02 15:38 ` Tom Lendacky
2026-02-02 15:49 ` Borislav Petkov
2026-02-02 16:09 ` Tom Lendacky
2026-02-02 17:12 ` Borislav Petkov
2026-01-26 22:42 ` [PATCH 2/2] KVM: SEV: Add support for IBPB-on-Entry Kim Phillips
2026-01-27 6:38 ` Nikunj A. Dadhania
2026-01-27 20:56 ` Kim Phillips
2026-01-28 19:08 ` Tom Lendacky
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=e7acf7ed-103b-46aa-a1f6-35bb6292d30f@amd.com \
--to=kim.phillips@amd.com \
--cc=bp@alien8.de \
--cc=david.kaplan@amd.com \
--cc=kprateek.nayak@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=naveen.rao@amd.com \
--cc=nikunj@amd.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox