LoongArch: Remove shm_align_mask and use SHMLBA instead
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 6 Sep 2023 14:53:09 +0000 (22:53 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 6 Sep 2023 14:53:09 +0000 (22:53 +0800)
commitad3ff105611b9b06e16ae57e97b48916ff93dd46
treeebcf9eef57173f5e341bee00dbfcb074e9b36251
parent303be4b33562a5b689261ced1616bf16ad49efa7
LoongArch: Remove shm_align_mask and use SHMLBA instead

Both shm_align_mask and SHMLBA want to avoid cache alias. But they are
inconsistent: shm_align_mask is (PAGE_SIZE - 1) while SHMLBA is SZ_64K,
but PAGE_SIZE is not always equal to SZ_64K.

This may cause problems when shmat() twice. Fix this problem by removing
shm_align_mask and using SHMLBA (strictly SHMLBA - 1) instead.

Reported-by: Jiantao Shan <shanjiantao@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/mm/cache.c
arch/loongarch/mm/mmap.c