首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >linux安全策略对性能的影响

linux安全策略对性能的影响

作者头像
mingjie
发布2022-05-12 10:55:29
发布2022-05-12 10:55:29
1.1K0
举报

https://unix.stackexchange.com/questions/554908/disable-spectre-and-meltdown-mitigations

A number of kernel boot parameters are available to disable or fine-tune hardware vulnerability mitigations:

  • for Spectre v1 and v2nospectre_v1 (x86, PowerPC), nospectre_v2 (x86, PowerPC, S/390, ARM64), spectre_v2_user=off (x86)
  • for SSB: spec_store_bypass_disable=off (x86, PowerPC), ssbd=force-off (ARM64)
  • for L1TFl1tf=off (x86)
  • for MDSmds=off (x86)
  • for TAAtsx_async_abort=off
  • for iTLB multihitnx_huge_pages=off
  • KPTI can be disabled with nopti (x86, PowerPC) or kpti=0 (ARM64)
  • TSX async abort: tsx_async_abort=off (x86)
  • KVM NX huge pages: kvm.nx_huge_pages=off (x86)

A meta-parameter, mitigations, was introduced in 5.2 and back-ported to 5.1.2, 5.0.16, and 4.19.43 (and perhaps others). It can be used to control all mitigations, on all architectures, as follows:

  • mitigations=off will disable all optional CPU mitigations;
  • mitigations=auto (the default setting) will mitigate all known CPU vulnerabilities, but leave SMT enabled (if it is already);
  • mitigations=auto,nosmt will mitigate all known CPU vulnerabilities and disable SMT if appropriate.

Some of these can be toggled at runtime; see the linked documentation for details.

部分参数:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx_async_abort=off 

tsx_async_abort=off:对调度影响很大,unixbench的syscall和context1两个case

mitigations=off:总开关,关了后性能会有很大提升!

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-04-25,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档