Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3190613ybb; Mon, 13 Apr 2020 02:41:05 -0700 (PDT) X-Google-Smtp-Source: APiQypKNBUPs3t12zeRJTyATGFgUsi1+GPBY1a3bo0y6XOHB7AhTK2z/82IeH+N6Rj5mQTHYkphr X-Received: by 2002:a05:6402:22cc:: with SMTP id dm12mr4515055edb.159.1586770865001; Mon, 13 Apr 2020 02:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586770864; cv=none; d=google.com; s=arc-20160816; b=0sJfMt611qJlUviGHYtYPzwLFNRO6gKrsS1w4dvjZp+I6zNUktMMLQ7s4y4BK0hN0n UiZZ7zOXffMXoIoaHGhIVpkSVVmtxpMeTTKgxyZnMjo9D85oa/K8dFBF8qfzeeB/q4vE ba+tLb+eYORL/puP8RPqYRMd/OEoyLLnn2m30ZVbs0q8yS8clWWLEd/HGX4MJatQGxYY q0eRyAU2mBDoDyH8Fd5q2aB+SVzfKVqQKpyG6wUTD/A7N3FH+wuYYB1GYFAF7+O5Nu5H 4sa5Bb3U8Mp+6zquH1xMfNTpYKT/5uXRhoZxSvreDWZsWUEztnJTNLwAj+Er+svy6Y0J xb6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NtPO5LzemSA3ICkOs6m1ba4SCa7L4ISc43jbxALQ8Eo=; b=xhmpqRmIqkZ30F9Fdv1eT2ugj83CdvMIglgGsaczGVKN/JC04PCTOXxGO+t1Vwzr+C 1+JfEM2YnAT8qIgF3sIV+GjMAqC//8irLivtgexL32AVCKkvqDosTQ/U8rNA5vaVsQ5M r3FEio6gSOmSaI3TdY7/LKs1sRcwdhKgUE6BBUYKAXiBgPnaVaQdvEyUfL4jVIrkGgI8 dPD6vH8xOhY5vIepZxYcyZE2WSlCfEO0t2SeOBQP3qh24xW1irNncif2namJVsgsTJ0I 0ut2Mx4RkdNt/SWD6zZadNdssd57zPR+q8dD7iBK374lKeFlNBUcnaq1updF1qbiWZ8D 1U5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LiW9TWY6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nw21si891313ejb.6.2020.04.13.02.40.41; Mon, 13 Apr 2020 02:41:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LiW9TWY6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728253AbgDMIfd (ORCPT + 99 others); Mon, 13 Apr 2020 04:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.18]:40938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729277AbgDMILB (ORCPT ); Mon, 13 Apr 2020 04:11:01 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40211C00860E; Mon, 13 Apr 2020 01:04:59 -0700 (PDT) Received: from zn.tnic (p200300EC2F06C9001913BA8A68E69387.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:c900:1913:ba8a:68e6:9387]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id AB4B41EC0C5C; Mon, 13 Apr 2020 10:04:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1586765097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=NtPO5LzemSA3ICkOs6m1ba4SCa7L4ISc43jbxALQ8Eo=; b=LiW9TWY65xGpOpMp70AGqFiT+xVtj2UulV/4AIQ88A2mmw52OenPNvt84zJTmXQ7bqMzGL zhBkQqATm2LMmz85N6xLixb3fl93koLptHv/GK7iGITPLXQOTiYA/vG270sn9ouOu+R2FU JQU+EnPno3Dy9bJNMibbKFZ/Eah3XRc= Date: Mon, 13 Apr 2020 10:04:52 +0200 From: Borislav Petkov To: David Miller , leon@kernel.org Cc: kuba@kernel.org, thomas.lendacky@amd.com, keyur@os.amperecomputing.com, pcnet32@frontier.com, vfalico@gmail.com, j.vosburgh@gmail.com, linux-acenic@sunsite.dk, mripard@kernel.org, heiko@sntech.de, mark.einon@gmail.com, chris.snook@gmail.com, linux-rockchip@lists.infradead.org, iyappan@os.amperecomputing.com, irusskikh@marvell.com, dave@thedillows.org, netanel@amazon.com, quan@os.amperecomputing.com, jcliburn@gmail.com, LinoSanfilippo@gmx.de, linux-arm-kernel@lists.infradead.org, andreas@gaisler.com, andy@greyhouse.net, netdev@vger.kernel.org, thor.thayer@linux.intel.com, linux-kernel@vger.kernel.org, ionut@badula.org, akiyano@amazon.com, jes@trained-monkey.org, nios2-dev@lists.rocketboards.org, wens@csie.org Subject: Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition Message-ID: <20200413080452.GA3772@zn.tnic> References: <20200413045555.GE334007@unreal> <20200412.220739.516022706077351913.davem@davemloft.net> <20200413052637.GG334007@unreal> <20200412.223604.1160930629964379276.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200412.223604.1160930629964379276.davem@davemloft.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 12, 2020 at 10:36:04PM -0700, David Miller wrote: > From: Leon Romanovsky > Date: Mon, 13 Apr 2020 08:26:37 +0300 > > > How do you want us to handle it? Boris resend, me to send, you to fix? > > Anyone other than me can do it ;-) Ok, here's what I'm thinking: that vermagic.h is normally automatically included in the *mod.c as part of the module creation, see add_header() in modpost.c. So then perhaps drivers should not use it directly due to the current inclusion order: linux/module.h includes asm/module.h and that arch-specific header defines MODULE_VERMAGIC* for the respective arch. linux/vermagic.h defines all those fallbacks for those MODULE_VERMAGIC* things and if the inclusion order is swapped - we get the redefinition warning. Yesterday I tried the below - basically get rid of all the remaining includers of linux/vermagic.h but two are left: drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:18:#include drivers/net/ethernet/netronome/nfp/nfp_main.c:17:#include because both use VERMAGIC_STRING directly. So, * one could either allow that and sort the inclusion order so that, for example, asm/module.h includes linux/vermagic.h and thus the fallbacks are there present. or * remove all uses of VERMAGIC_STRING from the drivers, add a header guard which prevents people from using it directly and leave VERMAGIC_STRING only to the internal module machinery in the kernel. Judging by how only a handful of old drivers are even using that, perhaps not too far fetched. In any case, this needs a maintainer decision. Leon, if you wanna do it whatever you guys end up agreeing on, just go ahead and submit the patches - it's not like I don't have anything else on the TODO :-) Just add a Reported-by: me and that should be enough. If you're busy too, lemme know and I'll put it on my todo then. Thx. diff --git a/drivers/net/bonding/bonding_priv.h b/drivers/net/bonding/bonding_priv.h index 45b77bc8c7b3..48cdf3a49a7d 100644 --- a/drivers/net/bonding/bonding_priv.h +++ b/drivers/net/bonding/bonding_priv.h @@ -14,7 +14,7 @@ #ifndef _BONDING_PRIV_H #define _BONDING_PRIV_H -#include +#include #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c index b762176a1406..139d0120f511 100644 --- a/drivers/net/ethernet/3com/3c509.c +++ b/drivers/net/ethernet/3com/3c509.c @@ -85,7 +85,6 @@ #include #include #include -#include #include #include diff --git a/drivers/net/ethernet/3com/3c515.c b/drivers/net/ethernet/3com/3c515.c index 90312fcd6319..47b4215bb93b 100644 --- a/drivers/net/ethernet/3com/3c515.c +++ b/drivers/net/ethernet/3com/3c515.c @@ -22,7 +22,6 @@ */ -#include #define DRV_NAME "3c515" #define CORKSCREW 1 diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c index 2db42211329f..a64191fc2af9 100644 --- a/drivers/net/ethernet/adaptec/starfire.c +++ b/drivers/net/ethernet/adaptec/starfire.c @@ -45,7 +45,6 @@ #include /* Processor type for cache alignment. */ #include #include -#include /* * The current frame processor firmware fails to checksum a fragment diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 588c62e9add7..3ed150512091 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include "ionic.h" #include "ionic_bus.h" diff --git a/drivers/power/supply/test_power.c b/drivers/power/supply/test_power.c index 65c23ef6408d..b3c05ff05783 100644 --- a/drivers/power/supply/test_power.c +++ b/drivers/power/supply/test_power.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include enum test_power_id { TEST_AC, diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 89d0b1827aaf..adab97e500cf 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -29,6 +28,8 @@ #include #include +#include + #include "common.h" /* -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette