Linux: How to disable mitigations for CPU vulnerabilities

Help with projects and applications, client configuration, system software tweaks.
The pinboard for cheat sheets.
Post Reply
User avatar
biodoc
TAAT Member
Reactions:
Posts: 648
Joined: Sun Sep 15, 2019 3:22 pm
Location: Massachusetts, USA

Linux: How to disable mitigations for CPU vulnerabilities

Post by biodoc » Tue Jan 12, 2021 1:07 pm


StefanR5R
TAAT Member
Reactions:
Posts: 903
Joined: Wed Sep 25, 2019 4:32 pm

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by StefanR5R » Tue Jan 12, 2021 5:11 pm

While I never profiled its effects, I have mitigations off on all of my DC-dedicated computers.
It was a small nuisance to figure out how to set the GRUB config accordingly in Mint.
In OpenSuse, there is a dialogue for this in their central system management GUI.

User avatar
biodoc
TAAT Member
Reactions:
Posts: 648
Joined: Sun Sep 15, 2019 3:22 pm
Location: Massachusetts, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by biodoc » Wed Jan 13, 2021 6:34 am

I ran your llrDIV script on my 2P Ivy with mitigations on and off and although the trend seemed to be a slight improvement, I doubt it's statistically significant.
Mitigations on:
Image

Mitigations off:
Image

User avatar
biodoc
TAAT Member
Reactions:
Posts: 648
Joined: Sun Sep 15, 2019 3:22 pm
Location: Massachusetts, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by biodoc » Wed Jan 13, 2021 6:43 am

StefanR5R wrote:
Tue Jan 12, 2021 5:11 pm
It was a small nuisance to figure out how to set the GRUB config accordingly in Mint.


For others using Mint:

sudo nano /etc/default/grub

Before editing:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

After editing:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mitigations=off"
GRUB_CMDLINE_LINUX=""

Save the change.
sudo update-grub
reboot

crashtech
TAAT Member
Reactions:
Posts: 883
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by crashtech » Wed Jan 13, 2021 1:49 pm

I did not rtfm but I skimmed it, and didn't find how to put more than one command in that line. Some of my PCs have this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet vsyscall=emulate"

I'm not sure how to add that in, it looks like just put "mitigations=off" into the quotation marks...?

For instance:

GRUB_CMDLINE_LINUX_DEFAULT="quiet vsyscall=emulate mitigations=off"

StefanR5R
TAAT Member
Reactions:
Posts: 903
Joined: Wed Sep 25, 2019 4:32 pm

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by StefanR5R » Wed Jan 13, 2021 2:20 pm

Correct. You can enter as many kernel parameters as you need, separated by space characters, and in any order.

Added in 4 minutes 32 seconds:
biodoc wrote:
Wed Jan 13, 2021 6:34 am
I ran your llrDIV script on my 2P Ivy with mitigations on and off and although the trend seemed to be a slight improvement, I doubt it's statistically significant.
Every percent counts. ;-)

Perhaps GPGPU workloads profit more, as they involve more calls into the kernel, and device I/O.

crashtech
TAAT Member
Reactions:
Posts: 883
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by crashtech » Wed Jan 13, 2021 2:33 pm

Thanks for being patient with such elementary queries, Stefan. I don't think I can understate how valuable your advice has been over the years.
Last edited by crashtech on Wed Jan 13, 2021 3:10 pm, edited 1 time in total.

crashtech
TAAT Member
Reactions:
Posts: 883
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by crashtech » Wed Jan 13, 2021 3:04 pm

StefanR5R wrote:
Wed Jan 13, 2021 2:25 pm
Every percent counts. ;-
In drag racing they call this "stacking tenths," referring to arriving just a tenth of a second faster at the finish. One small change may not seem to make a difference, but many small changes do.

User avatar
biodoc
TAAT Member
Reactions:
Posts: 648
Joined: Sun Sep 15, 2019 3:22 pm
Location: Massachusetts, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by biodoc » Wed Jan 13, 2021 3:22 pm

I shut down the 2P Ivy beast for now. The PPD is between a 3700X and a 3900X and it draws 310 watts from the wall with turbo boost off. I'll replace it when you can actually buy hardware sometime in the future.

Skillz
Site Admin
Reactions:
Posts: 917
Joined: Sun Sep 15, 2019 3:03 pm

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by Skillz » Thu Jan 14, 2021 5:56 pm

crashtech wrote:
Wed Jan 13, 2021 3:04 pm
StefanR5R wrote:
Wed Jan 13, 2021 2:25 pm
Every percent counts. ;-
In drag racing they call this "stacking tenths," referring to arriving just a tenth of a second faster at the finish. One small change may not seem to make a difference, but many small changes do.
When in doubt, just put it on the bottle. :lol:

crashtech
TAAT Member
Reactions:
Posts: 883
Joined: Sun Sep 15, 2019 4:45 pm
Location: Idaho, USA

Re: Linux: How to disable mitigations for CPU vulnerabilities

Post by crashtech » Thu Jan 14, 2021 5:59 pm

We need nitrous for PCs!

Post Reply