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 82E44C48260 for ; Thu, 8 Feb 2024 13:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T9jvTg2uv3btc7Ki5IpIYNRv/wQpCp7hGyXFuwdGIQU=; b=BHkPejov3I4Alm DpIpCQ7TIlSsPWclrINmFWRJlXBAF9wHZPYHydgYPbVgk3Xyecsc72Xls6LaHL0FLcV/G9GsXjDsv p+zRqK8PUFogqma184wZybTRofnodkYhTaVFtK+fFu0TIHIPUelo4iXgbzxADSzYdgAxqd6YR9u40 KHzFAuUa+I8c+SNlkQ+0KIOBH9l82d6LcGY9n9QEf3z/n5f+UPcW+g3qrxMLPesOQecbO33X5Qz1N BPb5+BRD9D92wNrbY8SqodvpS3Onin4i8aL9LQlgAQfrm82SsoGvgs3Odqc6c5yYah1icGdFtlD21 Q0zyiylSv0ukIefH190g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY4bp-0000000Duxv-1P4W; Thu, 08 Feb 2024 13:38:33 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY4bm-0000000DuvW-2NrJ for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 13:38:32 +0000 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TVydt3DcKz6K64M for ; Thu, 8 Feb 2024 21:34:58 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 2B2D1140D1A for ; Thu, 8 Feb 2024 21:38:20 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 8 Feb 2024 13:38:19 +0000 Date: Thu, 8 Feb 2024 13:38:18 +0000 From: Jonathan Cameron To: Subject: Re: [PATCH v11 1/5] uaccess: add generic fallback version of copy_mc_to_user() Message-ID: <20240208133818.000009ea@Huawei.com> In-Reply-To: <20240207132204.1720444-2-tongtiangen@huawei.com> References: <20240207132204.1720444-1-tongtiangen@huawei.com> <20240207132204.1720444-2-tongtiangen@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_053830_795791_D5EE5CFE X-CRM114-Status: GOOD ( 12.28 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 7 Feb 2024 21:22:00 +0800 Tong Tiangen wrote: > 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 architectures (only bother fixing if you end up doing a v12 - hence off list reply!) > enable CONFIG_ARCH_HAS_COPY_MC. > > Signed-off-by: Tong Tiangen > Acked-by: Michael Ellerman > --- > arch/powerpc/include/asm/uaccess.h | 1 + > arch/x86/include/asm/uaccess.h | 1 + > include/linux/uaccess.h | 9 +++++++++ > 3 files changed, 11 insertions(+) > > diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h > index f1f9890f50d3..4bfd1e6f0702 100644 > --- a/arch/powerpc/include/asm/uaccess.h > +++ b/arch/powerpc/include/asm/uaccess.h > @@ -381,6 +381,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 long __copy_from_user_flushcache(void *dst, const void __user *src, > diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h > index 5c367c1290c3..fd56282ee9a8 100644 > --- a/arch/x86/include/asm/uaccess.h > +++ b/arch/x86/include/asm/uaccess.h > @@ -497,6 +497,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 3064314f4832..550287c92990 100644 > --- a/include/linux/uaccess.h > +++ b/include/linux/uaccess.h > @@ -205,6 +205,15 @@ 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) > +{ > + check_object_size(src, cnt, true); > + return raw_copy_to_user(dst, src, cnt); > +} > +#endif > + > static __always_inline void pagefault_disabled_inc(void) > { > current->pagefault_disabled++; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel