From: bob picco Date: Thu, 25 Jun 2015 00:10:18 +0000 (-0700) Subject: sparc64: mmap fixed and shared X-Git-Tag: v4.1.12-92~283^2^2~16 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6bf84f96773101599da587cc7dac76dc3a0967df;p=users%2Fjedix%2Flinux-maple.git sparc64: mmap fixed and shared 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 (cherry picked from commit 88b6df6b74de358992b2b58dab018672606975c7) (cherry picked from commit 3daf2db176d2f874446d74839635e9bbaffccc7f) --- diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 30e7ddb27a3a..ca709ef1206e 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c @@ -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;