RE: [PATCH v7 11/22] dma-pool: track decrypted atomic pools and select them via attrs
Michael Kelley <[email protected]>
| Newsgroups | dev.linux.lists.linux-coco,dev.linux.lists.iommu,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-s390,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <BN7PR02MB41480896D46601E8B7F6166DD4F92@BN7PR02MB4148.namprd02.prod.outlook.com> |
From: Jason Gunthorpe <[email protected]> Sent: Tuesday, July 14, 2026 5:25 AM > > On Tue, Jul 14, 2026 at 09:32:27AM +0530, Aneesh Kumar K.V wrote: > > > If we want to warn about such failures, we should add the warning > > consistently across the code. We may also want to handle decrypt > > failures by encrypting the page again to avoid leaking it. > > > > I will work on that as a tree-wide change in a separate patch. > > IMHO the WARN should be inside set_memory_encrypted(), and maybe it > should be a BUG_ON... There was a discussion about this a while back. The decision was to embed the WARNs, and that callers should not output any error messages upon failure. The x86 implementation of set_memory_decrypted() and set_memory_encrypted() has an embedded WARN_ON_ONCE() that triggers on a failure. The arm64 realm encrypt/decrypt ops also have an embedded WARN(). The pkvm encrypt/decrypt ops do not, so that's maybe where it should be added. Michael