* [PATCH v3] vhost: disable for OABI
@ 2020-04-16 22:20 Michael S. Tsirkin
2020-04-20 8:29 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2020-04-16 22:20 UTC (permalink / raw)
To: linux-kernel
Cc: Ard Biesheuvel, Richard Earnshaw, Sudeep Dutt, Ashutosh Dixit,
Arnd Bergmann, Greg Kroah-Hartman, David S. Miller, Jason Wang,
netdev, virtualization, kvm
vhost is currently broken on the some ARM configs.
The reason is that that uses apcs-gnu which is the ancient OABI that is been
deprecated for a long time.
Given that virtio support on such ancient systems is not needed in the
first place, let's just add something along the lines of
depends on !ARM || AEABI
to the virtio Kconfig declaration, and add a comment that it has to do
with struct member alignment.
Note: we can't make VHOST and VHOST_RING themselves have
a dependency since these are selected. Add a new symbol for that.
Link: https://lore.kernel.org/r/20200406121233.109889-3-mst@redhat.com
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Suggested-by: Richard Earnshaw <Richard.Earnshaw@arm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
Changes from v2:
- drop prompt from VHOST_DPN
- typo fix in commit log
- OABI is a possible ARM config but not the default one
drivers/misc/mic/Kconfig | 2 +-
drivers/net/caif/Kconfig | 2 +-
drivers/vdpa/Kconfig | 2 +-
drivers/vhost/Kconfig | 17 +++++++++++++----
4 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
index 8f201d019f5a..3bfe72c59864 100644
--- a/drivers/misc/mic/Kconfig
+++ b/drivers/misc/mic/Kconfig
@@ -116,7 +116,7 @@ config MIC_COSM
config VOP
tristate "VOP Driver"
- depends on VOP_BUS
+ depends on VOP_BUS && VHOST_DPN
select VHOST_RING
select VIRTIO
help
diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig
index 9db0570c5beb..661c25eb1c46 100644
--- a/drivers/net/caif/Kconfig
+++ b/drivers/net/caif/Kconfig
@@ -50,7 +50,7 @@ config CAIF_HSI
config CAIF_VIRTIO
tristate "CAIF virtio transport driver"
- depends on CAIF && HAS_DMA
+ depends on CAIF && HAS_DMA && VHOST_DPN
select VHOST_RING
select VIRTIO
select GENERIC_ALLOCATOR
diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index 71d9a64f2c7d..ee35f8261a88 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -10,7 +10,7 @@ if VDPA
config VDPA_SIM
tristate "vDPA device simulator"
- depends on RUNTIME_TESTING_MENU && HAS_DMA
+ depends on RUNTIME_TESTING_MENU && HAS_DMA && VHOST_DPN
select VHOST_RING
select VHOST_IOTLB
default n
diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
index e79cbbdfea45..d9b3a3ec765a 100644
--- a/drivers/vhost/Kconfig
+++ b/drivers/vhost/Kconfig
@@ -12,6 +12,15 @@ config VHOST_RING
This option is selected by any driver which needs to access
the host side of a virtio ring.
+config VHOST_DPN
+ bool
+ depends on !ARM || AEABI
+ default y
+ help
+ Anything selecting VHOST or VHOST_RING must depend on VHOST_DPN.
+ This excludes the deprecated ARM ABI since that forces a 4 byte
+ alignment on all structs - incompatible with virtio spec requirements.
+
config VHOST
tristate
select VHOST_IOTLB
@@ -27,7 +36,7 @@ if VHOST_MENU
config VHOST_NET
tristate "Host kernel accelerator for virtio net"
- depends on NET && EVENTFD && (TUN || !TUN) && (TAP || !TAP)
+ depends on NET && EVENTFD && (TUN || !TUN) && (TAP || !TAP) && VHOST_DPN
select VHOST
---help---
This kernel module can be loaded in host kernel to accelerate
@@ -39,7 +48,7 @@ config VHOST_NET
config VHOST_SCSI
tristate "VHOST_SCSI TCM fabric driver"
- depends on TARGET_CORE && EVENTFD
+ depends on TARGET_CORE && EVENTFD && VHOST_DPN
select VHOST
default n
---help---
@@ -48,7 +57,7 @@ config VHOST_SCSI
config VHOST_VSOCK
tristate "vhost virtio-vsock driver"
- depends on VSOCKETS && EVENTFD
+ depends on VSOCKETS && EVENTFD && VHOST_DPN
select VHOST
select VIRTIO_VSOCKETS_COMMON
default n
@@ -62,7 +71,7 @@ config VHOST_VSOCK
config VHOST_VDPA
tristate "Vhost driver for vDPA-based backend"
- depends on EVENTFD
+ depends on EVENTFD && VHOST_DPN
select VHOST
depends on VDPA
help
--
MST
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] vhost: disable for OABI
2020-04-16 22:20 [PATCH v3] vhost: disable for OABI Michael S. Tsirkin
@ 2020-04-20 8:29 ` Christoph Hellwig
2020-04-20 14:16 ` Michael S. Tsirkin
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2020-04-20 8:29 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, Ard Biesheuvel, Richard Earnshaw, Sudeep Dutt,
Ashutosh Dixit, Arnd Bergmann, Greg Kroah-Hartman,
David S. Miller, Jason Wang, netdev, virtualization, kvm
On Thu, Apr 16, 2020 at 06:20:20PM -0400, Michael S. Tsirkin wrote:
> vhost is currently broken on the some ARM configs.
>
> The reason is that that uses apcs-gnu which is the ancient OABI that is been
> deprecated for a long time.
>
> Given that virtio support on such ancient systems is not needed in the
> first place, let's just add something along the lines of
>
> depends on !ARM || AEABI
>
> to the virtio Kconfig declaration, and add a comment that it has to do
> with struct member alignment.
>
> Note: we can't make VHOST and VHOST_RING themselves have
> a dependency since these are selected. Add a new symbol for that.
This description is horrible. The only interesting thing for ARM OABI
is that it has some strange padding rules, but that isn't something
that can't be handled. Please spend some time looking into the issue
and add te proper __padded annotations, we've done that elsewhere in
the kernel and it isn't too bad - in fact it helps understanding issues
with implicit alignment.
And even if you have a good reason not to fix vhost (which I think you
don't have) this changelog is just utter crap, as it fails to mention
what the problem with ARM OABI even is.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] vhost: disable for OABI
2020-04-20 8:29 ` Christoph Hellwig
@ 2020-04-20 14:16 ` Michael S. Tsirkin
0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2020-04-20 14:16 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-kernel, Ard Biesheuvel, Richard Earnshaw, Sudeep Dutt,
Ashutosh Dixit, Arnd Bergmann, Greg Kroah-Hartman,
David S. Miller, Jason Wang, netdev, virtualization, kvm
On Mon, Apr 20, 2020 at 01:29:09AM -0700, Christoph Hellwig wrote:
> On Thu, Apr 16, 2020 at 06:20:20PM -0400, Michael S. Tsirkin wrote:
> > vhost is currently broken on the some ARM configs.
> >
> > The reason is that that uses apcs-gnu which is the ancient OABI that is been
> > deprecated for a long time.
> >
> > Given that virtio support on such ancient systems is not needed in the
> > first place, let's just add something along the lines of
> >
> > depends on !ARM || AEABI
> >
> > to the virtio Kconfig declaration, and add a comment that it has to do
> > with struct member alignment.
> >
> > Note: we can't make VHOST and VHOST_RING themselves have
> > a dependency since these are selected. Add a new symbol for that.
>
> This description is horrible. The only interesting thing for ARM OABI
> is that it has some strange padding rules, but that isn't something
> that can't be handled. Please spend some time looking into the issue
> and add te proper __padded annotations, we've done that elsewhere in
> the kernel and it isn't too bad - in fact it helps understanding issues
> with implicit alignment.
Yes I have a patch queued to fix it. I wanted a minimal patch for this
release though.
> And even if you have a good reason not to fix vhost (which I think you
> don't have) this changelog is just utter crap, as it fails to mention
> what the problem with ARM OABI even is.
I'll tweak that, thanks!
--
MST
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-20 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 22:20 [PATCH v3] vhost: disable for OABI Michael S. Tsirkin
2020-04-20 8:29 ` Christoph Hellwig
2020-04-20 14:16 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).