Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: David Miller <davem@davemloft.net>, leon@kernel.org
Cc: thor.thayer@linux.intel.com, heiko@sntech.de,
	irusskikh@marvell.com, andreas@gaisler.com,
	chris.snook@gmail.com, dave@thedillows.org,
	jes@trained-monkey.org, iyappan@os.amperecomputing.com,
	quan@os.amperecomputing.com, linux-acenic@sunsite.dk,
	andy@greyhouse.net, akiyano@amazon.com,
	linux-rockchip@lists.infradead.org, wens@csie.org,
	LinoSanfilippo@gmx.de, vfalico@gmail.com, kuba@kernel.org,
	thomas.lendacky@amd.com, jcliburn@gmail.com,
	j.vosburgh@gmail.com, keyur@os.amperecomputing.com,
	mripard@kernel.org, pcnet32@frontier.com,
	nios2-dev@lists.rocketboards.org,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, ionut@badula.org,
	netanel@amazon.com, mark.einon@gmail.com
Subject: Re: [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition
Date: Mon, 13 Apr 2020 10:04:52 +0200
Message-ID: <20200413080452.GA3772@zn.tnic> (raw)
In-Reply-To: <20200412.223604.1160930629964379276.davem@davemloft.net>

On Sun, Apr 12, 2020 at 10:36:04PM -0700, David Miller wrote:
> From: Leon Romanovsky <leon@kernel.org>
> 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 <linux/vermagic.h>
drivers/net/ethernet/netronome/nfp/nfp_main.c:17:#include <linux/vermagic.h>

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 <linux/vermagic.h>
+#include <generated/utsrelease.h>
 
 #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 <linux/device.h>
 #include <linux/eisa.h>
 #include <linux/bitops.h>
-#include <linux/vermagic.h>
 
 #include <linux/uaccess.h>
 #include <asm/io.h>
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 <linux/vermagic.h>
 #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 <asm/processor.h>		/* Processor type for cache alignment. */
 #include <linux/uaccess.h>
 #include <asm/io.h>
-#include <linux/vermagic.h>
 
 /*
  * 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 <linux/module.h>
 #include <linux/netdevice.h>
 #include <linux/utsname.h>
-#include <linux/vermagic.h>
+#include <generated/utsrelease.h>
 
 #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 <linux/power_supply.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
-#include <linux/vermagic.h>
+#include <generated/utsrelease.h>
 
 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 <linux/phy.h>
 #include <linux/bitops.h>
 #include <linux/uaccess.h>
-#include <linux/vermagic.h>
 #include <linux/vmalloc.h>
 #include <linux/sfp.h>
 #include <linux/slab.h>
@@ -29,6 +28,8 @@
 #include <net/flow_offload.h>
 #include <linux/ethtool_netlink.h>
 
+#include <generated/utsrelease.h>
+
 #include "common.h"
 
 /*


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply index

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24  8:52 [PATCH net-next v1 00/18] Clean driver, module and FW versions Leon Romanovsky
2020-02-24  8:52 ` [PATCH net-next v1 01/18] net/bond: Delete driver and module versions Leon Romanovsky
2020-02-24  8:52 ` [PATCH net-next v1 02/18] net/dummy: Ditch " Leon Romanovsky
2020-02-24  8:52 ` [PATCH net-next v1 03/18] net/3com: Delete driver and module versions from 3com drivers Leon Romanovsky
2020-04-11 15:56   ` [PATCH] net/3com/3c515: Fix MODULE_ARCH_VERMAGIC redefinition Borislav Petkov
2020-04-11 16:11     ` Leon Romanovsky
2020-04-11 17:35       ` Borislav Petkov
2020-04-11 18:10         ` Leon Romanovsky
2020-04-11 18:41           ` Borislav Petkov
2020-04-13  4:03     ` David Miller
2020-04-13  4:55       ` Leon Romanovsky
2020-04-13  5:07         ` David Miller
2020-04-13  5:26           ` Leon Romanovsky
2020-04-13  5:36             ` David Miller
2020-04-13  8:04               ` Borislav Petkov [this message]
2020-04-13  8:40                 ` Leon Romanovsky
2020-04-14 12:23                   ` Leon Romanovsky
2020-02-24  8:52 ` [PATCH net-next v1 04/18] net/adaptec: Clean driver versions Leon Romanovsky
2020-02-24  8:52 ` [PATCH net-next v1 05/18] net/aeroflex: Clean ethtool_info struct assignments Leon Romanovsky
2020-02-24  8:52 ` [PATCH net-next v1 06/18] net/aeroflex: Don't assign FW if it is not available Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 07/18] net/agere: Delete unneeded driver version Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 08/18] net/alacritech: Delete " Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 09/18] net/allwinner: Remove " Leon Romanovsky
2020-02-24  9:43   ` Maxime Ripard
2020-02-24  8:53 ` [PATCH net-next v1 10/18] net/alteon: Properly report FW version Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 11/18] net/althera: Delete hardcoded driver version Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 12/18] net/amazon: Ensure that driver version is aligned to the linux kernel Leon Romanovsky
2020-02-24  9:03   ` Kiyanovski, Arthur
2020-02-24  9:41     ` Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 13/18] net/amd: Remove useless driver version Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 14/18] net/apm: " Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 15/18] net/apm: Properly mark absence of FW Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 16/18] net/aquantia: Delete module version Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 17/18] net/arc: Delete driver version Leon Romanovsky
2020-02-24  8:53 ` [PATCH net-next v1 18/18] net/atheros: Clean atheros code from " Leon Romanovsky
2020-02-24 18:15   ` Chris Snook
2020-02-24 19:49 ` [PATCH net-next v1 00/18] Clean driver, module and FW versions David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200413080452.GA3772@zn.tnic \
    --to=bp@alien8.de \
    --cc=LinoSanfilippo@gmx.de \
    --cc=akiyano@amazon.com \
    --cc=andreas@gaisler.com \
    --cc=andy@greyhouse.net \
    --cc=chris.snook@gmail.com \
    --cc=dave@thedillows.org \
    --cc=davem@davemloft.net \
    --cc=heiko@sntech.de \
    --cc=ionut@badula.org \
    --cc=irusskikh@marvell.com \
    --cc=iyappan@os.amperecomputing.com \
    --cc=j.vosburgh@gmail.com \
    --cc=jcliburn@gmail.com \
    --cc=jes@trained-monkey.org \
    --cc=keyur@os.amperecomputing.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-acenic@sunsite.dk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.einon@gmail.com \
    --cc=mripard@kernel.org \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=nios2-dev@lists.rocketboards.org \
    --cc=pcnet32@frontier.com \
    --cc=quan@os.amperecomputing.com \
    --cc=thomas.lendacky@amd.com \
    --cc=thor.thayer@linux.intel.com \
    --cc=vfalico@gmail.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git