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: <Y3WKaxd4cGmdOMz4@iweiny-desk3>
Date:   Wed, 16 Nov 2022 17:12:11 -0800
From:   Ira Weiny <ira.weiny@...el.com>
To:     Jonathan Cameron <Jonathan.Cameron@...wei.com>
CC:     Dan Williams <dan.j.williams@...el.com>,
        Alison Schofield <alison.schofield@...el.com>,
        Vishal Verma <vishal.l.verma@...el.com>,
        "Ben Widawsky" <bwidawsk@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Davidlohr Bueso <dave@...olabs.net>,
        <linux-kernel@...r.kernel.org>, <linux-cxl@...r.kernel.org>
Subject: Re: [PATCH 03/11] cxl/mem: Implement Clear Event Records command

On Wed, Nov 16, 2022 at 03:45:43PM +0000, Jonathan Cameron wrote:
> On Wed, 16 Nov 2022 15:24:26 +0000
> Jonathan Cameron <Jonathan.Cameron@...wei.com> wrote:
> 

[snip]

> > 
> > 
> > > + */
> > > +struct cxl_mbox_clear_event_payload {
> > > +	u8 event_log;		/* enum cxl_event_log_type */
> > > +	u8 clear_flags;
> > > +	u8 nr_recs;		/* 1 for this struct */  
> > Nope :)  Delete the comments so they can't be wrong if this changes in future!
> Ah. You only use one. So should hard code that in the array size below.

No it can can send up to CXL_GET_EVENT_NR_RECORDS at a time : 'nr_rec'.


                        rc = cxl_clear_event_record(cxlds, type, &payload, nr_rec);


static int cxl_clear_event_record(struct cxl_dev_state *cxlds,                                                                  
                                  enum cxl_event_log_type log,                                                                  
                                  struct cxl_get_event_payload *get_pl, u16 nr)                                                 
{                                                                                                                               
        struct cxl_mbox_clear_event_payload payload = {                                                                         
                .event_log = log,                                                                                               
                .nr_recs = nr,                                                                                                  
                ^^^^^^^^^^^^^^
                Here...

        };                                                                                                                      
        int i;                                                                                                                  
                                                                                                                                
        for (i = 0; i < nr; i++) {                                                                                              
                payload.handle[i] = get_pl->record[i].hdr.handle;                                                               
                dev_dbg(cxlds->dev, "Event log '%s': Clearning %u\n",                                                           
                        cxl_event_log_type_str(log),                                                                            
                        le16_to_cpu(payload.handle[i]));                                                                        
        }                                                                                                                       
...

Ira

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ