Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp627209pxb; Fri, 22 Apr 2022 08:08:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuSwlg88Tvs+04biGBbjT+E4w20UZPYWfXwiLbOTpTINegPq/t0pYnWxt5tQ3oK3b0pEd7 X-Received: by 2002:a05:6402:5252:b0:423:dba1:3a32 with SMTP id t18-20020a056402525200b00423dba13a32mr5422348edd.269.1650640130921; Fri, 22 Apr 2022 08:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650640130; cv=none; d=google.com; s=arc-20160816; b=yKoPhQWhs1lYAgzLlELIvKwxq0zoHxb/fmD414DPwoqCP22MJBv7NuEtK3sYmcNMU3 /96EyljgsaOXUQlPEwwaFQCdBgYeoNIeiVLN3HFe1AhxuUf7vRYZEDs/Bw1xDnWlDtLl yxmce5nLcBrgpk3PCRGAkgKtOl8S+2VOXCF6Q9Hum1+4p9qB7BT6S4Gu/8B9pO42UN8s 7xZZ78+9uEB9gOf1+9Vq3GBHeOhCN2lmaXsrQ4CHlTD0etH3PrVvK+JBLc/81b3PeoT3 JZuMAUpKvaIaeiX2729HjDrXfIlOa5QOJvD4RmDf79/zrai5fUYsxjGHYgiINpWnrr68 E8EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=Al83ymN/ho4hwVOypF35AMxE9htb4+ARNDtj3dzBOic=; b=fxq/Nvik/ZgfPEhMLBOS6gIEBIzr+fJQjnIziSX8DDVewtTqFXCTOsqZKz60T0o3j0 wuPb1BH6QtFGOaQV0dGrTTZRmFI1bpxff2KvgFpLxwBMlGJnFDsO+g+Ea0NBqUPL4f22 /25/xinjQeWKVS8FzQV9iMYLr83SU53EE5f/53OLpWNOjbq1+IJ9cYXbEeB00vXIK6an hRAcm+QPD8XeyIHAg6RLUkv5a6FRo1JxBhELQZyUwsUNxe5iRMQD/asBTpfozpKShl8B 1xe2w+HFhLRqtoc7OZaVycWdZ2bZjdDTTOnPwcs4R2wXZdwRSzDxTNhXbCI84a3zvKyP 7McQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=n1kiepiJ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li9-20020a170906f98900b006e8c21ffdc7si6720048ejb.221.2022.04.22.08.08.26; Fri, 22 Apr 2022 08:08:50 -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; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=n1kiepiJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446282AbiDVJsl (ORCPT + 99 others); Fri, 22 Apr 2022 05:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446231AbiDVJs2 (ORCPT ); Fri, 22 Apr 2022 05:48:28 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B5BADFF0 for ; Fri, 22 Apr 2022 02:45:35 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Kl8fN2BN9z4xXS; Fri, 22 Apr 2022 19:45:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1650620734; bh=Al83ymN/ho4hwVOypF35AMxE9htb4+ARNDtj3dzBOic=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=n1kiepiJd8a8t0vH2NyNoWar0AsBDtzB1cl/Fh45VwFPT5MK8tw1UTcLX17q8WY8x /7xNsb+93FcFBaFP2NiF6MDx8CcmozeREaY6MkKhoGHeZ6WSWzPS6pQLEicFyeOsx9 zPDp4YE8G3p/q9e27K8R6pmEr5wXLas6eOraWwbg3X4rxYwsOE+1tm9/OZf5rixtcj 3uGlTfzdlC3h1U3DKijnn+wq7uPxly76L8ow24pMuA4Fo1F2wRwKCg5b01JuxaptnE mh318QXvG2BkqiDkZ7wQbm/SqWlTmabZNHKvcn/GTzHYoN9JSHonn/T3uphH5DhXvq Ed1+/nokNrBog== From: Michael Ellerman To: Tong Tiangen , 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 , x86@kernel.org, "H . Peter Anvin" Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Kefeng Wang , Xie XiuQi , Guohanjun , Tong Tiangen Subject: Re: [PATCH -next v4 1/7] x86, powerpc: fix function define in copy_mc_to_user In-Reply-To: <20220420030418.3189040-2-tongtiangen@huawei.com> References: <20220420030418.3189040-1-tongtiangen@huawei.com> <20220420030418.3189040-2-tongtiangen@huawei.com> Date: Fri, 22 Apr 2022 19:45:31 +1000 Message-ID: <87r15p8n9g.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 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. > 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