diff options
author | Nitin Gupta <nitin.m.gupta@oracle.com> | 2017-03-31 15:48:53 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-06 12:03:30 -0700 |
commit | 76811263b3fa6347699a446cddeb63badf3e6095 (patch) | |
tree | 9327454f7bf709e09194fe0dfbe77704f340803b /arch/sparc/mm/tlb.c | |
parent | 9ae34dbd8afd790cb5f52467e4f816434379eafa (diff) | |
download | lwn-76811263b3fa6347699a446cddeb63badf3e6095.tar.gz lwn-76811263b3fa6347699a446cddeb63badf3e6095.zip |
sparc64: Fix memory corruption when THP is enabled
The memory corruption was happening due to incorrect
TLB/TSB flushing of hugepages.
Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/tlb.c')
-rw-r--r-- | arch/sparc/mm/tlb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc/mm/tlb.c b/arch/sparc/mm/tlb.c index afda3bbf7854..ee8066c3d96c 100644 --- a/arch/sparc/mm/tlb.c +++ b/arch/sparc/mm/tlb.c @@ -154,7 +154,7 @@ static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr, if (pte_val(*pte) & _PAGE_VALID) { bool exec = pte_exec(*pte); - tlb_batch_add_one(mm, vaddr, exec, false); + tlb_batch_add_one(mm, vaddr, exec, PAGE_SHIFT); } pte++; vaddr += PAGE_SIZE; @@ -209,9 +209,9 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr, pte_t orig_pte = __pte(pmd_val(orig)); bool exec = pte_exec(orig_pte); - tlb_batch_add_one(mm, addr, exec, true); + tlb_batch_add_one(mm, addr, exec, REAL_HPAGE_SHIFT); tlb_batch_add_one(mm, addr + REAL_HPAGE_SIZE, exec, - true); + REAL_HPAGE_SHIFT); } else { tlb_batch_pmd_scan(mm, addr, orig); } |