summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/arch/arm/kernel/tee_ta_manager.c26
-rw-r--r--core/arch/arm/mm/tee_mmu.c27
-rw-r--r--core/include/kernel/tee_compat.h53
-rw-r--r--core/include/kernel/tee_ta_manager.h2
-rw-r--r--core/include/mm/tee_mmu.h2
-rw-r--r--core/include/mm/tee_mmu_io.h39
-rw-r--r--core/include/tee/tee_cryp_utl.h3
-rw-r--r--core/include/tee/tee_svc.h2
-rw-r--r--core/kernel/sub.mk1
-rw-r--r--core/kernel/tee_compat.c101
-rw-r--r--core/kernel/tee_dispatch.c1
-rw-r--r--core/tee/tee_cryp_utl.c27
-rw-r--r--core/tee/tee_svc.c6
13 files changed, 0 insertions, 290 deletions
diff --git a/core/arch/arm/kernel/tee_ta_manager.c b/core/arch/arm/kernel/tee_ta_manager.c
index 30b8b0bf..857611d2 100644
--- a/core/arch/arm/kernel/tee_ta_manager.c
+++ b/core/arch/arm/kernel/tee_ta_manager.c
@@ -34,7 +34,6 @@
#include <tee_api_types.h>
#include <user_ta_header.h>
#include <util.h>
-#include <kernel/tee_compat.h>
#include <tee/tee_svc.h>
#include <tee/arch_svc.h>
#include <mm/tee_mmu.h>
@@ -396,23 +395,6 @@ static TEE_Result invoke_ta(struct tee_ta_session *sess, uint32_t cmd,
return ptas.res;
}
-/* set trace level for all installed TAs (TA generic code) */
-int tee_ta_set_trace_level(int level)
-{
- struct tee_ta_ctx *ctx;
-
- if ((level > TRACE_MAX) && (level < TRACE_MIN))
- return -1;
-
- TAILQ_FOREACH(ctx, &tee_ctxes, link) {
- if (ctx->static_ta)
- ctx->static_ta->prop_tracelevel = level;
-
- /* non-static TA should be done too */
- }
- return 0;
-}
-
/*
* tee_ta_context_find - Find TA in session list based on a UUID (input)
* Returns a pointer to the session
@@ -1678,11 +1660,3 @@ void tee_ta_dump_current(void)
dump_state(s->ctx);
}
-
-void tee_ta_dump_all(void)
-{
- struct tee_ta_ctx *ctx;
-
- TAILQ_FOREACH(ctx, &tee_ctxes, link)
- dump_state(ctx);
-}
diff --git a/core/arch/arm/mm/tee_mmu.c b/core/arch/arm/mm/tee_mmu.c
index 7fc2a2de..733f4de9 100644
--- a/core/arch/arm/mm/tee_mmu.c
+++ b/core/arch/arm/mm/tee_mmu.c
@@ -42,7 +42,6 @@
#include <trace.h>
#include <mm/core_memprot.h>
#include <mm/core_mmu.h>
-#include <mm/tee_mmu_io.h>
#include <sm/teesmc.h>
#include <kernel/tz_ssvce.h>
#include <kernel/panic.h>
@@ -700,20 +699,6 @@ TEE_Result tee_mmu_kmap_va2pa_helper(void *va, void **pa)
return tee_mmu_kmap_va2pa_attr(va, pa, NULL);
}
-bool tee_mmu_kmap_is_mapped(void *va, size_t len)
-{
- tee_vaddr_t a = (tee_vaddr_t)va;
- tee_mm_entry_t *mm = tee_mm_find(&tee_mmu_virt_kmap, a);
-
- if (mm == NULL)
- return false;
-
- if ((a + len) > (tee_mm_get_smem(mm) + tee_mm_get_bytes(mm)))
- return false;
-
- return true;
-}
-
void teecore_init_ta_ram(void)
{
vaddr_t s;
@@ -774,18 +759,6 @@ void teecore_init_pub_ram(void)
default_nsec_shm_size = e - s;
}
-void *tee_mmu_ioremap(tee_paddr_t pa __unused, size_t len __unused)
-{
- /* return (void *)ioremap((void *)pa, len); */
- return (void *)NULL;
-}
-
-void tee_mmu_iounmap(void *va __unused)
-{
- /* linux API */
- /* iounmap(va); */
-}
-
static uint32_t mattr_to_teesmc_cache_attr(uint32_t mattr)
{
uint32_t attr = 0;
diff --git a/core/include/kernel/tee_compat.h b/core/include/kernel/tee_compat.h
deleted file mode 100644
index 1ad52fb9..00000000
--- a/core/include/kernel/tee_compat.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2014, STMicroelectronics International N.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef TEE_COMPAT_H
-#define TEE_COMPAT_H
-
-#include <tee_api_types.h>
-#include <tee_api_types.h>
-#include <kernel/tee_ta_manager_unpg.h>
-
-typedef struct {
- void *buffer;
- size_t size;
- uint32_t flags;
-} TEE_SharedMemory;
-
-typedef struct {
- uint32_t param_types;
- TEE_Param params[4];
- TEE_SharedMemory memRefs[4];
- uint32_t flags;
-} TEE_Operation;
-
-TEE_Result tee_compat_param_old_to_new(TEE_Operation *op,
- struct tee_ta_param *param);
-
-TEE_Result tee_compat_param_new_to_old(const struct tee_ta_param *param,
- TEE_Operation *op);
-
-#endif /* TEE_COMPAT_H */
diff --git a/core/include/kernel/tee_ta_manager.h b/core/include/kernel/tee_ta_manager.h
index e35dd79d..9c21d918 100644
--- a/core/include/kernel/tee_ta_manager.h
+++ b/core/include/kernel/tee_ta_manager.h
@@ -78,9 +78,7 @@ struct tee_ta_session *tee_ta_get_session(uint32_t id, bool exclusive,
void tee_ta_put_session(struct tee_ta_session *sess);
-int tee_ta_set_trace_level(int level);
void tee_ta_dump_current(void);
-void tee_ta_dump_all(void);
#ifdef CFG_CACHE_API
TEE_Result tee_uta_cache_operation(struct tee_ta_session *s,
diff --git a/core/include/mm/tee_mmu.h b/core/include/mm/tee_mmu.h
index d0fd7a9d..b184630b 100644
--- a/core/include/mm/tee_mmu.h
+++ b/core/include/mm/tee_mmu.h
@@ -171,8 +171,6 @@ TEE_Result tee_mmu_kmap_va2pa_helper(void *va, void **pa);
#define tee_mmu_kmap_va2pa(pa, va) tee_mmu_kmap_va2pa_helper((pa), (va))
#endif
-bool tee_mmu_kmap_is_mapped(void *va, size_t len);
-
uint32_t tee_mmu_kmap_get_cache_attr(void *va);
uint32_t tee_mmu_user_get_cache_attr(struct tee_ta_ctx *ctx, void *va);
diff --git a/core/include/mm/tee_mmu_io.h b/core/include/mm/tee_mmu_io.h
deleted file mode 100644
index 978d11c2..00000000
--- a/core/include/mm/tee_mmu_io.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014, STMicroelectronics International N.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef TEE_MMU_MAP_H
-#define TEE_MMU_MAP_H
-
-#include <tee_api_types.h>
-
-/* Maps physical address into kernel space */
-void *tee_mmu_ioremap(uintptr_t pa, size_t len);
-/*
- * Unmaps a memory mapping previously established with tee_mmu_ioremap().
- */
-void tee_mmu_iounmap(void *va);
-
-#endif
diff --git a/core/include/tee/tee_cryp_utl.h b/core/include/tee/tee_cryp_utl.h
index 70355335..068fda5b 100644
--- a/core/include/tee/tee_cryp_utl.h
+++ b/core/include/tee/tee_cryp_utl.h
@@ -38,9 +38,6 @@ TEE_Result tee_hash_get_digest_size(uint32_t algo, size_t *size);
TEE_Result tee_hash_createdigest(uint32_t algo, const uint8_t *data,
size_t datalen, uint8_t *digest,
size_t digestlen);
-TEE_Result tee_hash_check(uint32_t algo, const uint8_t *hash,
- size_t hash_size, const uint8_t *data,
- size_t data_size);
TEE_Result tee_mac_get_digest_size(uint32_t algo, size_t *size);
TEE_Result tee_cipher_get_block_size(uint32_t algo, size_t *size);
TEE_Result tee_do_cipher_update(void *ctx, uint32_t algo,
diff --git a/core/include/tee/tee_svc.h b/core/include/tee/tee_svc.h
index a24aff75..9c7c5957 100644
--- a/core/include/tee/tee_svc.h
+++ b/core/include/tee/tee_svc.h
@@ -44,8 +44,6 @@ void syscall_log(const void *buf, size_t len);
void syscall_panic(unsigned long code);
-TEE_Result syscall_reserved(void);
-
TEE_Result syscall_not_supported(void);
uint32_t syscall_dummy(uint32_t *a);
diff --git a/core/kernel/sub.mk b/core/kernel/sub.mk
index 1a44741b..ada19798 100644
--- a/core/kernel/sub.mk
+++ b/core/kernel/sub.mk
@@ -1,5 +1,4 @@
srcs-y += assert.c
-srcs-y += tee_compat.c
srcs-y += tee_dispatch.c
srcs-y += tee_misc.c
srcs-y += tee_ta_manager_unpg.c
diff --git a/core/kernel/tee_compat.c b/core/kernel/tee_compat.c
deleted file mode 100644
index 477a340c..00000000
--- a/core/kernel/tee_compat.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2014, STMicroelectronics International N.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <string.h>
-#include <kernel/tee_compat.h>
-
-TEE_Result tee_compat_param_old_to_new(TEE_Operation *op,
- struct tee_ta_param *param)
-{
- size_t n;
- uint32_t pt;
-
- memset(param, 0, sizeof(*param));
-
- for (n = 0; n < 4; n++) {
- if (op->flags & 1 << n) {
- switch (op->memRefs[n].flags) {
- case TEE_MEM_INPUT:
- pt = TEE_PARAM_TYPE_MEMREF_INPUT;
- break;
- case TEE_MEM_OUTPUT:
- pt = TEE_PARAM_TYPE_MEMREF_OUTPUT;
- break;
- case TEE_MEM_INPUT | TEE_MEM_OUTPUT:
- pt = TEE_PARAM_TYPE_MEMREF_INOUT;
- break;
- default:
- return TEE_ERROR_BAD_PARAMETERS;
- }
- param->types |= pt << (n * 4);
- param->params[n].memref.buffer = op->memRefs[n].buffer;
- param->params[n].memref.size = op->memRefs[n].size;
- }
- }
-
- return TEE_SUCCESS;
-}
-
-TEE_Result tee_compat_param_new_to_old(const struct tee_ta_param *param,
- TEE_Operation *op)
-{
- size_t n;
-
- op->flags = 0;
- for (n = 0; n < 4; n++) {
- switch (TEE_PARAM_TYPE_GET(param->types, n)) {
- case TEE_PARAM_TYPE_NONE:
- continue;
-
- case TEE_PARAM_TYPE_VALUE_INPUT:
- case TEE_PARAM_TYPE_VALUE_OUTPUT:
- case TEE_PARAM_TYPE_VALUE_INOUT:
- return TEE_ERROR_BAD_PARAMETERS; /* Not supported */
-
- case TEE_PARAM_TYPE_MEMREF_INPUT:
- op->memRefs[n].flags = TEE_MEM_INPUT;
- break;
-
- case TEE_PARAM_TYPE_MEMREF_OUTPUT:
- op->memRefs[n].flags = TEE_MEM_OUTPUT;
- break;
-
- case TEE_PARAM_TYPE_MEMREF_INOUT:
- op->memRefs[n].flags = TEE_MEM_INPUT | TEE_MEM_OUTPUT;
- break;
-
- default:
- return TEE_ERROR_BAD_PARAMETERS; /* Not supported */
- }
-
- op->flags |= 1 << n;
- op->memRefs[n].buffer = param->params[n].memref.buffer;
- op->memRefs[n].size = param->params[n].memref.size;
- }
-
- return TEE_SUCCESS;
-}
diff --git a/core/kernel/tee_dispatch.c b/core/kernel/tee_dispatch.c
index 393b2daf..e9e6ea78 100644
--- a/core/kernel/tee_dispatch.c
+++ b/core/kernel/tee_dispatch.c
@@ -30,7 +30,6 @@
#include <kernel/tee_ta_manager.h>
#include <mm/core_memprot.h>
#include <mm/core_mmu.h>
-#include <kernel/tee_compat.h>
#include <kernel/tee_time.h>
#include <tee/tee_cryp_utl.h>
diff --git a/core/tee/tee_cryp_utl.c b/core/tee/tee_cryp_utl.c
index 36721247..f0b7da35 100644
--- a/core/tee/tee_cryp_utl.c
+++ b/core/tee/tee_cryp_utl.c
@@ -134,33 +134,6 @@ out:
return res;
}
-TEE_Result tee_hash_check(uint32_t algo, const uint8_t *hash,
- size_t hash_size, const uint8_t *data,
- size_t data_size)
-{
- TEE_Result res;
- uint8_t digest[TEE_MAX_HASH_SIZE];
- size_t digestlen;
-
- res = tee_hash_get_digest_size(algo, &digestlen);
- if (res != TEE_SUCCESS)
- return TEE_ERROR_BAD_PARAMETERS;
- if ((hash_size == 0) ||
- (digestlen < hash_size) ||
- (digestlen > TEE_MAX_HASH_SIZE))
- return TEE_ERROR_BAD_PARAMETERS;
-
- res = tee_hash_createdigest(algo, data, data_size, digest,
- sizeof(digest));
- if (res != TEE_SUCCESS)
- return res;
-
- if (buf_compare_ct(digest, hash, hash_size) != 0)
- return TEE_ERROR_SECURITY;
-
- return TEE_SUCCESS;
-}
-
TEE_Result tee_mac_get_digest_size(uint32_t algo, size_t *size)
{
switch (algo) {
diff --git a/core/tee/tee_svc.c b/core/tee/tee_svc.c
index 3e43b916..4d1f2338 100644
--- a/core/tee/tee_svc.c
+++ b/core/tee/tee_svc.c
@@ -27,7 +27,6 @@
#include <util.h>
#include <kernel/tee_common_otp.h>
#include <kernel/tee_common.h>
-#include <kernel/tee_compat.h>
#include <tee_api_types.h>
#include <kernel/tee_ta_manager.h>
#include <utee_types.h>
@@ -69,11 +68,6 @@ void syscall_log(const void *buf __unused, size_t len __unused)
#endif
}
-TEE_Result syscall_reserved(void)
-{
- return TEE_ERROR_GENERIC;
-}
-
TEE_Result syscall_not_supported(void)
{
return TEE_ERROR_NOT_SUPPORTED;