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  linux-cve-announce  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]
Message-ID: <a1474a55-7525-7c3e-a806-e3f53850a590@redhat.com>
Date:   Thu, 26 Mar 2020 13:51:41 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Jason Gunthorpe <jgg@...lanox.com>
Cc:     mst@...hat.com, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        maxime.coquelin@...hat.com, cunming.liang@...el.com,
        zhihong.wang@...el.com, rob.miller@...adcom.com,
        xiao.w.wang@...el.com, lingshan.zhu@...el.com, eperezma@...hat.com,
        lulu@...hat.com, parav@...lanox.com, kevin.tian@...el.com,
        stefanha@...hat.com, rdunlap@...radead.org, hch@...radead.org,
        aadam@...hat.com, jiri@...lanox.com, shahafs@...lanox.com,
        hanand@...inx.com, mhabets@...arflare.com, gdawar@...inx.com,
        saugatm@...inx.com, vmireyno@...vell.com
Subject: Re: [PATCH V8 5/9] vDPA: introduce vDPA bus


On 2020/3/25 下午8:29, Jason Gunthorpe wrote:
> On Wed, Mar 25, 2020 at 04:27:07PM +0800, Jason Wang wrote:
>> +struct vdpa_device *__vdpa_alloc_device(struct device *parent,
>> +					const struct vdpa_config_ops *config,
>> +					size_t size);
>> +
>> +#define vdpa_alloc_device(dev_struct, member, parent, config)   \
>> +			  container_of(__vdpa_alloc_device( \
>> +				       parent, config, \
>> +				       sizeof(struct dev_struct) + \
>> +				       BUILD_BUG_ON_ZERO(offsetof( \
>> +				       struct dev_struct, member))), \
>> +				       struct dev_struct, member)
> This all looks robust now, one minor remark is to not do 'struct
> dev_struct' here so the caller has to do
>
>     vdpa_alloc_device(struct foo, vpda, ...)
>
> Which suggests to the reader something unusual is happening
>
> Jason


Yes, that's better.

But my understanding is that this can be done on top.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ