Files
linux-nv-oot/drivers/misc/mods/mods_tz.c
Ellis 1658071414 misc: mods: Add ioctl to pass messages to tz app
Summary: This change adds support in mods kernel
driver to send messages to Trusty in order to
run tests trust zone side

Signed-off-by: Ellis Roberts <ellisr@nvidia.com>
Change-Id: I5cd0a1dcc4d1ac5543df5fb3ebec4427c1145e10
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2567469
Tested-by: Rohith Talluri <sitalluri@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Stephen Wolfe <swolfe@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 13:27:52 +00:00

46 lines
1.2 KiB
C

// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#include "mods_internal.h"
#include <linux/trusty/trusty_ipc.h>
#define MODS_PORT "com.nvidia.srv.mods"
int esc_mods_send_trustzone_msg(struct mods_client *client,
struct MODS_TZ_PARAMS *p)
{
int ret;
void *chan_ctx = NULL;
ret = te_open_trusted_session(MODS_PORT, &chan_ctx);
if (ret < 0) {
cl_error("Couldn't open connection mods service\n");
goto error;
}
ret = te_launch_trusted_oper(p->buf, p->buf_size, p->cmd, chan_ctx);
if (ret < 0) {
cl_error("Trusted operation failed\n");
goto error;
}
error:
p->status = ret;
if (chan_ctx)
te_close_trusted_session(chan_ctx);
return ret;
}