mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
powerpc/powernv/memtrace: Let the arch hotunplug code flush cache
[ Upstream commit 7fd6641de28fe9b5bce0c38d2adee0a72a72619e ] Don't do this via custom code, instead now that we have support in the arch hotplug/hotunplug code, rely on those routines to do the right thing. The existing flush doesn't work because it uses ppc64_caches.l1d.size instead of ppc64_caches.l1d.line_size. Fixes: 9d5171a8f248 ("powerpc/powernv: Enable removal of memory for in memory tracing") Signed-off-by: Balbir Singh <bsingharora@gmail.com> Reviewed-by: Rashmica Gupta <rashmica.g@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a4fa9189d6
commit
b0471926ce
@ -82,19 +82,6 @@ static const struct file_operations memtrace_fops = {
|
|||||||
.open = simple_open,
|
.open = simple_open,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void flush_memory_region(u64 base, u64 size)
|
|
||||||
{
|
|
||||||
unsigned long line_size = ppc64_caches.l1d.size;
|
|
||||||
u64 end = base + size;
|
|
||||||
u64 addr;
|
|
||||||
|
|
||||||
base = round_down(base, line_size);
|
|
||||||
end = round_up(end, line_size);
|
|
||||||
|
|
||||||
for (addr = base; addr < end; addr += line_size)
|
|
||||||
asm volatile("dcbf 0,%0" : "=r" (addr) :: "memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int check_memblock_online(struct memory_block *mem, void *arg)
|
static int check_memblock_online(struct memory_block *mem, void *arg)
|
||||||
{
|
{
|
||||||
if (mem->state != MEM_ONLINE)
|
if (mem->state != MEM_ONLINE)
|
||||||
@ -132,10 +119,6 @@ static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages)
|
|||||||
walk_memory_range(start_pfn, end_pfn, (void *)MEM_OFFLINE,
|
walk_memory_range(start_pfn, end_pfn, (void *)MEM_OFFLINE,
|
||||||
change_memblock_state);
|
change_memblock_state);
|
||||||
|
|
||||||
/* RCU grace period? */
|
|
||||||
flush_memory_region((u64)__va(start_pfn << PAGE_SHIFT),
|
|
||||||
nr_pages << PAGE_SHIFT);
|
|
||||||
|
|
||||||
lock_device_hotplug();
|
lock_device_hotplug();
|
||||||
remove_memory(nid, start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
|
remove_memory(nid, start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
|
||||||
unlock_device_hotplug();
|
unlock_device_hotplug();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user