sparc64: fix mmap fixed and shared on sun4u
PATCH 1/1 sparc64: fix mmap fixed and shared on sun4u
Older sparc64 must have a VAC because there is concern that mmapping fixed and shared with incorrect align would cause cache aliases. This is not an issue for sun4v.
We will enforce the rigid alignment condition only for tlb_type != hypervisor.
--- arch/sparc/kernel/sys_sparc_64.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc/kernel/sys_sparc_64.c +2 -2
@@ -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;
Signature · 1 line
1.7.1
David Miller
maintainerFrom: Larry Bassel <[email protected]>
Date: Wed, 21 Dec 2016 14:25:49 -0800
Quoted 8 lines
Older sparc64 must have a VAC because there is concern that mmapping fixed and shared with incorrect align would cause cache aliases. This is not an issue for sun4v.
We will enforce the rigid alignment condition only for
tlb_type!= hypervisor.Signed-off-by Larry Bassel <[email protected]>Signed-off-by Bob Picco <[email protected]>
This is just asking people to write programs that won't work on pre-Niagara machines.
I'm not applying this, having a SHMLBA (16K) alignment requirement for shared mmapings is quite reasonable.