Skip to content

Commit

Permalink
microblaze: mm: Flush TLB to ensure correct mapping when higmem ON
Browse files Browse the repository at this point in the history
MMU contains invalid mapping which wasn't flushed and new mapping
is using the same addresses as previous one. That's why TLB miss is not
happening to get new correct TLB entry and MMU points to incorrect area.

This is replicatable when large files(256MB and more) are copied and
checked.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Michal Simek committed Jun 22, 2017
1 parent 83f0124 commit a753499
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions arch/microblaze/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void __kunmap_atomic(void *kvaddr)
{
unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
int type;
unsigned int idx;

if (vaddr < __fix_to_virt(FIX_KMAP_END)) {
pagefault_enable();
Expand All @@ -68,21 +69,18 @@ void __kunmap_atomic(void *kvaddr)
}

type = kmap_atomic_idx();
#ifdef CONFIG_DEBUG_HIGHMEM
{
unsigned int idx;

idx = type + KM_TYPE_NR * smp_processor_id();
BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));

/*
* force other mappings to Oops if they'll try to access
* this pte without first remap it
*/
pte_clear(&init_mm, vaddr, kmap_pte-idx);
local_flush_tlb_page(NULL, vaddr);
}
idx = type + KM_TYPE_NR * smp_processor_id();
#ifdef CONFIG_DEBUG_HIGHMEM
BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
#endif
/*
* force other mappings to Oops if they'll try to access
* this pte without first remap it
*/
pte_clear(&init_mm, vaddr, kmap_pte-idx);
local_flush_tlb_page(NULL, vaddr);

kmap_atomic_idx_pop();
pagefault_enable();
preempt_enable();
Expand Down

0 comments on commit a753499

Please sign in to comment.