[regression/bisected] Add IBPB decreases performance in two times

From: Mikhail Gavrilov
Date: Sat Aug 12 2023 - 18:55:37 EST


Hi,
I use Fedora Rawhide and noted that between commits 14f9643dc90a and
13b937206866 the gaming performance of my computer decreased in two
times.
I start bisecting and bisect blame this commit
138bcddb86d8a4f842e4ed6f0585abc9b1a764ff.

commit 233d6f68b98d480a7c42ebe78c38f79d44741ca9
Author: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Date: Thu Jul 6 15:04:35 2023 +0200

x86/srso: Add IBPB

Add the option to mitigate using IBPB on a kernel entry. Pull in the
Retbleed alternative so that the IBPB call from there can be used. Also,
if Retbleed mitigation is done using IBPB, the same mitigation can and
must be used here.

Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>

arch/x86/include/asm/nospec-branch.h | 2 +-
arch/x86/kernel/cpu/bugs.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)

I understand the concern about security but having 60FPS instead of
120FPS is not that I expected.
Unfortunately I couldn't just revert commit
233d6f68b98d480a7c42ebe78c38f79d44741ca9 because of conflicts.
But reverting all these commits:
❯ git revert 43972cf2deb2f54a97530c82b88c555fd682428e -n -m 1
❯ git revert 272b86ba9d97518b3c14b97514b6544eef87e7a5 -n -m 1
Auto-merging arch/x86/include/asm/processor.h
❯ git revert 77245f1c3c6495521f6a3af082696ee2f8ce3921 -n
Auto-merging arch/x86/include/asm/processor.h
❯ git revert 64094e7e3118aff4b0be8ff713c242303e139834 -n -m 1
❯ git revert 138bcddb86d8a4f842e4ed6f0585abc9b1a764ff -n -m 1
Auto-merging arch/x86/include/asm/processor.h
restore PC initial performance

My specs:
CPU: Ryzen 7950X
GPU: Radeon 7900XTX

Maybe it is possible to find another approach for solving security
issue without slowing down?
If not, then provide an option to turn off this slowdown.

I attached my build kernel config in the archive below.

--
Best Regards,
Mike Gavrilov.

Attachment: .config.zip
Description: Zip archive