From 3c5edf2348ce34914fa902900c922d2d116fafeb Mon Sep 17 00:00:00 2001 From: niuyongwen Date: Tue, 25 Feb 2025 20:37:00 +0800 Subject: [PATCH] anolis: crypto: ccp: Fix the issue of TDM support detection failure on Hygon platforms without psp firmware support. ANBZ: #19610 Before using the TDM feature, a probe command is sent to the PSP to confirm its support status. However, when the psp firmware is not loaded, the probe command cannot be supported, so it should be set to an unsupported state. Signed-off-by: niuyongwen --- drivers/crypto/ccp/hygon/tdm-dev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/hygon/tdm-dev.c b/drivers/crypto/ccp/hygon/tdm-dev.c index 71ab3f6caaab..7e9781c8ec56 100644 --- a/drivers/crypto/ccp/hygon/tdm-dev.c +++ b/drivers/crypto/ccp/hygon/tdm-dev.c @@ -23,6 +23,7 @@ #include #include #include "tdm-dev.h" +#include "psp-dev.h" #ifdef pr_fmt #undef pr_fmt @@ -532,8 +533,12 @@ int psp_check_tdm_support(void) { int ret = 0; struct tdm_version version; + struct psp_device *psp = psp_master; - if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) { + if (!psp) + goto end; + + if (is_vendor_hygon() && (psp->capability & PSP_CAPABILITY_SEV)) { if (tdm_support) goto end; -- Gitee