[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231213171351.00004579@Huawei.com>
Date: Wed, 13 Dec 2023 17:13:51 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ira Weiny <ira.weiny@...el.com>
CC: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>,
Dan Williams <dan.j.williams@...el.com>,
Shiju Jose <shiju.jose@...wei.com>,
"Yazen Ghannam" <yazen.ghannam@....com>,
Davidlohr Bueso <dave@...olabs.net>,
"Dave Jiang" <dave.jiang@...el.com>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
"Ard Biesheuvel" <ardb@...nel.org>, <linux-efi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-cxl@...r.kernel.org>
Subject: Re: [PATCH RFC v4 5/6] firmware/efi: Process CXL Component Events
On Wed, 29 Nov 2023 06:28:01 -0800
Ira Weiny <ira.weiny@...el.com> wrote:
> Smita Koralahalli wrote:
> > Hi Ira,
> >
> > I tested this out. Just one correction below to make it work.
> >
>
> [snip]
>
> > > +
> > > +#define CPER_CXL_DEVICE_ID_VALID BIT(0)
> > > +#define CPER_CXL_DEVICE_SN_VALID BIT(1)
> > > +#define CPER_CXL_COMP_EVENT_LOG_VALID BIT(2)
> > > +struct cper_cxl_event_rec {
> > > + struct {
> > > + u32 length;
> > > + u64 validation_bits;
> > > + struct cper_cxl_event_devid {
> > > + u16 vendor_id;
> > > + u16 device_id;
> > > + u8 func_num;
> > > + u8 device_num;
> > > + u8 bus_num;
> > > + u16 segment_num;
> > > + u16 slot_num; /* bits 2:0 reserved */
> > > + u8 reserved;
> > > + } device_id;
> > > + struct cper_cxl_event_sn {
> > > + u32 lower_dw;
> > > + u32 upper_dw;
> > > + } dev_serial_num;
> > > + } hdr;
> > > +
> > > + union cxl_event event;
> > > +} __packed;
> >
> > __packed attribute just for cper_cxl_event_rec still fails to properly
> > align structure elements. Looks like, __packed attribute is needed for
> > all structs (cper_cxl_event_devid and cper_cxl_event_sn) inside
> > cper_cxl_event_rec.
> >
> > Seems easier to use global pragma instead.. I could test and obtain the
> > output as expected using pragma..
>
> I did not know that was acceptable in the kernel but I see you used it in
> cper_cxl.h before...
>
> Ok I'll do that and spin again.
>
> Thanks so much for testing this! I was out last week and still don't have
> a test environment.
Easy to hack into QEMU :) Hmm. I have a CCIX patch set from years ago
somewhere that does similar. Would be easy to repurposed. Looks like
I never published them (just told people to ask if they wanted them :( ).
Anyhow, if useful I can dig them out.
>
> Ira
Powered by blists - more mailing lists