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: <e0c5a5b9-55b5-3c43-61d6-94c80ffd02c1@huawei.com>
Date:   Thu, 8 Dec 2022 16:40:00 +0800
From:   liulongfang <liulongfang@...wei.com>
To:     Jason Gunthorpe <jgg@...dia.com>
CC:     <alex.williamson@...hat.com>,
        <shameerali.kolothum.thodi@...wei.com>, <cohuck@...hat.com>,
        <linux-kernel@...r.kernel.org>, <linuxarm@...neuler.org>
Subject: Re: [PATCH v4 1/5] vfio/migration: Add debugfs to live migration
 driver

On 2022/12/5 21:55, Jason Gunthorpe Wrote:
> On Mon, Dec 05, 2022 at 09:39:29PM +0800, liulongfang wrote:
>> On 2022/12/2 23:17, Jason Gunthorpe wrote:
>>> On Fri, Dec 02, 2022 at 05:26:21PM +0800, Longfang Liu wrote:
>>>
>>>> +static ssize_t vfio_pci_vf_state_read(struct file *filp, char __user *buffer,
>>>> +			   size_t count, loff_t *pos)
>>>> +{
>>>
>>> This would be better to use debugfs_create_devm_seqfile()
>>>
>>> Then you can simply use seq_printf()
>>>
>>
>> The previous debugfs used this method in my patch.
>> Is it now recommended to use the interface with "devm" ?
> 
> It doesn't matter, the point is not the devm, it is to use the right
> helper for the data you want to expose over debugfs 
>  
>>>> @@ -119,6 +129,8 @@ struct vfio_migration_ops {
>>>>  				   enum vfio_device_mig_state *curr_state);
>>>>  	int (*migration_get_data_size)(struct vfio_device *device,
>>>>  				       unsigned long *stop_copy_length);
>>>> +	int (*migration_get_data)(struct vfio_device *device, char *buffer);
>>>> +	int (*migration_get_attr)(struct vfio_device *device, char
>>>>  				   *buffer);
>>>
>>> Still no to passing through debugfs ops, create these files in the
>>> driver.
>>>
>>
>> If this part is also created and enabled in the device driver, why do we need
>> to put this debugfs in the vfio public framework?
> 
> To create the directory, and the few actually common files
> 

OK, Only use the state as a public function, and create other debug files
inside the driver.

Thanks,
Longfang.
> Jason
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ