Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp248828iob; Mon, 2 May 2022 18:29:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYN2KdLepYTDNddkGF5O9GuWzuBcbb/x7reQW/QM+RJAb/c8sU1ghUWXSNOu0x/gEhIIRx X-Received: by 2002:a17:90b:3654:b0:1db:fc80:584d with SMTP id nh20-20020a17090b365400b001dbfc80584dmr2136797pjb.215.1651541392356; Mon, 02 May 2022 18:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651541392; cv=none; d=google.com; s=arc-20160816; b=Efuwrbk4MmZuVr6xRHZlcZweplmtPrnOJuBCYKncCDMo/88xP+fFlMux5lyFHL82r8 t+0ShVk6hk6kIqYuU2G8Ko1qWPz+Zhf2uDfjh5bcBZmdTweGmsG2OwfGaAvnbLi/jXvy K/Xta8MSjTuomN6YbaO8KiBseKUvFiA3RIXc+OGjuq6K1QSM9ds1FdW5rZy/aHsIFxx0 1pa+cafJJhDtvTK2gd4q1pCyj5TdvbZ1Zn2xb5V7FtjxaOPv32HDTNVKBMCoiyVhwirg olBwWVkxIclapF+1Ma44eLWR1eL7zpwBW+dEHiZQSIORIU0n6bdb8gBeuT+/+JNuGLXZ y1lA== 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=vWOcFM12GmyjkpTTUPkPTXraENVv5Tt+n+ZCzzGHEII=; b=i5nf+VZ4N4Fn8v8HnY5Q8DdCD3+5mqtM2nYO9GxM+iRMGtwsur5iK27mxw8FkL5m7c rkbgOdQTIBxyDezwfqiryZxq5eYcjRzrXWdbQUnl5CnsMcXo8Raqxa2kQbnodum8sfwn yDHxzMsNv9WF6Xsd6x4yRerw2zXFWX+e2Rhg6RoySLRucdgQAHqj7Akenp9F1bFBWcld AK0JEjHAbO2jmy8Wa/DUGPXFkpOX+gN+QiDXL9DPIUhm/D5UxxaPU3bGkYE6oa+DW0Dw Agnxnu8Rq/z4cwjKUhMsrv1OmmsJfujd33oKmfGrFVNOqM7t8z7hcA9pk3OGCMEJNGUz bp0A== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j8-20020a170903024800b0015cdfb5dc6asi16973207plh.84.2022.05.02.18.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:29:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BB9745AD2; Mon, 2 May 2022 18:10:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbiECBN2 (ORCPT + 99 others); Mon, 2 May 2022 21:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiECBN1 (ORCPT ); Mon, 2 May 2022 21:13:27 -0400 Received: from szxga01-in.huawei.com (unknown [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878A14F9DD for ; Mon, 2 May 2022 18:09:47 -0700 (PDT) Received: from kwepemi500005.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kshb26v1KzfbDB; Tue, 3 May 2022 09:05:18 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by kwepemi500005.china.huawei.com (7.221.188.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 3 May 2022 09:06:20 +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; Tue, 3 May 2022 09:06:18 +0800 Message-ID: <48f2779d-bc62-c7f5-c40e-7238a16b90fb@huawei.com> Date: Tue, 3 May 2022 09:06:18 +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: Christophe Leroy , Mark Rutland , James Morse , Andrew Morton , Thomas Gleixner , "Ingo Molnar" , Borislav Petkov , Robin Murphy , Dave Hansen , "Catalin Marinas" , Will Deacon , "Alexander Viro" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "x86@kernel.org" , "H . Peter Anvin" CC: Kefeng Wang , Xie XiuQi , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Guohanjun , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" References: <20220420030418.3189040-1-tongtiangen@huawei.com> <20220420030418.3189040-2-tongtiangen@huawei.com> <91011a66-b125-b445-1486-bada8e06b994@csgroup.eu> From: Tong Tiangen In-Reply-To: <91011a66-b125-b445-1486-bada8e06b994@csgroup.eu> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/5/2 22:24, Christophe Leroy 写道: > > > Le 20/04/2022 à 05:04, Tong Tiangen a écrit : >> 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 >> >> 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}()") > > I don't understand, what does it fix really ? What was the > (existing/real) bug introduced by that patch and that your are fixing ? > > If those defined had been expected and missing, we would have had a > build failure. If you have one, can you describe it ? There will be build failure after patch 3 is added, there is a little confusing for a reader of this commit in isolation. In the next version, I will put this patch after patch 3. Thanks, Tong. > >> Signed-off-by: Tong Tiangen >> --- >> arch/powerpc/include/asm/uaccess.h | 1 + >> arch/x86/include/asm/uaccess.h | 1 + >> 2 files changed, 2 insertions(+) >> >> diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h >> index 9b82b38ff867..58dbe8e2e318 100644 >> --- a/arch/powerpc/include/asm/uaccess.h >> +++ b/arch/powerpc/include/asm/uaccess.h >> @@ -358,6 +358,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 f78e2b3501a1..e18c5f098025 100644 >> --- a/arch/x86/include/asm/uaccess.h >> +++ b/arch/x86/include/asm/uaccess.h >> @@ -415,6 +415,7 @@ copy_mc_to_kernel(void *to, const void *from, unsigned len); >> >> unsigned long __must_check >> copy_mc_to_user(void *to, const void *from, unsigned len); >> +#define copy_mc_to_user copy_mc_to_user >> #endif >> >> /*