[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fc761c7-6053-c098-a251-ae2f7380f95e@redhat.com>
Date: Wed, 30 Dec 2020 12:27:47 +0800
From: Jason Wang <jasowang@...hat.com>
To: Eli Cohen <elic@...dia.com>
Cc: mst@...hat.com, eperezma@...hat.com, kvm@...r.kernel.org,
virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, lulu@...hat.com, eli@...lanox.com,
lingshan.zhu@...el.com, rob.miller@...adcom.com,
stefanha@...hat.com, sgarzare@...hat.com
Subject: Re: [PATCH 10/21] vhost: support ASID in IOTLB API
On 2020/12/29 下午6:20, Eli Cohen wrote:
>> -static int vhost_process_iotlb_msg(struct vhost_dev *dev,
>> +static int vhost_process_iotlb_msg(struct vhost_dev *dev, u16 asid,
>> struct vhost_iotlb_msg *msg)
>> {
>> int ret = 0;
>>
>> + if (asid != 0)
>> + return -EINVAL;
>> +
>> mutex_lock(&dev->mutex);
>> vhost_dev_lock_vqs(dev);
>> switch (msg->type) {
>> @@ -1135,6 +1138,7 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
>> struct vhost_iotlb_msg msg;
>> size_t offset;
>> int type, ret;
>> + u16 asid = 0;
> You assume asid occupies just 16 bits. So maybe you should reserve the
> other 16 bits for future extension:
>
> struct vhost_msg_v2 {
> __u32 type;
> - __u32 reserved;
> + __u16 asid;
> + __u16 reserved;
> union {
>
> Moreover, maybe this should be reflected in previous patches that use
> the asid:
>
> -static int mlx5_vdpa_set_map(struct vdpa_device *vdev, struct vhost_iotlb *iotlb)
> +static int mlx5_vdpa_set_map(struct vdpa_device *vdev, u16 asid,
> + struct vhost_iotlb *iotlb)
>
> -static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev,
> +static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u16 asid,
> struct vhost_iotlb_msg *msg)
>
> etc.
Good catch.
This is a bug of the code actually. Since I want to stick to 32bit to be
large enough for e.g PASID.
Will fix.
Thanks
>
Powered by blists - more mailing lists