Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 645028 - sys-devel/gcc - backport retpoline patches
Summary: sys-devel/gcc - backport retpoline patches
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: ftp://gcc.gnu.org/pub/gcc/snapshots/7...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 14:27 UTC by Ulenrich
Modified: 2018-02-08 19:52 UTC (History)
9 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulenrich 2018-01-19 14:27:10 UTC
sys-devel/gcc-7.3.0-RC-20180117 
is needed for retpoline to handle spectre_v2

but I cannot find any overlay showing such an ebuild 
searching at http://gpo.zugaina.org/sys-devel/gcc

My kernel linx-4.14.14 shows
---
/sys/devices/system/cpu/vulnerabilities # grep n *
meltdown:Mitigation: PTI
spectre_v1:Vulnerable
spectre_v2:Vulnerable: Minimal generic ASM retpoline
---
Comment 1 Ulenrich 2018-01-19 16:42:18 UTC
I cannot find any explicit mention about "retpoline"
 in source gcc-7.3.0-RC-20180118  
gcc/ChangLog

But there are some two handful change entries of developer
2018-01-16  H.J. Lu  <hongjiu.lu@intel.com>

When investigating the commitdiffs of that same intel developer at

http://git.infradead.org/users/dwmw2/gcc-retpoline.git/shortlog/refs/heads/gcc-7_2_0-retpoline-20171219
(this git.infradead.org I found in a gcc mailing list discussion about retpoline)
dated from 2017-12-18

There I can see changes, which most of them had been applied to the gcc RC source (I looked for files and found changes applied such as:
-  frame = cfun->machine->frame;
+  struct ix86_frame &frame = cfun->machine->frame;
)

Hopefully there is no need of Gentoo special backporting, as Jeroen seems to think, but a simple bump to gcc-7.3.0 in a week or a little longer ahead
Comment 2 Ulenrich 2018-01-23 21:06:00 UTC
gcc-7.3 successfully saves me from half of spectre, this is how: 

I got an gcc-7.3.0-rc ebuild from tamiko overlay
I simple bumped to fresh it 5 days:
sys-devel/gcc-7.3.0_rc20180122
compiled well, but without any Gentoo pie patches 
(I guess my new gcc-7.3 should therefore not be used to compile ebuilds)

Then updated my vanilla kernel to linux-4.14.15
Then eselected x86_64-pc-linux-gnu-7.3.0-rc20180122

No having full generic retpoline:
---
# grep n /sys/devices/system/cpu/vulnerabilities/*
/sys/devices/system/cpu/vulnerabilities/meltdown:Mitigation: PTI
/sys/devices/system/cpu/vulnerabilities/spectre_v1:Vulnerable
/sys/devices/system/cpu/vulnerabilities/spectre_v2:Mitigation: Full generic retpoline
Comment 3 Ulenrich 2018-01-23 21:08:25 UTC
Wanted to say: NOW 
(after compiling and rebooting linux-4.14.15)
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2018-02-08 19:52:20 UTC
Don't think gentoo backported anything.