提交 6f1e39b2 编写于 作者: E Eryu Guan 提交者: Joseph Qi

eci: drivers/virtio: add vring_force_dma_api boot param

Prior to xdragon platform 20181230 release (e.g. 0930 release),
vring_use_dma_api() is required to return 'true' unconditionally.

Introduce a new kernel boot parameter called "vring_force_dma_api" to
control the behavior, boot xdragon host with "vring_force_dma_api"
command line to make ENI hotplug work, so that normal ECS hosts keep the
original behavior.
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: NEryu Guan <eguan@linux.alibaba.com>
上级 95c07d30
......@@ -4965,6 +4965,11 @@
vmpoff= [KNL,S390] Perform z/VM CP command after power off.
Format: <command>
vring_force_dma_api
Force virtio vring to use dma api. This is only needed
on xdragon platform (prior to 20181230 release, e.g.
0930 release).
vsyscall= [X86-64]
Controls the behavior of vsyscalls (i.e. calls to
fixed addresses of 0xffffffffff600x00 from legacy
......
......@@ -26,6 +26,8 @@
#include <linux/dma-mapping.h>
#include <xen/xen.h>
static bool vring_force_dma_api = false;
#ifdef DEBUG
/* For development, we want to crash whenever the ring is screwed. */
#define BAD_RING(_vq, fmt, args...) \
......@@ -115,6 +117,15 @@ struct vring_virtqueue {
#define to_vvq(_vq) container_of(_vq, struct vring_virtqueue, vq)
static int __init vring_dma_api_setup(char *str)
{
vring_force_dma_api = true;
printk(KERN_INFO "Force vring dma api enabled\n");
return 0;
}
__setup("vring_force_dma_api", vring_dma_api_setup);
/*
* Modern virtio devices have feature bits to specify whether they need a
* quirk and bypass the IOMMU. If not there, just use the DMA API.
......@@ -143,6 +154,13 @@ struct vring_virtqueue {
static bool vring_use_dma_api(struct virtio_device *vdev)
{
/*
* Prior to xdragon platform 20181230 release (e.g. 0930 release), we
* need this hack to get ENI hotplug to work.
*/
if (vring_force_dma_api)
return true;
if (!virtio_has_iommu_quirk(vdev))
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册