From nobody Sun Feb 8 09:32:55 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8978E32C317 for ; Mon, 22 Dec 2025 14:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766414819; cv=none; b=r1zUqSve+TTsKYvVDDcHj+5ei1lxvf7ouTM42bMyheG2+vTFq70kscxPQwNfNAs8T1woemFUNQuV8GOZnpbOCcCbvlAIl9gIqFcqIvyYfEiB+hRDLqBHoNKTGkN0sUzZ/bcRG7CndqHXxxr37xvbpnJyGDV2AH7nBKYbBFRoaSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766414819; c=relaxed/simple; bh=pDRJLdtvUExl5ysmDnkZWb9Ky8tnFpmjIF1aQrBZ74Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=gfW+INYj7488O8gjF2sn4IKbZuoIsVXdnhYzQCbOcl6XN6eSFpK6yLrX1iqDR08NHg9sbjcBIg4l0at9uOvoeGBFWh0ZB6Zn+ujluy8bvDZauivp1Pc+IbcXeBB+OZeODyugjiHlgoDtS90CrqCYwiqR5+FuitW/oRJEJOXx7wM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JoVRqncz; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JoVRqncz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766414816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KzMGwCNuh4UKVnwrVDK9vpCeDxQ9Awa9Q60+T4do64k=; b=JoVRqnczqra+S82kUBC/h6mUCPTzh1h9FAVBiDb7JySAugwXSuytH29Nb06vQVMH4gthvz tJ1S1cP7i2ZAwDp+56slEmJiDQi06G/zAzVBB1cK8A/j7d6/ItLBn1m1NhOW16i+RYAxi3 1bo5Om8/Xg601g+MkmNNUO3EwBTWoeY= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-w_k57mVwPxKjussPnLGOVQ-1; Mon, 22 Dec 2025 09:46:53 -0500 X-MC-Unique: w_k57mVwPxKjussPnLGOVQ-1 X-Mimecast-MFC-AGG-ID: w_k57mVwPxKjussPnLGOVQ_1766414812 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B9A90195FD1A; Mon, 22 Dec 2025 14:46:50 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9BF53180066F; Mon, 22 Dec 2025 14:46:47 +0000 (UTC) From: Vitaly Kuznetsov To: Theodore Ts'o , "Jason A . Donenfeld" Cc: Ingo Molnar , Kiryl Shutsemau , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pradipta Banerjee , Frank Liang , Alexander Graf Subject: [PATCH] vmgenid: Remap memory as decrypted Date: Mon, 22 Dec 2025 15:46:46 +0100 Message-ID: <20251222144646.1426256-1-vkuznets@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" It was found that AWS SEV-SNP enabled instances are not able to boot with commit 81256a50aa0f ("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 7dfede7d7edd ("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: 81256a50aa0f ("x86/mm: Make memremap(MEMREMAP_WB) map memory as encr= ypted by default") Signed-off-by: Vitaly Kuznetsov --- drivers/virt/vmgenid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c index 66135eac3abf..2cf0096aa217 100644 --- a/drivers/virt/vmgenid.c +++ b/drivers/virt/vmgenid.c @@ -75,7 +75,8 @@ static int vmgenid_add_acpi(struct device *dev, struct vm= genid_state *state) phys_addr =3D (obj->package.elements[0].integer.value << 0) | (obj->package.elements[1].integer.value << 32); =20 - virt_addr =3D devm_memremap(&device->dev, phys_addr, VMGENID_SIZE, MEMREM= AP_WB); + virt_addr =3D devm_memremap(&device->dev, phys_addr, VMGENID_SIZE, + MEMREMAP_WB | MEMREMAP_DEC); if (IS_ERR(virt_addr)) { ret =3D PTR_ERR(virt_addr); goto out; --=20 2.52.0