Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2980179rwd; Wed, 14 Jun 2023 09:36:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SLCJrnlmuwurHS1ueFbvVA1kkLcbd3vNCtRP7HCQOyjH2kaSOlRBT4vRMBbbHt37YQ6pN X-Received: by 2002:a17:906:dac8:b0:94f:6218:191f with SMTP id xi8-20020a170906dac800b0094f6218191fmr14941243ejb.52.1686760576540; Wed, 14 Jun 2023 09:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686760576; cv=none; d=google.com; s=arc-20160816; b=JyeIXbTIVrNIJwqOL0b5ivBXARdqLTpHqWjZFVi4+2gPsrzAeC3BRBvd1fnC22V2qo nRuQ92dA/WrusnkYiUbyhvlryexZdven5t7LXMO9NjDCUQImdftt+1kf/Fq3TZZq3ku2 2iOC/2BIKrl53zd9taFVnvJGkvYoy9R5YO8ngr3pWVJfbVYl6LzZIFpAkrn+jPT9lVJh uDTO2ax9k/4GVibW1xRxCoLm7uG4Wx3nSkoqyCisQF66fCz52aClVmSkSArgfGh+i4Dh jTyHe7XlsOeUiaqVEZpEySpDMQ3+SFGyzrDjp1HUJptDBezGPQKMAwF9Usa1PEyhpVRD bjiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QWph71KWV3aPlqaV648UJHe6lbKZBpXdiDZJikc9zP8=; b=1I7yQIbEiNYdwS7BFUvIWMoV3dttSmZYtXJo8P805X7B5aJFlGp7M6mHTpc4IaJ2fV eDRiqnJC2itT94MCyVTdcZ57mSZ7eovWXTfj7gnxP+0BQ19fea0hjBcmZGyaGmL+g9Ot zXChih41zBgOoGkSRu5ydafBIVT1ckOdhPYLpf6QpS9vpAbkZJr9xepblHhIRu65VkQ6 N+vgYasffS+x5nf5J4S6bK0hi4l/KF4LOa5i4DGZPTuWA7aUe0XnVozqcMutYyu3yGiC Joixhs2NWs/NU9O2Xt+YCkPsJAT4FRjg/XzNDHQOEcPDDjz3LC+zzFgBr66CcV9PiytJ Rd7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=y45S5FcB; 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=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a17090681ce00b009745eb6cf86si7600314ejx.895.2023.06.14.09.35.47; Wed, 14 Jun 2023 09:36:16 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=y45S5FcB; 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=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbjFNQV6 (ORCPT + 99 others); Wed, 14 Jun 2023 12:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232936AbjFNQVw (ORCPT ); Wed, 14 Jun 2023 12:21:52 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E600119; Wed, 14 Jun 2023 09:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QWph71KWV3aPlqaV648UJHe6lbKZBpXdiDZJikc9zP8=; b=y45S5FcBhDXz+6NaXk1EUEetiF Vc+jk0MdpAtlg8qedoWjj6F9Zx4e7xguW8BAmEOEp2GikxxxOl8ZPV+zZLnrJHFphEVu89yYUHoBx jstoLPfDBdQt0YvbHkJXz+4agTaR9PuMcHXVI8Y2hNpO7BS0uy8Y5tjm/p1WiXvAzk8peUiqaC96g xBNo9bbF9J22MdPpTtUQMn81sfT+5ZQf2AlSOLPl0F3Zz5wrboKUSmlEqBtkYxQnJbPVMTCaBSyiA C4rKMZGYgpFMuo6t/mXfVKG/Hag5OHRTOMQcKuZ7x7FsbtDy91b7kpYYA/0z4gl395hb8tiN0gCEy UljwbNjQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51956) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q9TFi-0001xs-6h; Wed, 14 Jun 2023 17:21:46 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q9TFf-0000Yu-9i; Wed, 14 Jun 2023 17:21:43 +0100 Date: Wed, 14 Jun 2023 17:21:43 +0100 From: "Russell King (Oracle)" To: AngeloGioacchino Del Regno Cc: Wei-chin Tsai =?utf-8?B?KOiUoee2reaZiSk=?= , "linux-kernel@vger.kernel.org" , Mel Lee =?utf-8?B?KOadjuWlh+mMmik=?= , "linux-mediatek@lists.infradead.org" , wsd_upstream , "linux-arm-kernel@lists.infradead.org" , "linux-fsdevel@vger.kernel.org" , "matthias.bgg@gmail.com" , Ivan Tseng =?utf-8?B?KOabvuW/l+i7kik=?= Subject: Re: [PATCH v2 2/3] memory: export symbols for memory related functions Message-ID: References: <20230614032038.11699-1-Wei-chin.Tsai@mediatek.com> <20230614032038.11699-3-Wei-chin.Tsai@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, Jun 14, 2023 at 02:11:25PM +0200, AngeloGioacchino Del Regno wrote: > Il 14/06/23 11:59, Wei-chin Tsai (蔡維晉) ha scritto: > > On Wed, 2023-06-14 at 08:16 +0100, Russell King (Oracle) wrote: > > > > > > External email : Please do not click links or open attachments until > > > you have verified the sender or the content. > > > On Wed, Jun 14, 2023 at 11:20:34AM +0800, Wei Chin Tsai wrote: > > > > diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c > > > > index 0e8ff85890ad..df91412a1069 100644 > > > > --- a/arch/arm/kernel/process.c > > > > +++ b/arch/arm/kernel/process.c > > > > @@ -343,6 +343,7 @@ const char *arch_vma_name(struct vm_area_struct > > > *vma) > > > > { > > > > return is_gate_vma(vma) ? "[vectors]" : NULL; > > > > } > > > > +EXPORT_SYMBOL_GPL(arch_vma_name); > > > ... > > > > diff --git a/kernel/signal.c b/kernel/signal.c > > > > index b5370fe5c198..a1abe77fcdc3 100644 > > > > --- a/kernel/signal.c > > > > +++ b/kernel/signal.c > > > > @@ -4700,6 +4700,7 @@ __weak const char *arch_vma_name(struct > > > vm_area_struct *vma) > > > > { > > > > return NULL; > > > > } > > > > +EXPORT_SYMBOL_GPL(arch_vma_name); > > > > > > Have you confirmed: > > > 1) whether this actually builds > > > 2) whether this results in one or two arch_vma_name exports > > > > > > ? > > > > > > -- > > > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > > > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! > > > > Hi Russell, > > > > We did confirm that it can be built successfully in kernel 6.1 and run > > well in our system. > > > > It runs well in your system and can be built successfully because you're building > for ARM64, not for ARM... > > > Actually, we only use this export symbol "arch_vma_name" > > from kernel/signal.c in arm64. We also export symbol for arch_vma_name > > in arch/arm/kernel/process.c because that, one day in the future, we > > are afraid that we also need this function in arm platform. What I'm trying to get at is that we have arch_vma_name in arch/arm/kernel/process.c and also a weak function in kernel/signal.c. Both of these end up adding an entry into the __ksymtab_strings section and a ___ksymtab section for this symbol. So we end up with two entries in each. Now, if the one from kernel/signal.c points at its own weak function, and that is found first, then that's the function that is going to be bound, not the function that's overriding it. If, instead, the export in kernel/signal.c ends up pointing at the overriden function, then the export in arch/arm/kernel/process.c is entirely redundant. So, you need to get to the bottom of this... and until you do I'm afraid I'll have to NAK this patch. For the record, I suspect it's the latter scenario (we end up with two entries pointing at the same function) but that's nothing more than a hunch. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!