lkml.org 
[lkml]   [2022]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86/mm/ptdump: display page encryption state
Date
From: Mike Rapoport <rppt@linux.ibm.com>

When memory encryption is enabled, for instance in SEV guest, it is useful
to see what memory ranges are mapped as encrypted in the kernel page tables
and what ranges are left plain.

Add printing of 'ENC' for the encrypted ranges to the page table dumps.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
arch/x86/mm/dump_pagetables.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c
index e1b599ecbbc2..187dd17b8780 100644
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -201,6 +201,10 @@ static void printk_prot(struct seq_file *m, pgprotval_t pr, int level, bool dmsg
pt_dump_cont_printf(m, dmsg, "PCD ");
else
pt_dump_cont_printf(m, dmsg, " ");
+ if (pr & _PAGE_ENC)
+ pt_dump_cont_printf(m, dmsg, "ENC ");
+ else
+ pt_dump_cont_printf(m, dmsg, " ");

/* Bit 7 has a different meaning on level 3 vs 4 */
if (level <= 3 && pr & _PAGE_PSE)
base-commit: b2d229d4ddb17db541098b83524d901257e93845
--
2.28.0

\
 
 \ /
  Last update: 2022-04-19 16:38    [W:0.081 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site