OSDN Git Service

x86/tme: Detect if TME and MKTME is activated by BIOS
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Mon, 5 Mar 2018 16:25:50 +0000 (19:25 +0300)
committerIngo Molnar <mingo@kernel.org>
Mon, 12 Mar 2018 11:10:54 +0000 (12:10 +0100)
commitcb06d8e3d020c30fe10ae711c925a5319ab82c88
tree6ea64efba9579c75c91f81fe7aec132fb967efb5
parent3c76db70eb70a0fbd40b3e0dec8f69ca344d1ff8
x86/tme: Detect if TME and MKTME is activated by BIOS

IA32_TME_ACTIVATE MSR (0x982) can be used to check if BIOS has enabled
TME and MKTME. It includes which encryption policy/algorithm is selected
for TME or available for MKTME. For MKTME, the MSR also enumerates how
many KeyIDs are available.

We would need to exclude KeyID bits from physical address bits.
detect_tme() would adjust cpuinfo_x86::x86_phys_bits accordingly.

We have to do this even if we are not going to use KeyID bits
ourself. VM guests still have to know that these bits are not usable
for physical address.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Kai Huang <kai.huang@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180305162610.37510-3-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/intel.c