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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68978C433EF for ; Sun, 24 Apr 2022 01:16:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A0CB6B0074; Sat, 23 Apr 2022 21:16:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54FE26B0075; Sat, 23 Apr 2022 21:16:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 417C86B0078; Sat, 23 Apr 2022 21:16:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 31CC26B0074 for ; Sat, 23 Apr 2022 21:16:13 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E2F9121A56 for ; Sun, 24 Apr 2022 01:16:12 +0000 (UTC) X-FDA: 79390006584.06.645B58B Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf19.hostedemail.com (Postfix) with ESMTP id 075411A0032 for ; Sun, 24 Apr 2022 01:16:08 +0000 (UTC) Received: from kwepemi500001.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Km9Dj5x1XzfZWc; Sun, 24 Apr 2022 09:15:17 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi500001.china.huawei.com (7.221.188.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 24 Apr 2022 09:16:07 +0800 Received: from [10.174.179.234] (10.174.179.234) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 24 Apr 2022 09:16:06 +0800 Message-ID: <4ee686bc-38d4-7709-30a9-0c807919672a@huawei.com> Date: Sun, 24 Apr 2022 09:16:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH -next v4 1/7] x86, powerpc: fix function define in copy_mc_to_user To: Michael Ellerman , Mark Rutland , James Morse , Andrew Morton , Thomas Gleixner , "Ingo Molnar" , Borislav Petkov , Robin Murphy , Dave Hansen , "Catalin Marinas" , Will Deacon , "Alexander Viro" , Benjamin Herrenschmidt , Paul Mackerras , , "H . Peter Anvin" CC: , , , , Kefeng Wang , Xie XiuQi , Guohanjun References: <20220420030418.3189040-1-tongtiangen@huawei.com> <20220420030418.3189040-2-tongtiangen@huawei.com> <87r15p8n9g.fsf@mpe.ellerman.id.au> From: Tong Tiangen In-Reply-To: <87r15p8n9g.fsf@mpe.ellerman.id.au> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 075411A0032 X-Stat-Signature: p84bd8ukbikkrqck7rcbyu1b471yhust Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of tongtiangen@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=tongtiangen@huawei.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1650762968-691834 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 在 2022/4/22 17:45, Michael Ellerman 写道: > Tong Tiangen writes: >> x86/powerpc has it's implementation of copy_mc_to_user but not use #define >> to declare. >> >> This may cause problems, for example, if other architectures open >> CONFIG_ARCH_HAS_COPY_MC, but want to use copy_mc_to_user() outside the >> architecture, the code add to include/linux/uaddess.h is as follows: >> >> #ifndef copy_mc_to_user >> static inline unsigned long __must_check >> copy_mc_to_user(void *dst, const void *src, size_t cnt) >> { >> ... >> } >> #endif > > The above doesn't exist yet, you add it in patch 3, which is a little > confusing for a reader of this commit in isolation. > > I think you could safely move that into this patch, and then this patch > would be ~= "Add generic fallback version of copy_mc_to_user()". > > It's probably not worth doing a whole new version of the series just for > that, but if you need to do a new version for some other reason I think > it would be cleaner to introduce the fallback in this commit. > Agreed, will do in next version. Thanks, Tong. >> Then this definition will conflict with the implementation of x86/powerpc >> and cause compilation errors as follow: >> >> Fixes: ec6347bb4339 ("x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()") >> Signed-off-by: Tong Tiangen >> --- >> arch/powerpc/include/asm/uaccess.h | 1 + > > Acked-by: Michael Ellerman (powerpc) > > cheers > .