From 6bf84f96773101599da587cc7dac76dc3a0967df Mon Sep 17 00:00:00 2001 From: bob picco Date: Wed, 24 Jun 2015 17:10:18 -0700 Subject: [PATCH] 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) --- arch/sparc/kernel/sys_sparc_64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.50.1