mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 16:38:12 +00:00
2adcba79e6
Add a selftest for SGX. It is a trivial test where a simple enclave copies one 64-bit word of memory between two memory locations, but ensures that all SGX hardware and software infrastructure is functioning. Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Jethro Beekman <jethro@fortanix.com> Cc: linux-kselftest@vger.kernel.org Link: https://lkml.kernel.org/r/20201112220135.165028-21-jarkko@kernel.org
20 lines
345 B
C
20 lines
345 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright(c) 2016-20 Intel Corporation. */
|
|
|
|
#include <stddef.h>
|
|
#include "defines.h"
|
|
|
|
static void *memcpy(void *dest, const void *src, size_t n)
|
|
{
|
|
size_t i;
|
|
|
|
for (i = 0; i < n; i++)
|
|
((char *)dest)[i] = ((char *)src)[i];
|
|
|
|
return dest;
|
|
}
|
|
|
|
void encl_body(void *rdi, void *rsi)
|
|
{
|
|
memcpy(rsi, rdi, 8);
|
|
}
|