diff options
author | Zhu Lingshan <lingshan.zhu@intel.com> | 2021-03-17 17:49:32 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-05-03 04:55:52 -0400 |
commit | 1d895a68085b28d098893570b024229aacc9a057 (patch) | |
tree | 3e580359a4e47ca90a94a010967d30ad03bb3fbc /drivers/vdpa/ifcvf/ifcvf_main.c | |
parent | 69d00d9858c7451a1e3fc556ece211533fb85b64 (diff) |
vDPA/ifcvf: verify mandatory feature bits for vDPA
vDPA requres VIRTIO_F_ACCESS_PLATFORM as a must, this commit
examines this when set features.
Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210317094933.16417-7-lingshan.zhu@intel.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa/ifcvf/ifcvf_main.c')
-rw-r--r-- | drivers/vdpa/ifcvf/ifcvf_main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index fae664d92aff..8bff4efbe749 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -179,6 +179,11 @@ static u64 ifcvf_vdpa_get_features(struct vdpa_device *vdpa_dev) static int ifcvf_vdpa_set_features(struct vdpa_device *vdpa_dev, u64 features) { struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); + int ret; + + ret = ifcvf_verify_min_features(vf, features); + if (ret) + return ret; vf->req_features = features; |