|
@@ -32,6 +32,7 @@
|
|
|
#include <linux/device.h>
|
|
|
#include <linux/efi.h>
|
|
|
#include <linux/fb.h>
|
|
|
+#include <linux/mem_encrypt.h>
|
|
|
|
|
|
#include <asm/fb.h>
|
|
|
|
|
@@ -1396,6 +1397,12 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
|
|
|
mutex_lock(&info->mm_lock);
|
|
|
if (fb->fb_mmap) {
|
|
|
int res;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * The framebuffer needs to be accessed decrypted, be sure
|
|
|
+ * SME protection is removed ahead of the call
|
|
|
+ */
|
|
|
+ vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
|
|
|
res = fb->fb_mmap(info, vma);
|
|
|
mutex_unlock(&info->mm_lock);
|
|
|
return res;
|
|
@@ -1421,6 +1428,11 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
|
|
|
mutex_unlock(&info->mm_lock);
|
|
|
|
|
|
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
|
|
|
+ /*
|
|
|
+ * The framebuffer needs to be accessed decrypted, be sure
|
|
|
+ * SME protection is removed
|
|
|
+ */
|
|
|
+ vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
|
|
|
fb_pgprotect(file, vma, start);
|
|
|
|
|
|
return vm_iomap_memory(vma, start, len);
|