]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: mmap fixed and shared
authorbob picco <bpicco@meloft.net>
Thu, 25 Jun 2015 00:10:18 +0000 (17:10 -0700)
committerAllen Pais <allen.pais@oracle.com>
Wed, 9 Sep 2015 18:44:35 +0000 (00:14 +0530)
Older sparc64 must have a VAC because there is concern that mmapping fixed
and shared with incorrect align would cause cache aliases. To my knowledge
this is not an issue for sun4v. I will eventually research this.

The patch appears required for uek4 too.

We will enforce the rigid alignment condition only for tlb_type != hypervisor.

Orabug: 20426304

Signed-off-by: Bob Picco <bob.picco@oracle.com>
(cherry picked from commit 88b6df6b74de358992b2b58dab018672606975c7)
(cherry picked from commit 3daf2db176d2f874446d74839635e9bbaffccc7f)

arch/sparc/kernel/sys_sparc_64.c

index 30e7ddb27a3a966e74e5ab79ad686bab26eab459..ca709ef1206eaeee97f631108b99ffeecc9af5d7 100644 (file)
@@ -95,7 +95,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
                /* We do not accept a shared mapping if it would violate
                 * cache aliasing constraints.
                 */
-               if ((flags & MAP_SHARED) &&
+               if ((flags & MAP_SHARED) && (tlb_type != hypervisor) &&
                    ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)))
                        return -EINVAL;
                return addr;
@@ -159,7 +159,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
                /* We do not accept a shared mapping if it would violate
                 * cache aliasing constraints.
                 */
-               if ((flags & MAP_SHARED) &&
+               if ((flags & MAP_SHARED) && (tlb_type != hypervisor) &&
                    ((addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1)))
                        return -EINVAL;
                return addr;