Commit c880881e authored by Huaxin Lu's avatar Huaxin Lu
Browse files

IMA: Check cvm world before call smc function

EulerOS inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VSX2



------------------------------

Check the environment is in cvm world before call SMC function.
Because some hardware may not support SMC.

Fixes: b1410546 ("IMA: Support the measurement extending of TSI TMM")
Signed-off-by: default avatarHuaxin Lu <luhuaxin1@huawei.com>
parent bed797c8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
 * Copyright (C) 2024. Huawei Technologies Co., Ltd. All rights reserved.
 */
#include <asm/cvm_smc.h>
#include <asm/cvm_guest.h>
#include "ima_cvm.h"

static bool ima_tsi_cvm;
@@ -16,7 +17,7 @@ int __init ima_cvm_init(void)
{
	int rc = -ENODEV;

	if (tsi_get_version() != SMCCC_RET_NOT_SUPPORTED) {
	if (is_cvm_world() && tsi_get_version() != SMCCC_RET_NOT_SUPPORTED) {
		ima_tsi_cvm = true;
		rc = 0;
	}