Commit f52f5e1c authored by hanliyang's avatar hanliyang
Browse files

KVM: SVM: Print Hygon CSV support info if support is detected

hygon inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I98NP1


CVE: NA

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

The KVM will print 'SEV supported' instead of 'CSV supported' on Hygon
CPU if CSV is supported. Fix these confused messages here.

Fix other 'SEV' messages in arch/x86/kvm/svm/svm.c.

Signed-off-by: default avatarhanliyang <hanliyang@hygon.cn>
parent c73088c4
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <asm/trapnr.h>
#include <asm/fpu/xcr.h>
#include <asm/debugreg.h>
#include <asm/processor-hygon.h>

#include "mmu.h"
#include "x86.h"
@@ -2274,13 +2275,15 @@ void __init sev_hardware_setup(void)

out:
	if (boot_cpu_has(X86_FEATURE_SEV))
		pr_info("SEV %s (ASIDs %u - %u)\n",
		pr_info("%s %s (ASIDs %u - %u)\n",
			is_x86_vendor_hygon() ? "CSV" : "SEV",
			sev_supported ? min_sev_asid <= max_sev_asid ? "enabled" :
								       "unusable" :
								       "disabled",
			min_sev_asid, max_sev_asid);
	if (boot_cpu_has(X86_FEATURE_SEV_ES))
		pr_info("SEV-ES %s (ASIDs %u - %u)\n",
		pr_info("%s %s (ASIDs %u - %u)\n",
			is_x86_vendor_hygon() ? "CSV2" : "SEV-ES",
			sev_es_supported ? "enabled" : "disabled",
			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);

+3 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include <asm/traps.h>
#include <asm/reboot.h>
#include <asm/fpu/api.h>
#include <asm/processor-hygon.h>

#include <trace/events/ipi.h>

@@ -545,7 +546,8 @@ static bool __kvm_is_svm_supported(void)
	}

	if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
		pr_info("KVM is unsupported when running as an SEV guest\n");
		pr_info("KVM is unsupported when running as an %s guest\n",
			is_x86_vendor_hygon() ? "CSV" : "SEV");
		return false;
	}