Skip to contentSkip to conversation

virtio_balloon: disable VIOMMU support

PATCH In review Michael S. Tsirkin 2 participants 3 messages Jun 13, 2017 – Jun 15, 2017

Subsystems (3)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 virtio_balloon: disable VIOMMU support

virtio balloon bypasses the DMA API entirely so does not support the VIOMMU right now. It's not clear we need that support, for now let's just make sure we don't pretend to support it.

Cc Wei Wang <[email protected]>
Fixes 1a937693993f ("virtio: new feature to detect IOMMU device quirk")
---
 drivers/virtio/virtio_balloon.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/virtio/virtio_balloon.c +7 -0
index 408c174..22caf80 100644
@@ -663,6 +663,12 @@ static int virtballoon_restore(struct virtio_device *vdev)
 }
 #endif
 
+static int virtballoon_validate(struct virtio_device *vdev)
+{
+	__virtio_clear_bit(vdev, VIRTIO_F_IOMMU_PLATFORM);
+	return 0;
+}
+
 static unsigned int features[] = {
 	VIRTIO_BALLOON_F_MUST_TELL_HOST,
 	VIRTIO_BALLOON_F_STATS_VQ,
@@ -675,6 +681,7 @@ static struct virtio_driver virtio_balloon_driver = {
 	.driver.name =	KBUILD_MODNAME,
 	.driver.owner =	THIS_MODULE,
 	.id_table =	id_table,
+	.validate =	virtballoon_validate,
 	.probe =	virtballoon_probe,
 	.remove =	virtballoon_remove,
 	.config_changed = virtballoon_changed,
Signature · 1 line
MST
Acked-by on v1 1/1
#1 lore raw
Quoted 30 lines · Michael S. Tsirkin

virtio balloon bypasses the DMA API entirely so does not support the VIOMMU right now. It's not clear we need that support, for now let's just make sure we don't pretend to support it.

Cc Wei Wang <[email protected]>
Fixes 1a937693993f ("virtio: new feature to detect IOMMU device quirk")
---
  drivers/virtio/virtio_balloon.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/virtio/virtio_balloon.c +6 -0
index 408c174..22caf80 100644
@@ -663,6 +663,12 @@ static int virtballoon_restore(struct virtio_device *vdev)
  }
  #endif
 
+static int virtballoon_validate(struct virtio_device *vdev)
+{
+	__virtio_clear_bit(vdev, VIRTIO_F_IOMMU_PLATFORM);
+	return 0;
+}
+
  static unsigned int features[] = {
  	VIRTIO_BALLOON_F_MUST_TELL_HOST,
  	VIRTIO_BALLOON_F_STATS_VQ,

drivers/virtio/virtio_balloon.c static struct virtio_driver virtio_balloon_driver = { · line 687

Quoted 7 lines
drivers/virtio/virtio_balloon.c +1 -0
@@ -675,6 +681,7 @@ static struct virtio_driver virtio_balloon_driver = {
  	.driver.name =	KBUILD_MODNAME,
  	.driver.owner =	THIS_MODULE,
  	.id_table =	id_table,
+	.validate =	virtballoon_validate,
  	.probe =	virtballoon_probe,
  	.remove =	virtballoon_remove,
  	.config_changed = virtballoon_changed,

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Acked-by on v1 1/1
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 30 lines · Michael S. Tsirkin

virtio balloon bypasses the DMA API entirely so does not support the VIOMMU right now. It's not clear we need that support, for now let's just make sure we don't pretend to support it.

Cc Wei Wang <[email protected]>
Fixes 1a937693993f ("virtio: new feature to detect IOMMU device quirk")
---
  drivers/virtio/virtio_balloon.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/virtio/virtio_balloon.c +6 -0
index 408c174..22caf80 100644
@@ -663,6 +663,12 @@ static int virtballoon_restore(struct virtio_device *vdev)
  }
  #endif
 
+static int virtballoon_validate(struct virtio_device *vdev)
+{
+	__virtio_clear_bit(vdev, VIRTIO_F_IOMMU_PLATFORM);
+	return 0;
+}
+
  static unsigned int features[] = {
  	VIRTIO_BALLOON_F_MUST_TELL_HOST,
  	VIRTIO_BALLOON_F_STATS_VQ,

drivers/virtio/virtio_balloon.c static struct virtio_driver virtio_balloon_driver = { · line 687

Quoted 7 lines
drivers/virtio/virtio_balloon.c +1 -0
@@ -675,6 +681,7 @@ static struct virtio_driver virtio_balloon_driver = {
  	.driver.name =	KBUILD_MODNAME,
  	.driver.owner =	THIS_MODULE,
  	.id_table =	id_table,
+	.validate =	virtballoon_validate,
  	.probe =	virtballoon_probe,
  	.remove =	virtballoon_remove,
  	.config_changed = virtballoon_changed,