Commit dc1b46e0 authored by Tony Luck's avatar Tony Luck Committed by Zhiquan Li
Browse files

x86/sgx: Initial poison handling for dirty and free pages

mainline inclusion
from mainline-5.17
commit 992801ae
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I5EZFM


CVE: NA

Intel-SIG: commit 992801ae x86/sgx: Initial poison handling for
dirty and free pages.
Backport for SGX MCA recovery co-existence support

--------------------------------

A memory controller patrol scrubber can report poison in a page
that isn't currently being used.

Add "poison" field in the sgx_epc_page that can be set for an
sgx_epc_page. Check for it:
1) When sanitizing dirty pages
2) When freeing epc pages

Poison is a new field separated from flags to avoid having to make all
updates to flags atomic, or integrate poison state changes into some
other locking scheme to protect flags (Currently just sgx_reclaimer_lock
which protects the SGX_EPC_PAGE_RECLAIMER_TRACKED bit in page->flags).

In both cases place the poisoned page on a per-node list of poisoned
epc pages to make sure it will not be reallocated.

Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Tested-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Link: https://lkml.kernel.org/r/20211026220050.697075-4-tony.luck@intel.com


Signed-off-by: default avatarZhiquan Li <zhiquan1.li@intel.com>
parent e87c3256
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment