Date: Sat, 23 Jan 2016 17:08:18 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294636 - in stable: 10/sys/ofed/include/linux 9/sys/ofed/include/linux Message-ID: <201601231708.u0NH8IDU086985@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Sat Jan 23 17:08:17 2016 New Revision: 294636 URL: https://svnweb.freebsd.org/changeset/base/294636 Log: MFC 294366: Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0. If a driver's Linux mmap callback passed vm_page_prot through unchanged, then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx value 0 is to the mapping. On x86, VM_MEMATTR_DEFAULT is the PAT value for write-back (WB) which is 6, while 0 maps to the PAT value for uncacheable (UC). Thus, any mmap request that did not explicitly set page_prot was tried to map memory as UC triggering the warning in sg_pager_getpages(). Sponsored by: Chelsio Communications Modified: stable/10/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/ofed/include/linux/linux_compat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/ofed/include/linux/linux_compat.c ============================================================================== --- stable/10/sys/ofed/include/linux/linux_compat.c Sat Jan 23 15:48:14 2016 (r294635) +++ stable/10/sys/ofed/include/linux/linux_compat.c Sat Jan 23 17:08:17 2016 (r294636) @@ -480,7 +480,7 @@ linux_dev_mmap_single(struct cdev *dev, vma.vm_end = size; vma.vm_pgoff = *offset / PAGE_SIZE; vma.vm_pfn = 0; - vma.vm_page_prot = 0; + vma.vm_page_prot = VM_MEMATTR_DEFAULT; if (filp->f_op->mmap) { error = -filp->f_op->mmap(filp, &vma); if (error == 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601231708.u0NH8IDU086985>