Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29ac40c

Browse files
nivedita76suryasaimadhu
authored andcommitted
x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
The PAT bit is in different locations for 4k and 2M/1G page tableentries.Add a definition for _PAGE_LARGE_CACHE_MASK to represent the threecaching bits (PWT, PCD, PAT), similar to _PAGE_CACHE_MASK for 4k pages,and use it in the definition of PMD_FLAGS_DEC_WP to get the correct PATindex for write-protected pages.Fixes:6ebcb06 ("x86/mm: Add support to encrypt the kernel in-place")Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>Signed-off-by: Borislav Petkov <bp@suse.de>Tested-by: Tom Lendacky <thomas.lendacky@amd.com>Cc: stable@vger.kernel.orgLink:https://lkml.kernel.org/r/20201111160946.147341-1-nivedita@alum.mit.edu
1 parente45cdc7 commit29ac40c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎arch/x86/include/asm/pgtable_types.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ enum page_cache_mode {
155155
#define_PAGE_ENC(_AT(pteval_t, sme_me_mask))
156156

157157
#define_PAGE_CACHE_MASK(_PAGE_PWT | _PAGE_PCD | _PAGE_PAT)
158+
#define_PAGE_LARGE_CACHE_MASK(_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE)
158159

159160
#define_PAGE_NOCACHE(cachemode2protval(_PAGE_CACHE_MODE_UC))
160161
#define_PAGE_CACHE_WP(cachemode2protval(_PAGE_CACHE_MODE_WP))

‎arch/x86/mm/mem_encrypt_identity.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
#definePMD_FLAGS_LARGE(__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL)
4646

4747
#definePMD_FLAGS_DECPMD_FLAGS_LARGE
48-
#definePMD_FLAGS_DEC_WP((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \
49-
(_PAGE_PAT | _PAGE_PWT))
48+
#definePMD_FLAGS_DEC_WP((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \
49+
(_PAGE_PAT_LARGE | _PAGE_PWT))
5050

5151
#definePMD_FLAGS_ENC(PMD_FLAGS_LARGE | _PAGE_ENC)
5252

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp