lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200925072630.8157-6-sherry.sun@nxp.com>
Date:   Fri, 25 Sep 2020 15:26:30 +0800
From:   Sherry Sun <sherry.sun@....com>
To:     sudeep.dutt@...el.com, ashutosh.dixit@...el.com, arnd@...db.de,
        gregkh@...uxfoundation.org, wang.yi59@....com.cn,
        huang.zijiang@....com.cn, rikard.falkeborn@...il.com,
        lee.jones@...aro.org, mst@...hat.com
Cc:     linux-kernel@...r.kernel.org, linux-imx@....com
Subject: [PATCH 5/5] misc: vop: mapping kernel memory to user space as noncached

Mapping kernel space memory to user space as noncached for noncoherent
platform, since user space need check avail_idx and device page flags
timely.

Signed-off-by: Joakim Zhang <qiangqing.zhang@....com>
Signed-off-by: Sherry Sun <sherry.sun@....com>
---
 drivers/misc/mic/vop/vop_vringh.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c
index aa2dd240c11e..9850515e8d21 100644
--- a/drivers/misc/mic/vop/vop_vringh.c
+++ b/drivers/misc/mic/vop/vop_vringh.c
@@ -1139,7 +1139,9 @@ static int vop_mmap(struct file *f, struct vm_area_struct *vma)
 		}
 		err = remap_pfn_range(vma, vma->vm_start + offset,
 				      pa >> PAGE_SHIFT, size,
-				      vma->vm_page_prot);
+				      dev_is_dma_coherent(vop_dev(vdev)) ? vma->vm_page_prot :
+							  pgprot_noncached(vma->vm_page_prot));
+
 		if (err)
 			goto ret;
 		size_rem -= size;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ