Skip to content

Commit 867400a

Browse files
paguptaakpm00
authored andcommitted
mm/memremap.c: map FS_DAX device memory as decrypted
virtio_pmem use devm_memremap_pages() to map the device memory. By default this memory is mapped as encrypted with SEV. Guest reboot changes the current encryption key and guest no longer properly decrypts the FSDAX device meta data. Mark the corresponding device memory region for FSDAX devices (mapped with memremap_pages) as decrypted to retain the persistent memory property. Link: https://lkml.kernel.org/r/20221102160728.3184016-1-pankaj.gupta@amd.com Fixes: b7b3c01 ("mm/memremap_pages: support multiple ranges per invocation") Signed-off-by: Pankaj Gupta <pankaj.gupta@amd.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 624a2c9 commit 867400a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mm/memremap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid)
335335
WARN(1, "File system DAX not supported\n");
336336
return ERR_PTR(-EINVAL);
337337
}
338+
params.pgprot = pgprot_decrypted(params.pgprot);
338339
break;
339340
case MEMORY_DEVICE_GENERIC:
340341
break;

0 commit comments

Comments
 (0)