Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping
[linux-2.6-microblaze.git] / kernel / dma / direct.c
index 79da61b..355d16a 100644 (file)
@@ -373,5 +373,10 @@ int dma_direct_supported(struct device *dev, u64 mask)
 
        min_mask = min_t(u64, min_mask, (max_pfn - 1) << PAGE_SHIFT);
 
-       return mask >= phys_to_dma(dev, min_mask);
+       /*
+        * This check needs to be against the actual bit mask value, so
+        * use __phys_to_dma() here so that the SME encryption mask isn't
+        * part of the check.
+        */
+       return mask >= __phys_to_dma(dev, min_mask);
 }