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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 6 Jul 2022 21:30:43 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Alex Williamson <alex.williamson@...hat.com>
Cc:     Yishai Hadas <yishaih@...dia.com>, saeedm@...dia.com,
        kvm@...r.kernel.org, netdev@...r.kernel.org, kuba@...nel.org,
        kevin.tian@...el.com, joao.m.martins@...cle.com, leonro@...dia.com,
        maorg@...dia.com, cohuck@...hat.com
Subject: Re: [PATCH V1 vfio 03/11] vfio: Introduce DMA logging uAPIs

On Wed, Jul 06, 2022 at 05:11:37PM -0600, Alex Williamson wrote:
> > +struct vfio_device_feature_dma_logging_control {
> > +	__aligned_u64 page_size;
> > +	__u32 num_ranges;
> > +	__u32 __reserved;
> > +	__aligned_u64 ranges;
> > +};
> 
> num_ranges probably has a limit below 2^32-1, is it device specific?
> How does the user learn the limit?

The driver is expected to groom the provided ranges to meet whatever
limitations the device happens to have. eg expand to fix misalignment,
cluster to fit in the available tracking, increase page size, etc.

The next patch has a small algorithm that works with mlx5's limits.

This way we avoid trying to explain to userspace every possible device
quirk.

eg if the device support one range it should take the lowest and
highest address, fix the alignment, and use that. If that doesn't work
then tracking isn't supported in the configuration.

> Presumably new ranges cannot be added while logging is already enabled,
> should we build this limitation into the uAPI or might some devices
> have the ability to dynamically add and remove logging ranges?  Thanks,

If we see a device that can do dynamic then we'd add a new ioctl for
'add/remove' ranges along with a feature bit for the capability. mlx5
doesn't support that so we aren't adding uapi that isn't implemented..

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ