From 80a7dda419e7afccef01c9c82e5bd9560069ce91 Mon Sep 17 00:00:00 2001 From: Rusty Lynch Date: Thu, 29 Mar 2018 14:02:45 -0700 Subject: [PATCH] Fix compile error caused by missing memcpy function On some toolchain configurations direct struct assignments will default to a memcpy operation which is not present in this environment, so explicitly use the internal memcpy_s function. Signed-of-by: Rusty Lynch --- hypervisor/arch/x86/trusty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/arch/x86/trusty.c b/hypervisor/arch/x86/trusty.c index 85a2b1339..05f70cb45 100644 --- a/hypervisor/arch/x86/trusty.c +++ b/hypervisor/arch/x86/trusty.c @@ -34,6 +34,7 @@ #include #include #include +#include "rtl.h" _Static_assert(NR_WORLD == 2, "Only 2 Worlds supported!"); @@ -294,7 +295,8 @@ static bool setup_trusty_info(struct vcpu *vcpu, /* TODO: prepare vkey_info */ /* copy key_info to the first page of trusty memory */ - mem->first_page.key_info = g_key_info; + memcpy_s(&mem->first_page.key_info, sizeof(g_key_info), + &g_key_info, sizeof(g_key_info)); memset(mem->first_page.key_info.dseed_list, 0, sizeof(mem->first_page.key_info.dseed_list));