diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2024-11-04 12:38:02 +0200 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2024-11-07 10:27:38 -0800 |
commit | f65aa0ad79fca4ace921da0701644f020129043d (patch) | |
tree | f8e8b644a60ae51926a2c85b76f8a4f013d8d1cc /tools/perf/scripts/python/parallel-perf.py | |
parent | b064043d9565786b385f85e6436ca5716bbd5552 (diff) | |
download | linux-stable-f65aa0ad79fca4ace921da0701644f020129043d.tar.gz linux-stable-f65aa0ad79fca4ace921da0701644f020129043d.tar.bz2 linux-stable-f65aa0ad79fca4ace921da0701644f020129043d.zip |
x86/tdx: Dynamically disable SEPT violations from causing #VEs
Memory access #VEs are hard for Linux to handle in contexts like the
entry code or NMIs. But other OSes need them for functionality.
There's a static (pre-guest-boot) way for a VMM to choose one or the
other. But VMMs don't always know which OS they are booting, so they
choose to deliver those #VEs so the "other" OSes will work. That,
unfortunately has left us in the lurch and exposed to these
hard-to-handle #VEs.
The TDX module has introduced a new feature. Even if the static
configuration is set to "send nasty #VEs", the kernel can dynamically
request that they be disabled. Once they are disabled, access to private
memory that is not in the Mapped state in the Secure-EPT (SEPT) will
result in an exit to the VMM rather than injecting a #VE.
Check if the feature is available and disable SEPT #VE if possible.
If the TD is allowed to disable/enable SEPT #VEs, the ATTR_SEPT_VE_DISABLE
attribute is no longer reliable. It reflects the initial state of the
control for the TD, but it will not be updated if someone (e.g. bootloader)
changes it before the kernel starts. Kernel must check TDCS_TD_CTLS bit to
determine if SEPT #VEs are enabled or disabled.
[ dhansen: remove 'return' at end of function ]
Fixes: 373e715e31bf ("x86/tdx: Panic on bad configs that #VE on "private" memory access")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/all/20241104103803.195705-4-kirill.shutemov%40linux.intel.com
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions