summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorPankaj Gupta <pankaj.gupta@amd.com>2022-11-02 11:07:28 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-16 09:57:17 +0100
commit0b692d41ee5c88097ecf5dbb37c59083044c996a (patch)
tree2d0ce86f8935a8fe4ae346e580a0729644a06757 /mm
parent03f9582a6a2ebd25a440896475c968428c4b63e7 (diff)
mm/memremap.c: map FS_DAX device memory as decrypted
commit 867400af90f1f953ff9e10b1b87ecaf9369a7eb8 upstream. 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: b7b3c01b19159 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memremap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/memremap.c b/mm/memremap.c
index 2455bac89506..299aad0d26e5 100644
--- a/mm/memremap.c
+++ b/mm/memremap.c
@@ -348,6 +348,7 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid)
WARN(1, "File system DAX not supported\n");
return ERR_PTR(-EINVAL);
}
+ params.pgprot = pgprot_decrypted(params.pgprot);
break;
case MEMORY_DEVICE_GENERIC:
break;