Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] Compile of out-of-tree 'ice' driver fails on 32 bit
@ 2023-11-30 18:49 tedheadster
  2023-12-01  7:47 ` Przemek Kitszel
  0 siblings, 1 reply; 4+ messages in thread
From: tedheadster @ 2023-11-30 18:49 UTC (permalink / raw)
  To: intel-wired-lan

Has anyone tried compiling the out-of-tree kernel network software
for the 'ice' driver on 32 bit i386? I tried it for the
long-term-support 5.10.197 kernel and got these compile time errors:

$ make ARCH=i386 CFLAGS_EXTRA="-DGNSS_SUPPORT"
make  ccflags-y="-DGNSS_SUPPORT -DUSE_INTEL_AUX_BUS" -C
"/lib/modules/5.10.197.i686-pentium4-mpentium4-lenovo/source"
CONFIG_ICE=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL=
M="/tmp/ice-1.11.14/src"   NEED_AUX_BUS="2"  modules
  CC [M]  /tmp/ice-1.11.14/src/ice_main.o
In file included from /tmp/ice-1.11.14/src/kcompat.h:3351,
                 from /tmp/ice-1.11.14/src/ice.h:7,
                 from /tmp/ice-1.11.14/src/ice_main.c:8:
/tmp/ice-1.11.14/src/kcompat_impl.h:851:20: error: redefinition of
‘eth_hw_addr_set’
  851 | static inline void eth_hw_addr_set(struct net_device *dev,
const u8 *addr)
      |                    ^~~~~~~~~~~~~~~
In file included from /tmp/ice-1.11.14/src/kcompat.h:16:
./include/linux/etherdevice.h:309:20: note: previous definition of
‘eth_hw_addr_set’ with type ‘void(struct net_device *, const u8 *)’
{aka ‘void(struct net_device *, const unsigned char *)’}
  309 | static inline void eth_hw_addr_set(struct net_device *dev,
const u8 *addr)
      |                    ^~~~~~~~~~~~~~~
In file included from ./include/linux/bits.h:6,
                 from ./include/linux/bitops.h:5,
                 from ./include/linux/kernel.h:12,
                 from ./include/asm-generic/bug.h:20,
                 from ./arch/x86/include/asm/bug.h:93,
                 from ./include/linux/bug.h:5,
                 from ./include/linux/io.h:11,
                 from /tmp/ice-1.11.14/src/kcompat.h:13:
/tmp/ice-1.11.14/src/ice_main.c: In function ‘ice_pf_fwlog_is_input_valid’:
./include/vdso/bits.h:7:40: warning: left shift count >= width of type
[-Wshift-count-overflow]
    7 | #define BIT(nr)                 (UL(1) << (nr))
      |                                        ^~
/tmp/ice-1.11.14/src/ice_main.c:5992:23: note: in expansion of macro ‘BIT’
 5992 |         if (events >= BIT(ICE_AQC_FW_LOG_ID_MAX)) {
      |                       ^~~
./include/vdso/bits.h:7:40: warning: left shift count >= width of type
[-Wshift-count-overflow]
    7 | #define BIT(nr)                 (UL(1) << (nr))
      |                                        ^~
./include/linux/dev_printk.h:112:39: note: in expansion of macro ‘BIT’
  112 |         _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
      |                                       ^~~~~~~~~~~
/tmp/ice-1.11.14/src/ice_main.c:5993:17: note: in expansion of macro ‘dev_err’
 5993 |                 dev_err(ice_pf_to_dev(pf), "Invalid FW log
events 0x%lx, all FW log event bits >= 0x%lx are invalid\n",
      |                 ^~~~~~~
make[2]: *** [scripts/Makefile.build:286:
/tmp/ice-1.11.14/src/ice_main.o] Error 1
make[1]: *** [Makefile:1832: /tmp/ice-1.11.14/src] Error 2
make: *** [Makefile:149: all] Error 2

I know 32bit is officially unsupported, but it seems like it should
not break the compile this badly. I'm running on 32bit as a GNSS time
server, I'm not trying to use the high speed capabilities of the NIC.

- Matthew
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] Compile of out-of-tree 'ice' driver fails on 32 bit
  2023-11-30 18:49 [Intel-wired-lan] Compile of out-of-tree 'ice' driver fails on 32 bit tedheadster
@ 2023-12-01  7:47 ` Przemek Kitszel
  2023-12-01 13:41   ` tedheadster
  0 siblings, 1 reply; 4+ messages in thread
From: Przemek Kitszel @ 2023-12-01  7:47 UTC (permalink / raw)
  To: whiteheadm, intel-wired-lan

On 11/30/23 19:49, tedheadster wrote:
> Has anyone tried compiling the out-of-tree kernel network software
> for the 'ice' driver on 32 bit i386? I tried it for the
> long-term-support 5.10.197 kernel and got these compile time errors:

Are those regressions?
Have you tried 1.12.x?
We will also soon release also 1.13.x

> 
> $ make ARCH=i386 CFLAGS_EXTRA="-DGNSS_SUPPORT"
> make  ccflags-y="-DGNSS_SUPPORT -DUSE_INTEL_AUX_BUS" -C
> "/lib/modules/5.10.197.i686-pentium4-mpentium4-lenovo/source"
> CONFIG_ICE=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL=
> M="/tmp/ice-1.11.14/src"   NEED_AUX_BUS="2"  modules
>    CC [M]  /tmp/ice-1.11.14/src/ice_main.o
> In file included from /tmp/ice-1.11.14/src/kcompat.h:3351,
>                   from /tmp/ice-1.11.14/src/ice.h:7,
>                   from /tmp/ice-1.11.14/src/ice_main.c:8:
> /tmp/ice-1.11.14/src/kcompat_impl.h:851:20: error: redefinition of
> ‘eth_hw_addr_set’
>    851 | static inline void eth_hw_addr_set(struct net_device *dev,
> const u8 *addr)
>        |                    ^~~~~~~~~~~~~~~
> In file included from /tmp/ice-1.11.14/src/kcompat.h:16:
> ./include/linux/etherdevice.h:309:20: note: previous definition of
> ‘eth_hw_addr_set’ with type ‘void(struct net_device *, const u8 *)’
> {aka ‘void(struct net_device *, const unsigned char *)’}
>    309 | static inline void eth_hw_addr_set(struct net_device *dev,
> const u8 *addr)

That particular thing could be rather easily solved,
for official fix, 1.14 would be the earliest, but let me know how it
works with 1.12.x so I could prepare some patch for you.

>        |                    ^~~~~~~~~~~~~~~
> In file included from ./include/linux/bits.h:6,
>                   from ./include/linux/bitops.h:5,
>                   from ./include/linux/kernel.h:12,
>                   from ./include/asm-generic/bug.h:20,
>                   from ./arch/x86/include/asm/bug.h:93,
>                   from ./include/linux/bug.h:5,
>                   from ./include/linux/io.h:11,
>                   from /tmp/ice-1.11.14/src/kcompat.h:13:
> /tmp/ice-1.11.14/src/ice_main.c: In function ‘ice_pf_fwlog_is_input_valid’:
> ./include/vdso/bits.h:7:40: warning: left shift count >= width of type
> [-Wshift-count-overflow]
>      7 | #define BIT(nr)                 (UL(1) << (nr))
>        |                                        ^~
> /tmp/ice-1.11.14/src/ice_main.c:5992:23: note: in expansion of macro ‘BIT’
>   5992 |         if (events >= BIT(ICE_AQC_FW_LOG_ID_MAX)) {
>        |                       ^~~
> ./include/vdso/bits.h:7:40: warning: left shift count >= width of type
> [-Wshift-count-overflow]
>      7 | #define BIT(nr)                 (UL(1) << (nr))
>        |                                        ^~
> ./include/linux/dev_printk.h:112:39: note: in expansion of macro ‘BIT’
>    112 |         _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
>        |                                       ^~~~~~~~~~~
> /tmp/ice-1.11.14/src/ice_main.c:5993:17: note: in expansion of macro ‘dev_err’
>   5993 |                 dev_err(ice_pf_to_dev(pf), "Invalid FW log
> events 0x%lx, all FW log event bits >= 0x%lx are invalid\n",
>        |                 ^~~~~~~
> make[2]: *** [scripts/Makefile.build:286:
> /tmp/ice-1.11.14/src/ice_main.o] Error 1
> make[1]: *** [Makefile:1832: /tmp/ice-1.11.14/src] Error 2
> make: *** [Makefile:149: all] Error 2
> 
> I know 32bit is officially unsupported, but it seems like it should
> not break the compile this badly. 

I would say it's better to fail at that stage that render out-of-bound
writes or other errors.

looks like Intel OOT BIT() macro assumes 64bit arch, perhaps this could
be fixed in general, but I'm not promising anything here.


> I'm running on 32bit as a GNSS time
> server, I'm not trying to use the high speed capabilities of the NIC.
> 
> - Matthew
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] Compile of out-of-tree 'ice' driver fails on 32 bit
  2023-12-01  7:47 ` Przemek Kitszel
@ 2023-12-01 13:41   ` tedheadster
  2023-12-02  1:13     ` Jesse Brandeburg
  0 siblings, 1 reply; 4+ messages in thread
From: tedheadster @ 2023-12-01 13:41 UTC (permalink / raw)
  To: Przemek Kitszel; +Cc: intel-wired-lan, whiteheadm

> > Has anyone tried compiling the out-of-tree kernel network software
> > for the 'ice' driver on 32 bit i386? I tried it for the
> > long-term-support 5.10.197 kernel and got these compile time errors:
>
> Are those regressions?
> Have you tried 1.12.x?
> We will also soon release also 1.13.x

I just tried 1.11.14, 1.11.17.1, and 1.12.7. They all had similar
compile failures.

 > $ make ARCH=i386 CFLAGS_EXTRA="-DGNSS_SUPPORT"
> > make  ccflags-y="-DGNSS_SUPPORT -DUSE_INTEL_AUX_BUS" -C
> > "/lib/modules/5.10.197.i686-pentium4-mpentium4-lenovo/source"
> > CONFIG_ICE=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL=
> > M="/tmp/ice-1.11.14/src"   NEED_AUX_BUS="2"  modules
> >    CC [M]  /tmp/ice-1.11.14/src/ice_main.o
> > In file included from /tmp/ice-1.11.14/src/kcompat.h:3351,
> >                   from /tmp/ice-1.11.14/src/ice.h:7,
> >                   from /tmp/ice-1.11.14/src/ice_main.c:8:
> > /tmp/ice-1.11.14/src/kcompat_impl.h:851:20: error: redefinition of
> > ‘eth_hw_addr_set’
> >    851 | static inline void eth_hw_addr_set(struct net_device *dev,
> > const u8 *addr)
> >        |                    ^~~~~~~~~~~~~~~
> > In file included from /tmp/ice-1.11.14/src/kcompat.h:16:
> > ./include/linux/etherdevice.h:309:20: note: previous definition of
> > ‘eth_hw_addr_set’ with type ‘void(struct net_device *, const u8 *)’
> > {aka ‘void(struct net_device *, const unsigned char *)’}
> >    309 | static inline void eth_hw_addr_set(struct net_device *dev,
> > const u8 *addr)
>
> That particular thing could be rather easily solved,
> for official fix, 1.14 would be the earliest, but let me know how it
> works with 1.12.x so I could prepare some patch for you.
>
> >        |                    ^~~~~~~~~~~~~~~
> > In file included from ./include/linux/bits.h:6,
> >                   from ./include/linux/bitops.h:5,
> >                   from ./include/linux/kernel.h:12,
> >                   from ./include/asm-generic/bug.h:20,
> >                   from ./arch/x86/include/asm/bug.h:93,
> >                   from ./include/linux/bug.h:5,
> >                   from ./include/linux/io.h:11,
> >                   from /tmp/ice-1.11.14/src/kcompat.h:13:
> > /tmp/ice-1.11.14/src/ice_main.c: In function ‘ice_pf_fwlog_is_input_valid’:
> > ./include/vdso/bits.h:7:40: warning: left shift count >= width of type
> > [-Wshift-count-overflow]
> >      7 | #define BIT(nr)                 (UL(1) << (nr))
> >        |                                        ^~
> > /tmp/ice-1.11.14/src/ice_main.c:5992:23: note: in expansion of macro ‘BIT’
> >   5992 |         if (events >= BIT(ICE_AQC_FW_LOG_ID_MAX)) {
> >        |                       ^~~
> > ./include/vdso/bits.h:7:40: warning: left shift count >= width of type
> > [-Wshift-count-overflow]
> >      7 | #define BIT(nr)                 (UL(1) << (nr))
> >        |                                        ^~
> > ./include/linux/dev_printk.h:112:39: note: in expansion of macro ‘BIT’
> >    112 |         _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
> >        |                                       ^~~~~~~~~~~
> > /tmp/ice-1.11.14/src/ice_main.c:5993:17: note: in expansion of macro ‘dev_err’
> >   5993 |                 dev_err(ice_pf_to_dev(pf), "Invalid FW log
> > events 0x%lx, all FW log event bits >= 0x%lx are invalid\n",
> >        |                 ^~~~~~~
> > make[2]: *** [scripts/Makefile.build:286:
> > /tmp/ice-1.11.14/src/ice_main.o] Error 1
> > make[1]: *** [Makefile:1832: /tmp/ice-1.11.14/src] Error 2
> > make: *** [Makefile:149: all] Error 2
> >
> > I know 32bit is officially unsupported, but it seems like it should
> > not break the compile this badly.
>
> I would say it's better to fail at that stage that render out-of-bound
> writes or other errors.
>
> looks like Intel OOT BIT() macro assumes 64bit arch, perhaps this could
> be fixed in general, but I'm not promising anything here.
>

Maybe they should declare the variable as u64 instead of unsigned
long? The macro BIT in include/vdso/bits.h is defined as:

#define BIT(nr) (UL(1) << (nr))

So you get whatever an unsigned long is per architecture, which
obviously varies.

- Matthew
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-wired-lan] Compile of out-of-tree 'ice' driver fails on 32 bit
  2023-12-01 13:41   ` tedheadster
@ 2023-12-02  1:13     ` Jesse Brandeburg
  0 siblings, 0 replies; 4+ messages in thread
From: Jesse Brandeburg @ 2023-12-02  1:13 UTC (permalink / raw)
  To: whiteheadm, Przemek Kitszel; +Cc: intel-wired-lan

On 12/1/2023 5:41 AM, tedheadster wrote:
>>> Has anyone tried compiling the out-of-tree kernel network software
>>> for the 'ice' driver on 32 bit i386? I tried it for the
>>> long-term-support 5.10.197 kernel and got these compile time errors:
>>
>> Are those regressions?
>> Have you tried 1.12.x?
>> We will also soon release also 1.13.x
> 
> I just tried 1.11.14, 1.11.17.1, and 1.12.7. They all had similar
> compile failures.

I've got a quick patch for Matthew, I'll send it to him off list for
some testing.

I'm not super excited about some of the warning fixes as fixing 32 bit
to get rid of printk formatting warnings introduces 64 bit warnings :-(


> 
>  > $ make ARCH=i386 CFLAGS_EXTRA="-DGNSS_SUPPORT"
>>> make  ccflags-y="-DGNSS_SUPPORT -DUSE_INTEL_AUX_BUS" -C
>>> "/lib/modules/5.10.197.i686-pentium4-mpentium4-lenovo/source"
>>> CONFIG_ICE=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL=
>>> M="/tmp/ice-1.11.14/src"   NEED_AUX_BUS="2"  modules
>>>    CC [M]  /tmp/ice-1.11.14/src/ice_main.o
>>> In file included from /tmp/ice-1.11.14/src/kcompat.h:3351,
>>>                   from /tmp/ice-1.11.14/src/ice.h:7,
>>>                   from /tmp/ice-1.11.14/src/ice_main.c:8:
>>> /tmp/ice-1.11.14/src/kcompat_impl.h:851:20: error: redefinition of
>>> ‘eth_hw_addr_set’
>>>    851 | static inline void eth_hw_addr_set(struct net_device *dev,
>>> const u8 *addr)
>>>        |                    ^~~~~~~~~~~~~~~
>>> In file included from /tmp/ice-1.11.14/src/kcompat.h:16:
>>> ./include/linux/etherdevice.h:309:20: note: previous definition of
>>> ‘eth_hw_addr_set’ with type ‘void(struct net_device *, const u8 *)’
>>> {aka ‘void(struct net_device *, const unsigned char *)’}
>>>    309 | static inline void eth_hw_addr_set(struct net_device *dev,
>>> const u8 *addr)


The compat fix for eth_hw_addr_set is just put #if 0 around it. Looks
like ubuntu backported something and picked up a conflict.

The newer kcompat-generator script in 1.12.x and newer should help that
issue, or at least *could* if it's not already fixed.


>>
>> That particular thing could be rather easily solved,
>> for official fix, 1.14 would be the earliest, but let me know how it
>> works with 1.12.x so I could prepare some patch for you.
>>
>>>        |                    ^~~~~~~~~~~~~~~
>>> In file included from ./include/linux/bits.h:6,
>>>                   from ./include/linux/bitops.h:5,
>>>                   from ./include/linux/kernel.h:12,
>>>                   from ./include/asm-generic/bug.h:20,
>>>                   from ./arch/x86/include/asm/bug.h:93,
>>>                   from ./include/linux/bug.h:5,
>>>                   from ./include/linux/io.h:11,
>>>                   from /tmp/ice-1.11.14/src/kcompat.h:13:
>>> /tmp/ice-1.11.14/src/ice_main.c: In function ‘ice_pf_fwlog_is_input_valid’:
>>> ./include/vdso/bits.h:7:40: warning: left shift count >= width of type
>>> [-Wshift-count-overflow]
>>>      7 | #define BIT(nr)                 (UL(1) << (nr))
>>>        |                                        ^~
>>> /tmp/ice-1.11.14/src/ice_main.c:5992:23: note: in expansion of macro ‘BIT’
>>>   5992 |         if (events >= BIT(ICE_AQC_FW_LOG_ID_MAX)) {
>>>        |                       ^~~
>>> ./include/vdso/bits.h:7:40: warning: left shift count >= width of type
>>> [-Wshift-count-overflow]
>>>      7 | #define BIT(nr)                 (UL(1) << (nr))
>>>        |                                        ^~
>>> ./include/linux/dev_printk.h:112:39: note: in expansion of macro ‘BIT’
>>>    112 |         _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
>>>        |                                       ^~~~~~~~~~~
>>> /tmp/ice-1.11.14/src/ice_main.c:5993:17: note: in expansion of macro ‘dev_err’
>>>   5993 |                 dev_err(ice_pf_to_dev(pf), "Invalid FW log
>>> events 0x%lx, all FW log event bits >= 0x%lx are invalid\n",

The fix here is to make the print code use BIT_ULL(ICE_AQC_FW_LOG_ID_MAX)



_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-02  1:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-30 18:49 [Intel-wired-lan] Compile of out-of-tree 'ice' driver fails on 32 bit tedheadster
2023-12-01  7:47 ` Przemek Kitszel
2023-12-01 13:41   ` tedheadster
2023-12-02  1:13     ` Jesse Brandeburg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox