Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2696233pxb; Sun, 24 Apr 2022 23:42:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxJz3mr4asZkQ3aaoA4K561xs0y2ayLfKkxhgA7Wqnt8EF3KnAG48lVBik4ZgP7EMjI7Gu X-Received: by 2002:a17:906:9c82:b0:6e1:1d6c:914c with SMTP id fj2-20020a1709069c8200b006e11d6c914cmr14457301ejc.769.1650868952684; Sun, 24 Apr 2022 23:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650868952; cv=none; d=google.com; s=arc-20160816; b=P/5wvNOnh4tPLw/ZJXsRBHsiWFPAcCKzMF5gOUTLfkQgAmPQ4ClfOkvd0HA0LKSo3K NOHr6K0fUtGKl2Aj2zah+95dMm8MmudnTazILrlUC6ppTb8n+kZkZ4zAnvH0oFR8TwfA Vo5ti9bh8cLkEWFumcWashi4ddAtDb58sU4BIWfpSGX+iG5wJCiEIpt6CGs/JGLsxD5l 34JH7x/DHNxL6vRv33Sc7LcM2YPrRUSn7XnP3eq/ZO7Jv87/OqKJ8kPTuVjiQNxnKCIr 1d41+jVVEIgBTm79U4T/6N6WMlrk31pMTJZzJwiwRvHtvtZpVuw3ubg+Vrg1slIMIf1Y jG8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=FkvY7TPyWVMEUy05m17HEaauGoGCp3l316rzixsLmbM=; b=b5Y2xTvPRSt7x4C45eFbq0WIIPG+Kr/TUJcI1qqsmzH1UfteuOgQS84tuTAa4xiApk zSqRq7D4AjNS8gUdlhP5bhmWOnm8itZ//br1hfBMSh9hTBOKP0qHXLdiye3UASncErO0 +5bbTVeCQMxDoNFCZ5PoRFNtSCeODVSE4Zfux62Iof1eGv1vXxWHYloMrfcLzKmbLtGp DqZITrmLT/WSWn6t7oOV1wFVQcw3b6bmpj3nOVgtPD59yTZrnE855p4PGX1ryzH1jbV+ jr+v0H3QDNaWwt2Nwr+eyqWykj7dnYgo20p67d/X8rNgqtrhweUm/sC/V49mW9CW4t6K Cukg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp13-20020a1709073e0d00b006f361442e09si4506193ejc.912.2022.04.24.23.42.08; Sun, 24 Apr 2022 23:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237344AbiDXBTM (ORCPT + 99 others); Sat, 23 Apr 2022 21:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbiDXBTK (ORCPT ); Sat, 23 Apr 2022 21:19:10 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB3430548 for ; Sat, 23 Apr 2022 18:16:10 -0700 (PDT) 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-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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 > .