Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\intel.c Create Date:2022-07-28 07:57:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:detect_tme

Proto:static void detect_tme(struct cpuinfo_x86 *c)

Type:void

Parameter:

TypeParameterName
struct cpuinfo_x86 *c
566  keyid_bits = 0 , nr_keyids = 0
567  tme_activate_cpu0 = 0
569  rdmsrl(MSR_IA32_TME_ACTIVATE, tme_activate)
571  If mktme_status != MKTME_UNINITIALIZED Then
572  If tme_activate != tme_activate_cpu0 Then
574  pr_err_once("x86/tme: configuration is inconsistent between CPUs\n")
575  pr_err_once("x86/tme: MKTME is not usable\n")
580  Else
581  tme_activate_cpu0 = tme_activate
584  If Not Helpers to access TME_ACTIVATE MSR (tme_activate) || Not TME_ACTIVATE_ENABLED(tme_activate) Then
585  pr_info_once("x86/tme: not enabled by BIOS\n")
586  mktme_status = MKTME_DISABLED
587  Return
590  If mktme_status != MKTME_UNINITIALIZED Then Go to detect_keyid_bits
593  pr_info("x86/tme: enabled by BIOS\n")
595  tme_policy = Bits 7:4 (tme_activate)
596  If tme_policy != TME_ACTIVATE_POLICY_AES_XTS_128 Then pr_warn("x86/tme: Unknown policy is active: %#llx\n", tme_policy)
599  tme_crypto_algs = Bits 63:48 (tme_activate)
600  If Not (tme_crypto_algs & TME_ACTIVATE_CRYPTO_AES_XTS_128) Then
601  pr_err("x86/mktme: No known encryption algorithm is supported: %#llx\n", tme_crypto_algs)
603  mktme_status = MKTME_DISABLED
605  detect_keyid_bits :
606  keyid_bits = Bits 35:32 (tme_activate)
607  nr_keyids = (1UL << keyid_bits) - 1
608  If nr_keyids Then
609  pr_info_once("x86/mktme: enabled by BIOS\n")
610  pr_info_once("x86/mktme: %d KeyIDs available\n", nr_keyids)
611  Else
612  pr_info_once("x86/mktme: disabled by BIOS\n")
615  If mktme_status == MKTME_UNINITIALIZED Then
617  mktme_status = Values for mktme_status (SW only construct)
624  x86_phys_bits -= keyid_bits
Caller
NameDescribe
init_intel