Commit d689cd1c authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

mm/hwpoison: arm64: introduce copy_mc_highpage

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8K5CO



--------------------------------

Introduce copy_mc_highpage for arm64 to support do_mte.

Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent 934692a4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ void copy_highpage(struct page *to, struct page *from);
#ifdef CONFIG_ARCH_HAS_COPY_MC
extern void copy_page_mc(void *to, const void *from);
void copy_highpage_mc(struct page *to, struct page *from);
int copy_mc_highpage(struct page *to, struct page *from);
#define __HAVE_ARCH_COPY_HIGHPAGE_MC

void copy_user_highpage_mc(struct page *to, struct page *from,
+13 −0
Original line number Diff line number Diff line
@@ -61,4 +61,17 @@ void copy_user_highpage_mc(struct page *to, struct page *from,
	flush_dcache_page(to);
}
EXPORT_SYMBOL_GPL(copy_user_highpage_mc);

int copy_mc_highpage(struct page *to, struct page *from)
{
	void *kto = page_address(to);
	void *kfrom = page_address(from);
	int ret;

	ret = copy_mc_to_kernel(kto, kfrom, PAGE_SIZE);
	if (!ret)
		do_mte(to, from, kto, kfrom, true);

	return ret;
}
#endif
+2 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ static inline void memcpy_to_page(struct page *page, size_t offset,
}

#ifdef copy_mc_to_kernel
#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE_MC
/*
 * If architecture supports machine check exception handling, define the
 * #MC versions of copy_user_highpage and copy_highpage. They copy a memory
@@ -416,6 +417,7 @@ static inline int copy_mc_highpage(struct page *to, struct page *from)

	return ret;
}
#endif
#else
static inline int copy_mc_highpage(struct page *to, struct page *from)
{