Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1583508 > unrolled thread

[PATCH] vmxnet3: prevent building with 64K pages

Started byArnd Bergmann <arnd@arndb.de>
First post2017-02-17 16:10 +0100
Last post2017-02-17 21:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] vmxnet3: prevent building with 64K pages Arnd Bergmann <arnd@arndb.de> - 2017-02-17 16:10 +0100
    Re: [PATCH] vmxnet3: prevent building with 64K pages David Miller <davem@davemloft.net> - 2017-02-17 21:30 +0100

#1583508 — [PATCH] vmxnet3: prevent building with 64K pages

FromArnd Bergmann <arnd@arndb.de>
Date2017-02-17 16:10 +0100
Subject[PATCH] vmxnet3: prevent building with 64K pages
Message-ID<tbSky-5TK-17@gated-at.bofh.it>
I got a warning about broken code on ARM64 with 64K pages:

drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
drivers/net/vmxnet3/vmxnet3_drv.c:1679:29: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
    rq->buf_info[0][i].len = PAGE_SIZE;

'len' here is a 16-bit integer, so this clearly won't work. I don't think
this driver is used much on anything other than x86, so there is no need
to fix this properly and we can work around it with a Kconfig dependency
to forbid known-broken configurations. qemu in theory supports it on
other architectures too, but presumably only for compatibility with x86
guests that also run on vmware.

CONFIG_PAGE_SIZE_64KB is used on hexagon, mips, sh and tile, the other
symbols are architecture-specific names for the same thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 4c07a067df1d..8a49fedb80ef 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -458,6 +458,9 @@ config XEN_NETDEV_BACKEND
 config VMXNET3
 	tristate "VMware VMXNET3 ethernet driver"
 	depends on PCI && INET
+	depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
+		     IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
+		     PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
 	help
 	  This driver supports VMware's vmxnet3 virtual ethernet NIC.
 	  To compile this driver as a module, choose M here: the
-- 
2.9.0

[toc] | [next] | [standalone]


#1583721

FromDavid Miller <davem@davemloft.net>
Date2017-02-17 21:30 +0100
Message-ID<tbXke-wK-13@gated-at.bofh.it>
In reply to#1583508
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 17 Feb 2017 16:08:30 +0100

> I got a warning about broken code on ARM64 with 64K pages:
> 
> drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
> drivers/net/vmxnet3/vmxnet3_drv.c:1679:29: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
>     rq->buf_info[0][i].len = PAGE_SIZE;
> 
> 'len' here is a 16-bit integer, so this clearly won't work. I don't think
> this driver is used much on anything other than x86, so there is no need
> to fix this properly and we can work around it with a Kconfig dependency
> to forbid known-broken configurations. qemu in theory supports it on
> other architectures too, but presumably only for compatibility with x86
> guests that also run on vmware.
> 
> CONFIG_PAGE_SIZE_64KB is used on hexagon, mips, sh and tile, the other
> symbols are architecture-specific names for the same thing.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I've applied this to net-next, but...

That is a real messy plethora of Kconfig symbol variants, it would be nice
to consolidate those somehow.

The driver could also chop 64K pages into 32K or smaller pieces and
maintain an appropriate refcnt.  Yes, I realize this is probably not
very valuable work for a situation that might never ever occur.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web