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 CFF10C433F5 for ; Fri, 22 Apr 2022 09:45:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 586C36B0075; Fri, 22 Apr 2022 05:45:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 510556B007B; Fri, 22 Apr 2022 05:45:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D8236B007D; Fri, 22 Apr 2022 05:45:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 2DC4C6B0075 for ; Fri, 22 Apr 2022 05:45:38 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 9BC0380F7B for ; Fri, 22 Apr 2022 09:45:37 +0000 (UTC) X-FDA: 79384032714.07.7BF2659 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by imf19.hostedemail.com (Postfix) with ESMTP id 1D0E01A0027 for ; Fri, 22 Apr 2022 09:45:33 +0000 (UTC) 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-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1D0E01A0027 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b=n1kiepiJ; dmarc=none; spf=pass (imf19.hostedemail.com: domain of mpe@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=mpe@ellerman.id.au X-Stat-Signature: co9x81sqyzrt8jrgzqgt4wbxtwzc8oim X-HE-Tag: 1650620733-938314 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: 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