Skip to content

Commit 8c8f640

Browse files
niuyongwenchench246
authored andcommitted
[bugfix]: crypto: ccp: Fix the issue of TDM support detection failure on Hygon platforms without psp firmware support
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: chench <chench@hygon.cn>
1 parent 8426d7e commit 8c8f640

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/crypto/ccp/hygon/tdm-dev.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/kallsyms.h>
2525
#include <linux/ftrace.h>
2626
#include "tdm-dev.h"
27+
#include "psp-dev.h"
2728

2829
#ifdef pr_fmt
2930
#undef pr_fmt
@@ -533,8 +534,12 @@ int psp_check_tdm_support(void)
533534
{
534535
int ret = 0;
535536
struct tdm_version version;
537+
struct psp_device *psp = psp_master;
536538

537-
if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
539+
if (!psp)
540+
goto end;
541+
542+
if (is_vendor_hygon() && (psp->capability & PSP_CAPABILITY_SEV)) {
538543
if (tdm_support)
539544
goto end;
540545

0 commit comments

Comments
 (0)