Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904035 - [EXPERIMENTAL] sys-kernel/gentoo-sources & sys-kernel/vanilla-sources => Patchset for automatic IBRS backported from Linux 6.3 to Linux 6.2(.10)
Summary: [EXPERIMENTAL] sys-kernel/gentoo-sources & sys-kernel/vanilla-sources => Patc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal enhancement (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-08 14:50 UTC by Adrien Dessemond
Modified: 2023-07-02 17:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patchset for automatic IBRS retrofitted for Linux 6.2.10 (auto_ibrs_6.2.10.patch,18.28 KB, patch)
2023-04-08 14:54 UTC, Adrien Dessemond
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrien Dessemond 2023-04-08 14:50:44 UTC
Kernel 6.3 brings the support of auto-IBRS (AMD Zen 4 processors). However I am stuck with kernel 6.2 series due to a WIP in OpenZFS 2.1.x to support the 6.3 kernel series which, I guess, will take awhile as internal kernel's API has changed in-between.

In the meantime, I managed to retrofit this => https://lore.kernel.org/lkml/20230124163319.2277355-1-kim.phillips@amd.com for sys-kernel/gentoo-sources:6.2.10 (AFAK their v9 is the more recent work in the subject at time of writing).

Various pieces are spread amongst the discussion nevertheless I am confident that all pieces have been put together.

So far the 6.2(.10) kernel can be built and boots normally without any issues :)

And... 


# dmesg  | grep Spectre
[    0.228161] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.228163] Spectre V2 : Mitigation: Enhanced / Automatic IBRS
[    0.228164] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.228166] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier

Not tested stability with KVM virtual machines so far but feel free to experiment ;)
Comment 1 Adrien Dessemond 2023-04-08 14:54:57 UTC
Created attachment 859690 [details, diff]
Patchset for automatic IBRS retrofitted for Linux 6.2.10

See bug description. The work is based on a Linux 6.2.10 kernel, not sure it will be applicable as-is for future Linux 6.2.x releases.
Comment 2 Adrien Dessemond 2023-04-09 13:34:49 UTC
Can also be applied over a 6.2.6 to 6.2.9 kernel as well according to my tests and probably all earlier 6.2 series kernels (untested).

Does not work with 6.1 and earlier kernel series.
Comment 3 Mike Pagano gentoo-dev 2023-04-11 15:25:48 UTC
(In reply to Adrien Dessemond from comment #2)
> Can also be applied over a 6.2.6 to 6.2.9 kernel as well according to my
> tests and probably all earlier 6.2 series kernels (untested).
> 
> Does not work with 6.1 and earlier kernel series.

Thank-you for your contribution.  There's still a lot of conversation on this with debate on how to do things.

I'd like to wait a bit before we carry this one.
Comment 4 Mike Pagano gentoo-dev 2023-07-02 17:26:45 UTC
IBRS came with 6.3 and 6.2 is EOL.  Closing this one.