[PATCH 1/2] x86/mm: Fix comment in detect_tme() regarding x86_phys_bits

From: Kirill A. Shutemov
Date: Thu Mar 15 2018 - 09:49:33 EST


As Kai pointed, we adjust x86_phys_bits not only to communicate
available physical address space to virtual machines, but mainly to
reflect the fact that the address space is reduced.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Suggested-by: Kai Huang <kai.huang@xxxxxxxxxxxxxxx>
---
arch/x86/kernel/cpu/intel.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index f0481b85c39d..fd379358c58d 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -619,11 +619,8 @@ static void detect_tme(struct cpuinfo_x86 *c)
#endif

/*
- * Exclude KeyID bits from physical address bits.
- *
- * 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.
+ * KeyID bits effectively lower number of physical address bits.
+ * Let's update cpuinfo_x86::x86_phys_bits to reflect the fact.
*/
c->x86_phys_bits -= keyid_bits;
}
--
2.16.1