From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.98 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796433911; b=jcZiXxKvEsxbPj8sUqyoogtCp37zxajiNTIRlVITpNh0z/J/+oIMUnmnUQz3vYyenrYe XFjmwOxCeuFbTj18doYNJfxjBy1OLDo81EGuHzhA0BwDbDFkX8Ao0Vr4DdBdBdQhnVM5/ QKO9zuMS6pzkBNHeQKKviExVY2qp4CkKZ6hkZ1y5MgH0t6xqITYV4Emej8FKD/Ek4+hDU wmbpT8SOC40ekJZlTBJ//4Ndrxe36yA6cJDIe5psOhiB8NllaGER8ghaUcfu98bxikK8/ fjqiuZlYwhuVQuu9LOnEinprQvcXtgEDasF4NWR2Ph0NlmY7IGpvHaeIQmYksEMwziQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796433911; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=iOokoGKHnb8yIeIJYdAznffFY9uZeenco4bTdXyTGg8=; b=FVUJhhRyFJ52eP4oLIG1v592uYRLFY05Nipnchd0gxL7dnfPjN86GpGijAi5zOgF2ZwR IvsviT4wK5fm13+8tWeGRj8XxwkkgA87r7LyoZZmhoRDh9zdPLGxyuov36rSo5dvNHId4 mmWL5PB/59Fa4Q7k9AS5IVOqgIEiK81cfl4+PsuuBZnHfcZ3OZkiqcwVXZQF6vcku4VCJ gckRVBP9Wv1GRDc//BPcYi4Mcq1G0Z6vLwbW78GsvPjc2Bd2DTLwS/6oep5a82Iktg6TM DWCnq01B1h7N1VhkYmh+8WSyB+N4gQAGCrQctE5Vc6qVZpxXrZr8f9/AVxEqXYRFg1A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=Kv7ShQW+; arc=none smtp.remote-ip=115.124.30.98 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C79BC606A32D; Sat, 5 Dec 2026 01:25:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C79BC606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=Kv7ShQW+ DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796433902; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=iOokoGKHnb8yIeIJYdAznffFY9uZeenco4bTdXyTGg8=; b=Kv7ShQW+ccxj6DIJUEcqDrHwARn4frhZcVGzXpmXf6qnyIObRiTWXgJHkLLDKM8AhVgPB3nxYykeIqHpne6G0uxqGxEb84syWjNuCBX9hN7LMrrWZqfRGNsA2O18hVnCRPemwLldyvscmDURM1lhm5G0GuzwzbyEdKBvvcJgmRc= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=jiangtianfeng@linux.alibaba.com;NM=1;PH=DS;RN=75;SR=0;TI=SMTPD_---0XGISF14_1796433893; Received: from h68d07384.sqa.eu95.tbsite.net(mailfrom:jiangtianfeng@linux.alibaba.com fp:SMTPD_---0XGISF14_1796433893 cluster:ay36) by smtp.aliyun-inc.com; Sat, 05 Dec 2026 09:24:58 +0800 From: Jiangtian Feng To: catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, rafael@kernel.org Cc: mark.rutland@arm.com, james.morse@arm.com, robin.murphy@arm.com, nikumbh.adi@gmail.com, tony.luck@intel.com, guohanjun@huawei.com, mchehab@kernel.org, lenb@kernel.org, xueshuai@linux.alibaba.com, tongtiangen@huawei.com, tianruidong@linux.alibaba.com, tongweilin@linux.alibaba.com, baolin.wang@linux.alibaba.com, ashok.raj@oss.qualcomm.com, jonathan.cameron@oss.qualcomm.com, david@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, mhocko@suse.com, ljs@kernel.org, surenb@google.com, shivankg@amd.com, wangkefeng.wang@huawei.com, xiangzao@linux.alibaba.com, ying.huang@linux.alibaba.com, linmiaohe@huawei.com, nao.horiguchi@gmail.com, ziy@nvidia.com, tujinjiang@huawei.com, mgorman@techsingularity.net, kaitao.cheng@linux.dev, chengkaitao@kylinos.cn, muchun.song@linux.dev, nico.pache@linux.dev, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev, usama.arif@linux.dev, kas@kernel.org, kees@kernel.org, andreyknvl@gmail.com, dvyukov@google.com, glider@google.com, ryabinin.a.a@gmail.com, vincenzo.frascino@arm.com, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com, sshegde@linux.ibm.com, aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Jonathan Cameron , Jiangtian Feng Subject: [PATCH v16 1/9] uaccess: add generic fallback version of copy_mc_to_user() Date: Sat, 5 Dec 2026 09:24:26 +0800 Message-ID: <20261205012435.1406255-2-jiangtianfeng@linux.alibaba.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261205012435.1406255-1-jiangtianfeng@linux.alibaba.com> References: <20261205012435.1406255-1-jiangtianfeng@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Tong Tiangen x86/powerpc has it's implementation of copy_mc_to_user(), we add generic fallback in include/linux/uaccess.h prepare for other architechures to enable CONFIG_ARCH_HAS_COPY_MC. Signed-off-by: Tong Tiangen Acked-by: Michael Ellerman Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Shuai Xue Signed-off-by: Jiangtian Feng --- arch/powerpc/include/asm/uaccess.h | 1 + arch/x86/include/asm/uaccess.h | 1 + include/linux/uaccess.h | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 49039074b33f..be6430a230c1 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -458,6 +458,7 @@ copy_mc_to_user(void __user *to, const void *from, unsigned long n) return n; } +#define copy_mc_to_user copy_mc_to_user #endif extern size_t copy_from_user_flushcache(void *dst, const void __user *src, size_t size); diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index f4700ad6b5ec..7a69d407eb3c 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -442,6 +442,7 @@ copy_mc_to_kernel(void *to, const void *from, unsigned len); unsigned long __must_check copy_mc_to_user(void __user *to, const void *from, unsigned len); +#define copy_mc_to_user copy_mc_to_user #endif /* diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 67cdb0a4f583..689604cb590c 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -243,6 +243,14 @@ copy_mc_to_kernel(void *dst, const void *src, size_t cnt) } #endif +#ifndef copy_mc_to_user +static inline unsigned long __must_check +copy_mc_to_user(void __user *dst, const void *src, unsigned long cnt) +{ + return copy_to_user(dst, src, cnt); +} +#endif + static __always_inline void pagefault_disabled_inc(void) { current->pagefault_disabled++; -- 2.47.3