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 2F6C3CD98E2 for ; Thu, 18 Jun 2026 09:21:54 +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=6un6F2K1+9bVVXAABMFiwJ4ZramfbH6V/AyfeI0rqSk=; b=qGsOAiMopZndL2fERZtCFobW4K izV/e4xsy+TResc6SBzOjNpvtgbhel2aUNpI+KpmO5hdmNakn7u9kjVYxcDJaB0r2wqOCUYc+sbt8 zK0IvaQvj/y8SfUdMrQGbUBt3QYpff02W/H8ZGYnJfKH9kDct9E6VjfEVtkIqDt3wKfEq5dFhwehj VRF6QUXhXRzJpgb4Y/p8ggngWU7au6qBcfHykX8JDoRGfGqxhtrqgkUJfmcIJzVVzBPQLY8EtTK54 deMVLQ2100imkS+BXoE3acEME+6cYOrpGeItBojthPRQGD7lRFrYr1e46yAeixhciM9LbfhPGzj3Q RuFZxZhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wa8wV-00000000vLe-3Lu7; Thu, 18 Jun 2026 09:21:47 +0000 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wa8wS-00000000vK0-33tK for linux-arm-kernel@lists.infradead.org; Thu, 18 Jun 2026 09:21:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1781774502; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=6un6F2K1+9bVVXAABMFiwJ4ZramfbH6V/AyfeI0rqSk=; b=sCBh+5z6OkwbxSYZsTTwAxM/PluFadfA1LIQCwrS067qIqIgsZJbqw+L4QETSjSmwzXh5jDu3kQmeRxnTPaYwULe5d4dxQBcu4J1EF6rGBXu0LhEzsbbpRiP7h7W+vzGlF5St+qzaJsNTy6fWVrjRC8rVlKCcNrFjhoIUgByQs0= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R521e4;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_---0X56USpv_1781774495; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0X56USpv_1781774495 cluster:ay36) by smtp.aliyun-inc.com; Thu, 18 Jun 2026 17:21:38 +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 v15 1/9] uaccess: add generic fallback version of copy_mc_to_user() Date: Thu, 18 Jun 2026 17:21:15 +0800 Message-ID: <20260618092124.3901230-2-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260618092124.3901230-1-tianruidong@linux.alibaba.com> References: <20260618092124.3901230-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-20260618_022144_927996_D89F3D3A X-CRM114-Status: UNSURE ( 7.79 ) 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 Reviewed-by: Shuai Xue --- 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..13b4a3a15437 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 __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.39.3