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

mm: Update PF_COREDUMP_MCS to PF_MCS

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



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

Update PF_COREDUMP_MCS to PF_MCS to indicate machine check safe support
for specific functions.

Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent 17d08829
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -907,9 +907,9 @@ int dump_user_range(struct coredump_params *cprm, unsigned long start,
		if (page) {
			void *kaddr = kmap(page);

			current->flags |= PF_COREDUMP_MCS;
			current->flags |= PF_MCS;
			stop = !dump_emit(cprm, kaddr, PAGE_SIZE);
			current->flags &= ~PF_COREDUMP_MCS;
			current->flags &= ~PF_MCS;
			kunmap(page);
			put_page(page);
		} else {
+1 −1
Original line number Diff line number Diff line
@@ -1661,7 +1661,7 @@ extern struct pid *cad_pid;
#define PF_KTHREAD		0x00200000	/* I am a kernel thread */
#define PF_RANDOMIZE		0x00400000	/* Randomize virtual address space */
#define PF_SWAPWRITE		0x00800000	/* Allowed to write to swap */
#define PF_COREDUMP_MCS		0x01000000      /* Task coredump support machine check safe */
#define PF_MCS			0x01000000	/* Mc is support for specific function(eg. coredump) for this task */
#define PF_NO_SETAFFINITY	0x04000000	/* Userland is not allowed to meddle with cpus_mask */
#define PF_MCE_EARLY		0x08000000      /* Early kill for mce process policy */
#define PF_MEMALLOC_NOCMA	0x10000000	/* All allocation request will have _GFP_MOVABLE cleared */
+1 −1
Original line number Diff line number Diff line
@@ -752,7 +752,7 @@ EXPORT_SYMBOL_GPL(_copy_mc_to_iter);

static void *memcpy_iter(void *to, const void *from, __kernel_size_t size)
{
	if (IS_ENABLED(CONFIG_ARCH_HAS_COPY_MC) && current->flags & PF_COREDUMP_MCS)
	if (IS_ENABLED(CONFIG_ARCH_HAS_COPY_MC) && current->flags & PF_MCS)
		return (void *)copy_mc_to_kernel(to, from, size);
	else
		return memcpy(to, from, size);