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, 17 May 2024 12:08:45 +0200
From: "Fabio M. De Francesco" <fabio.m.de.francesco@...ux.intel.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: Davidlohr Bueso <dave@...olabs.net>, Dave Jiang <dave.jiang@...el.com>,
 Alison Schofield <alison.schofield@...el.com>,
 Vishal Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>,
 Dan Williams <dan.j.williams@...el.com>, linux-cxl@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject:
 Re: [PATCH v2] cxl/events: Use a common struct for DRAM and General Media
 events

Jonathan,

Thanks for your comments.

On Thursday, May 16, 2024 6:33:19 PM GMT+2 Jonathan Cameron wrote:
> On Thu, 16 May 2024 12:19:53 +0200
> 
> "Fabio M. De Francesco" <fabio.m.de.francesco@...ux.intel.com> wrote:
> > cxl_event_common was a poor naming choice and caused confusion with the
> > existing Common Event Record.
> > 
> > Use cxl_event_media as a common structure to record information about DRAM
> > and General Media events because it simplifies handling the two events.
> > 
> > Suggested-by: Dan Williams <dan.j.williams@...el.com>
> > Fixes: 6aec00139d3a ("cxl/core: Add region info to cxl_general_media and
> > cxl_dram events") Signed-off-by: Fabio M. De Francesco
> > <fabio.m.de.francesco@...ux.intel.com> ---
> 
> Packing question inline.
>
> > [...]
> > 
> > -struct cxl_event_dram {
> > +struct cxl_event_media {
> > 
> >  	struct cxl_event_record_hdr hdr;
> > 
> > -	__le64 phys_addr;
> > -	u8 descriptor;
> > -	u8 type;
> > -	u8 transaction_type;
> > -	u8 validity_flags[2];
> > -	u8 channel;
> > -	u8 rank;
> > -	u8 nibble_mask[3];
> > -	u8 bank_group;
> > -	u8 bank;
> > -	u8 row[3];
> > -	u8 column[2];
> > -	u8 correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE];
> > -	u8 reserved[0x17];
> > +	struct_group_tagged(cxl_event_media_hdr, media_hdr,
> > +		__le64 phys_addr;
> > +		u8 descriptor;
> > +		u8 type;
> > +		u8 transaction_type;
> > +		u8 validity_flags[2];
> > +		u8 channel;
> > +		u8 rank;
> > +	);
> 
> Does the struct that is created end up __packed?

No, I should have noticed it.

> Also, why is tagged useful here?

It is not useful. I'll rework it not tagged.

Again thanks,

Fabio

> > +	union {
> > +		struct_group(general,
> > +			u8 device[3];
> > +			u8 
component_id[CXL_EVENT_GEN_MED_COMP_ID_SIZE];
> > +			u8 gen_reserved[46];
> > +		);
> > +		struct_group(dram,
> > +			u8 nibble_mask[3];
> > +			u8 bank_group;
> > +			u8 bank;
> > +			u8 row[3];
> > +			u8 column[2];
> > +			u8 
correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE];
> > +			u8 dram_reserved[0x17];
> > +		);
> > +	};
> > 
> >  } __packed;
> >  



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ