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]
Date:   Fri, 8 Jul 2022 12:01:34 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     "yekai(A)" <yekai13@...wei.com>
Cc:     herbert@...dor.apana.org.au, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org, wangzhou1@...ilicon.com
Subject: Re: [PATCH v5 1/3] uacce: supports device isolation feature

On Fri, Jul 08, 2022 at 05:33:42PM +0800, yekai(A) wrote:
> 
> 
> On 2022/7/8 15:28, Greg KH wrote:
> > On Fri, Jul 08, 2022 at 03:08:18PM +0800, Kai Ye wrote:
> > > UACCE adds the hardware error isolation API. Users can configure
> > > the isolation frequency by this sysfs node. UACCE reports the device
> > > isolate state to the user space. If the AER error frequency exceeds
> > > the value of setting for a certain period of time, the device will be
> > > isolated.
> > > 
> > > Signed-off-by: Kai Ye <yekai13@...wei.com>
> > > ---
> > >  drivers/misc/uacce/uacce.c | 55 ++++++++++++++++++++++++++++++++++++++
> > >  include/linux/uacce.h      | 11 ++++++++
> > >  2 files changed, 66 insertions(+)
> > > 
> > > diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
> > > index 281c54003edc..d07b5f1f0596 100644
> > > --- a/drivers/misc/uacce/uacce.c
> > > +++ b/drivers/misc/uacce/uacce.c
> > > @@ -7,6 +7,8 @@
> > >  #include <linux/slab.h>
> > >  #include <linux/uacce.h>
> > > 
> > > +#define MAX_ERR_ISOLATE_COUNT		65535
> > > +
> > >  static struct class *uacce_class;
> > >  static dev_t uacce_devt;
> > >  static DEFINE_MUTEX(uacce_mutex);
> > > @@ -339,12 +341,63 @@ static ssize_t region_dus_size_show(struct device *dev,
> > >  		       uacce->qf_pg_num[UACCE_QFRT_DUS] << PAGE_SHIFT);
> > >  }
> > > 
> > > +static ssize_t isolate_show(struct device *dev,
> > > +			    struct device_attribute *attr, char *buf)
> > > +{
> > > +	struct uacce_device *uacce = to_uacce_device(dev);
> > > +
> > > +	if (!uacce->ops->get_isolate_state)
> > > +		return -ENODEV;
> > 
> > If there is no callback, why is this sysfs even created at all?  Please
> > do not create it if it can not be accessed.
> > 
> > Use the is_visable() callback for the group to do this.
> > 
> 
> If is_visable() is used as the judgment, all uacce device nodes cannot be
> registered if there is no callback by test.

I am sorry, I do not understand.  That callback is to be used for this
type of thing, and works for lots of driver subsystems.  Why exactly
will it not work here as well?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ