]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/sgx: Include memory clobber for inline asm in test enclave
authorJo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Thu, 5 Oct 2023 15:38:44 +0000 (17:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:27:46 +0000 (15:27 -0800)
commitbf92b8210198f22940a5a9fc1ff0103658b79dbb
tree7f2a18c81c1c1e29ceb539dd56f74fdfa247b224
parent2cfae256a13095ed3fe78d7ec4e91ce5cf9d5536
selftests/sgx: Include memory clobber for inline asm in test enclave

[ Upstream commit 853a57a43ebdb8c024160c1a0990bae85f4bcc2f ]

Add the "memory" clobber to the EMODPE and EACCEPT asm blocks to tell the
compiler the assembly code accesses to the secinfo struct. This ensures
the compiler treats the asm block as a memory barrier and the write to
secinfo will be visible to ENCLU.

Fixes: 20404a808593 ("selftests/sgx: Add test for EPCM permission changes")
Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/all/20231005153854.25566-4-jo.vanbulck%40cs.kuleuven.be
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/sgx/test_encl.c