Skip to content

Commit 7cffdb0

Browse files
vittyvkrbradford
authored andcommitted
virt: vmgenid: remap memory as decrypted
It was found that AWS SEV-SNP enabled instances are not able to boot with commit 81256a5 ("x86/mm: Make memremap(MEMREMAP_WB) map memory as encrypted by default") applied and the reason seems to be the vmgenid device which requires unencrypted writeable memory. A similar problem was previously fixed in DRM with commit 7dfede7 ("drm/vmwgfx: Fix guests running with TDX/SEV"). Note, trusting vmgenid device in a Confidential VM is questionable: the malicious host may intentionally avoid notifying the guest when a copy is created. Fixes: 81256a5 ("x86/mm: Make memremap(MEMREMAP_WB) map memory as encrypted by default") Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: stable@vger.kernel.org # 6.15+ Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> (cherry picked from commit 1b48c13)
1 parent ac1c710 commit 7cffdb0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/virt/vmgenid.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ static int vmgenid_add_acpi(struct device *dev, struct vmgenid_state *state)
7575
phys_addr = (obj->package.elements[0].integer.value << 0) |
7676
(obj->package.elements[1].integer.value << 32);
7777

78-
virt_addr = devm_memremap(&device->dev, phys_addr, VMGENID_SIZE, MEMREMAP_WB);
78+
virt_addr = devm_memremap(&device->dev, phys_addr, VMGENID_SIZE,
79+
MEMREMAP_WB | MEMREMAP_DEC);
7980
if (IS_ERR(virt_addr)) {
8081
ret = PTR_ERR(virt_addr);
8182
goto out;

0 commit comments

Comments
 (0)