lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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