From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C404CD4F3C for ; Mon, 18 May 2026 08:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=snbZ8y+F0BUU/EmaB78zaC79H5axWqPJEhlqfbfpDD4=; b=WPR6K/fR7wOBY7A7eabHSXcivQ PFcn0Rg/ccKX6gCZQ/a4OGytLtvsrkaaj4V+5ssmjwBY3gNneRUqzxJB2/XMjaL44DRwLvSz8iGBh KRrWg+9tW0pH+lqBH0PKV18C50A6hC6cLGYg/IZMtRu4vqe/X8LC8jNi+srEROePz29qaMuwziuGw ToLGy2kYqNLNxPz9XQX3HEi8rrf0TRXqg2zfqQvj/XIdj+wsZwoOmGvb5zYBCodB2k8utpEh6vElN m4JDB/1DDwJ/E8o0DtYdt3+Wlt4g0gn4amRUZ1c2IXKHeGtqGNgUuesd53Fybn8j7D4ZLuPZpyu+/ GJeOAzsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wOtgE-0000000Eslg-2tyX; Mon, 18 May 2026 08:50:31 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wOtgC-0000000Esiu-08xj for linux-arm-kernel@bombadil.infradead.org; Mon, 18 May 2026 08:50:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=snbZ8y+F0BUU/EmaB78zaC79H5axWqPJEhlqfbfpDD4=; b=RFo4XpDQWetWoLEtQuFPyHNGAp 8PIalBpzhtLdameIO7PCgnl1BnNQJwzx0EZHpcJ3Xq5A6THtbL1wiVAg24xx/l1h0nEMOQK3a6PUw UgkAX3Gr/wlB0UwitBzsF5TDtmfF/UXSo2+QsOlLHX2kgJufcjNuMZ540W3MP8wTTkRfocge6lKDI hQA0Xd7p01icPmX+E3hNAm0oOgJHxe7Ymbf1/k/aoJVPzi2sGY22qe8s6v3w1h+vu6i4fJfXzD72F 9u7UJO8ifE7kt+IhiFGNC0GWOLgLX86yuLrN54mI2j6tweWSOoJ3YZhKV55zOTF9s7aqZCJPCtK9n F/zD5kaw==; Received: from out199-18.us.a.mail.aliyun.com ([47.90.199.18]) by desiato.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wOtg7-0000000ASG2-2wj7 for linux-arm-kernel@lists.infradead.org; Mon, 18 May 2026 08:50:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1779094211; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=snbZ8y+F0BUU/EmaB78zaC79H5axWqPJEhlqfbfpDD4=; b=XMrFZSScIc7Q57t3W910PJKIsTV8NDooSzy9U+udtoNOKfbS6MaMia36N0vTRJ6P9KqXJzhi3kYBjqTuoi7wJVtoaQ0YaWM+BuncmyCZ0hn5Y13H8e6qiyXgkreurKM5aUu+VbTLSjM1BCiJ56XM/RnSZAZKflZcMYYDtdCf4QQ= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R301e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=30;SR=0;TI=SMTPD_---0X3647I9_1779094202; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0X3647I9_1779094202 cluster:ay36) by smtp.aliyun-inc.com; Mon, 18 May 2026 16:50:04 +0800 From: Ruidong Tian To: catalin.marinas@arm.com, will@kernel.org, rafael@kernel.org, tony.luck@intel.com, guohanjun@huawei.com, mchehab@kernel.org, xueshuai@linux.alibaba.com, tongtiangen@huawei.com, james.morse@arm.com, robin.murphy@arm.com, andreyknvl@gmail.com, dvyukov@google.com, vincenzo.frascino@arm.com, mpe@ellerman.id.au, npiggin@gmail.com, ryabinin.a.a@gmail.com, glider@google.com, christophe.leroy@csgroup.eu, aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com, tglx@linutronix.de, mingo@redhat.com Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, tianruidong@linux.alibaba.com, Mauro Carvalho Chehab , Jonathan Cameron Subject: [PATCH v14 1/8] uaccess: add generic fallback version of copy_mc_to_user() Date: Mon, 18 May 2026 16:49:45 +0800 Message-ID: <20260518084956.2538442-2-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260518084956.2538442-1-tianruidong@linux.alibaba.com> References: <20260518084956.2538442-1-tianruidong@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260518_095024_653911_C75CE569 X-CRM114-Status: UNSURE ( 7.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 e98c628e3899..073de098d45a 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -432,6 +432,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 3a0dd3c2b233..308b0854d1d5 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -496,6 +496,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 56328601218c..c53a65394f80 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -250,6 +250,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 *dst, const void *src, size_t cnt) +{ + return copy_to_user(dst, src, cnt); +} +#endif + static __always_inline void pagefault_disabled_inc(void) { current->pagefault_disabled++; -- 2.39.3