mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-19 04:57:08 +07:00
arm64: Clean up __flush_tlb(_kernel)_range functions
This patch moves the MAX_TLB_RANGE check into the flush_tlb(_kernel)_range functions directly to avoid the undescore-prefixed definitions (and for consistency with a subsequent patch). Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
parent
c53e0baa6f
commit
da4e73303e
@ -91,33 +91,6 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,
|
|||||||
dsb(ish);
|
dsb(ish);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __flush_tlb_range(struct vm_area_struct *vma,
|
|
||||||
unsigned long start, unsigned long end)
|
|
||||||
{
|
|
||||||
unsigned long asid = (unsigned long)ASID(vma->vm_mm) << 48;
|
|
||||||
unsigned long addr;
|
|
||||||
start = asid | (start >> 12);
|
|
||||||
end = asid | (end >> 12);
|
|
||||||
|
|
||||||
dsb(ishst);
|
|
||||||
for (addr = start; addr < end; addr += 1 << (PAGE_SHIFT - 12))
|
|
||||||
asm("tlbi vae1is, %0" : : "r"(addr));
|
|
||||||
dsb(ish);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void __flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
|
||||||
{
|
|
||||||
unsigned long addr;
|
|
||||||
start >>= 12;
|
|
||||||
end >>= 12;
|
|
||||||
|
|
||||||
dsb(ishst);
|
|
||||||
for (addr = start; addr < end; addr += 1 << (PAGE_SHIFT - 12))
|
|
||||||
asm("tlbi vaae1is, %0" : : "r"(addr));
|
|
||||||
dsb(ish);
|
|
||||||
isb();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is meant to avoid soft lock-ups on large TLB flushing ranges and not
|
* This is meant to avoid soft lock-ups on large TLB flushing ranges and not
|
||||||
* necessarily a performance improvement.
|
* necessarily a performance improvement.
|
||||||
@ -127,18 +100,40 @@ static inline void __flush_tlb_kernel_range(unsigned long start, unsigned long e
|
|||||||
static inline void flush_tlb_range(struct vm_area_struct *vma,
|
static inline void flush_tlb_range(struct vm_area_struct *vma,
|
||||||
unsigned long start, unsigned long end)
|
unsigned long start, unsigned long end)
|
||||||
{
|
{
|
||||||
if ((end - start) <= MAX_TLB_RANGE)
|
unsigned long asid = (unsigned long)ASID(vma->vm_mm) << 48;
|
||||||
__flush_tlb_range(vma, start, end);
|
unsigned long addr;
|
||||||
else
|
|
||||||
|
if ((end - start) > MAX_TLB_RANGE) {
|
||||||
flush_tlb_mm(vma->vm_mm);
|
flush_tlb_mm(vma->vm_mm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = asid | (start >> 12);
|
||||||
|
end = asid | (end >> 12);
|
||||||
|
|
||||||
|
dsb(ishst);
|
||||||
|
for (addr = start; addr < end; addr += 1 << (PAGE_SHIFT - 12))
|
||||||
|
asm("tlbi vae1is, %0" : : "r"(addr));
|
||||||
|
dsb(ish);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
|
||||||
{
|
{
|
||||||
if ((end - start) <= MAX_TLB_RANGE)
|
unsigned long addr;
|
||||||
__flush_tlb_kernel_range(start, end);
|
|
||||||
else
|
if ((end - start) > MAX_TLB_RANGE) {
|
||||||
flush_tlb_all();
|
flush_tlb_all();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
start >>= 12;
|
||||||
|
end >>= 12;
|
||||||
|
|
||||||
|
dsb(ishst);
|
||||||
|
for (addr = start; addr < end; addr += 1 << (PAGE_SHIFT - 12))
|
||||||
|
asm("tlbi vaae1is, %0" : : "r"(addr));
|
||||||
|
dsb(ish);
|
||||||
|
isb();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user