aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdns3-pci-wrap.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko@kernel.org>2022-03-04 00:38:58 +0200
committerDave Hansen <dave.hansen@linux.intel.com>2022-03-11 10:31:06 -0800
commit08999b2489b4c9b939d7483dbd03702ee4576d96 (patch)
tree1caeaa66ccb59a313116799eabcecf628cd602e9 /drivers/usb/cdns3/cdns3-pci-wrap.c
parentx86/traps: Mark do_int3() NOKPROBE_SYMBOL (diff)
downloadlinux-08999b2489b4c9b939d7483dbd03702ee4576d96.tar.gz
linux-08999b2489b4c9b939d7483dbd03702ee4576d96.zip
x86/sgx: Free backing memory after faulting the enclave page
There is a limited amount of SGX memory (EPC) on each system. When that memory is used up, SGX has its own swapping mechanism which is similar in concept but totally separate from the core mm/* code. Instead of swapping to disk, SGX swaps from EPC to normal RAM. That normal RAM comes from a shared memory pseudo-file and can itself be swapped by the core mm code. There is a hierarchy like this: EPC <-> shmem <-> disk After data is swapped back in from shmem to EPC, the shmem backing storage needs to be freed. Currently, the backing shmem is not freed. This effectively wastes the shmem while the enclave is running. The memory is recovered when the enclave is destroyed and the backing storage freed. Sort this out by freeing memory with shmem_truncate_range(), as soon as a page is faulted back to the EPC. In addition, free the memory for PCMD pages as soon as all PCMD's in a page have been marked as unused by zeroing its contents. Cc: stable@vger.kernel.org Fixes: 1728ab54b4be ("x86/sgx: Add a page reclaimer") Reported-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://lkml.kernel.org/r/20220303223859.273187-1-jarkko@kernel.org
Diffstat (limited to 'drivers/usb/cdns3/cdns3-pci-wrap.c')
0 files changed, 0 insertions, 0 deletions
trum_acl_flex_keys.c?id=dcdf01028efa4c72d442f029e9bde449d7e7bc4a&follow=1'>mlxsw: spectrum: Introduce flex key blocks for Spectrum-2Jiri Pirko2-0/+111 2018-07-19mlxsw: spectrum: Add Spectrum-2 variant of flex actions opsJiri Pirko2-0/+13 2018-07-19mlxsw: spectrum_mr_tcam: Add Spectrum-2 stubsJiri Pirko3-1/+86 2018-07-19mlxsw: spectrum: Add KVDL manager implementation for Spectrum-2Jiri Pirko3-1/+307 2018-07-19mlxsw: reg: Add Infrastructure Entry Delete RegisterJiri Pirko1-0/+62 2018-07-18net/rds: Remove unnecessary variableHåkon Bugge1-2/+1 2018-07-18net/rds: void function cannot return -1Håkon Bugge1-2/+0 2018-07-18dsa: rtl8366: Remove unused variable.David S. Miller1-1/+0 2018-07-18ravb: fix byte order for TX descriptor tag field lower bitsNiklas Söderlund1-1/+1 2018-07-18ravb: fix warning about memcpy lengthNiklas Söderlund1-1/+1 2018-07-18ravb: fix shadowing of symbol 'stats' in ravb_get_ethtool_stats()Niklas Söderlund1-1/+1 2018-07-18ARM: dts: Add ethernet and switch to D-Link DIR-685Linus Walleij1-1/+139 2018-07-18net: dsa: realtek-smi: Add Realtek SMI driverLinus Walleij7-0/+2591