From: Sean Christopherson <seanjc@google.com>
To: Daniil Tatianin <d-tatianin@yandex-team.ru>
Cc: stable@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tom Lendacky <thomas.lendacky@amd.com>,
Sasha Levin <sashal@kernel.org>,
"Xin Li (Intel)" <xin@zytor.com>,
Daniel Sneddon <daniel.sneddon@linux.intel.com>,
"Ahmed S. Darwish" <darwi@linutronix.de>,
Nikunj A Dadhania <nikunj@amd.com>,
Michael Larabel <Michael@michaellarabel.com>
Subject: Re: [PATCH 6.6.y v1 6/6] KVM: SVM: Set/clear SRSO's BP_SPEC_REDUCE on 0 <=> 1 VM count transitions
Date: Thu, 30 Apr 2026 10:47:52 -0700 [thread overview]
Message-ID: <afOVyJFV6zy9Jcbz@google.com> (raw)
In-Reply-To: <20260428214610.2138600-7-d-tatianin@yandex-team.ru>
On Wed, Apr 29, 2026, Daniil Tatianin wrote:
> [ Upstream commit e3417ab75ab2e7dca6372a1bfa26b1be3ac5889e ]
>
> Set the magic BP_SPEC_REDUCE bit to mitigate SRSO when running VMs if and
> only if KVM has at least one active VM. Leaving the bit set at all times
> unfortunately degrades performance by a wee bit more than expected.
>
> Use a dedicated spinlock and counter instead of hooking virtualization
> enablement, as changing the behavior of kvm.enable_virt_at_load based on
> SRSO_BP_SPEC_REDUCE is painful, and has its own drawbacks, e.g. could
> result in performance issues for flows that are sensitive to VM creation
> latency.
>
> Defer setting BP_SPEC_REDUCE until VMRUN is imminent to avoid impacting
> performance on CPUs that aren't running VMs, e.g. if a setup is using
> housekeeping CPUs. Setting BP_SPEC_REDUCE in task context, i.e. without
> blasting IPIs to all CPUs, also helps avoid serializing 1<=>N transitions
> without incurring a gross amount of complexity (see the Link for details
> on how ugly coordinating via IPIs gets).
>
> Link: https://lore.kernel.org/all/aBOnzNCngyS_pQIW@google.com
> Fixes: 8442df2b49ed ("x86/bugs: KVM: Add support for SRSO_MSR_FIX")
> Reported-by: Michael Larabel <Michael@michaellarabel.com>
> Closes: https://www.phoronix.com/review/linux-615-amd-regression
> Cc: Borislav Petkov <bp@alien8.de>
> Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
> Link: https://lore.kernel.org/r/20250505180300.973137-1-seanjc@google.com
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
> ---
Acked-by: Sean Christopherson <seanjc@google.com>
next prev parent reply other threads:[~2026-04-30 17:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 21:46 [PATCH 6.6.y v1 0/6] SRSO handling for Zen5 CPUs Daniil Tatianin
2026-04-28 21:46 ` [PATCH 6.6.y v1 1/6] x86/bugs: Add SRSO_USER_KERNEL_NO support Daniil Tatianin
2026-04-28 21:46 ` [PATCH 6.6.y v1 2/6] x86/srso: Print actual mitigation if requested mitigation isn't possible Daniil Tatianin
2026-04-28 21:46 ` [PATCH 6.6.y v1 3/6] x86/srso: Remove 'pred_cmd' label Daniil Tatianin
2026-04-28 21:46 ` [PATCH 6.6.y v1 4/6] x86/bugs: Fix handling when SRSO mitigation is disabled Daniil Tatianin
2026-04-28 21:46 ` [PATCH 6.6.y v1 5/6] x86/bugs: KVM: Add support for SRSO_MSR_FIX Daniil Tatianin
2026-04-30 17:47 ` Sean Christopherson
2026-04-28 21:46 ` [PATCH 6.6.y v1 6/6] KVM: SVM: Set/clear SRSO's BP_SPEC_REDUCE on 0 <=> 1 VM count transitions Daniil Tatianin
2026-04-30 17:47 ` Sean Christopherson [this message]
2026-04-29 17:50 ` [PATCH 6.6.y v1 0/6] SRSO handling for Zen5 CPUs Sasha Levin
2026-04-30 17:49 ` Sean Christopherson
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=afOVyJFV6zy9Jcbz@google.com \
--to=seanjc@google.com \
--cc=Michael@michaellarabel.com \
--cc=bp@alien8.de \
--cc=d-tatianin@yandex-team.ru \
--cc=daniel.sneddon@linux.intel.com \
--cc=darwi@linutronix.de \
--cc=dave.hansen@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jpoimboe@kernel.org \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=xin@zytor.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