From: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
To: Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Shiju Jose <shiju.jose@huawei.com>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ard Biesheuvel <ardb@kernel.org>,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-cxl@vger.kernel.org
Subject: Re: [PATCH RFC v4 5/6] firmware/efi: Process CXL Component Events
Date: Tue, 28 Nov 2023 12:32:40 -0800 [thread overview]
Message-ID: <7ec6d2af-c860-9b05-7eaf-c82f50f8e66e@amd.com> (raw)
In-Reply-To: <20230601-cxl-cper-v4-5-47bb901f135e@intel.com>
Hi Ira,
I tested this out. Just one correction below to make it work.
On 11/9/2023 2:07 PM, Ira Weiny wrote:
> BIOS can configure memory devices as firmware first. This will send CXL
> events to the firmware instead of the OS. The firmware can then send
> these events to the OS via UEFI.
>
> UEFI v2.10 section N.2.14 defines a Common Platform Error Record (CPER)
> format for CXL Component Events. The format is mostly the same as the
> CXL Common Event Record Format. The difference is a GUID is used in
> the Section Type to identify the event type.
>
> Add EFI support to detect CXL CPER records and call a notifier chain
> with the record data blobs to be processed by the CXL code.
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
>
> ---
> Changes from RFC v3
> [Smita: ensure cper_cxl_event_rec is packed]
>
> Changes from RFC v2
> [djbw: use common event structures]
> [djbw: remove print in core cper code]
> [djbw: export register call as NS_GPL]
> [iweiny: fix 0day issues]
>
> Changes from RFC v1
> [iweiny: use an enum for know record types and skip converting GUID to UUID]
> [iweiny: commit to the UUID not being part of the event record data]
> [iweiny: use defines for GUID definitions]
> ---
[snip]
> diff --git a/include/linux/cxl-event.h b/include/linux/cxl-event.h
> index 6b689e1efc78..733ab2ab8639 100644
> --- a/include/linux/cxl-event.h
> +++ b/include/linux/cxl-event.h
> @@ -108,4 +108,53 @@ struct cxl_event_record_raw {
> union cxl_event event;
> } __packed;
>
> +enum cxl_event_type {
> + CXL_CPER_EVENT_GEN_MEDIA,
> + CXL_CPER_EVENT_DRAM,
> + CXL_CPER_EVENT_MEM_MODULE,
> +};
> +
> +#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..
Thanks,
Smita
> +
> +struct cxl_cper_notifier_data {
> + enum cxl_event_type event_type;
> + struct cper_cxl_event_rec *rec;
> +};
> +
> +#ifdef CONFIG_UEFI_CPER
> +int register_cxl_cper_notifier(struct notifier_block *nb);
> +void unregister_cxl_cper_notifier(struct notifier_block *nb);
> +#else
> +static inline int register_cxl_cper_notifier(struct notifier_block *nb)
> +{
> + return 0;
> +}
> +
> +static inline void unregister_cxl_cper_notifier(struct notifier_block *nb) { }
> +#endif
> +
> #endif /* _LINUX_CXL_EVENT_H */
>
next prev parent reply other threads:[~2023-11-28 20:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 22:07 [PATCH RFC v4 0/6] efi/cxl-cper: Report CPER CXL component events through trace events Ira Weiny
2023-11-09 22:07 ` [PATCH RFC v4 1/6] cxl/trace: Pass uuid explicitly to event traces Ira Weiny
2023-11-09 22:07 ` [PATCH RFC v4 2/6] cxl/events: Promote CXL event structures to a core header Ira Weiny
2023-11-09 22:07 ` [PATCH RFC v4 3/6] cxl/events: Separate UUID from event structures Ira Weiny
2023-11-09 22:07 ` [PATCH RFC v4 4/6] cxl/events: Create a CXL event union Ira Weiny
2023-11-09 22:07 ` [PATCH RFC v4 5/6] firmware/efi: Process CXL Component Events Ira Weiny
2023-11-28 20:32 ` Smita Koralahalli [this message]
2023-11-29 14:28 ` Ira Weiny
2023-12-13 17:13 ` Jonathan Cameron
2023-12-13 22:28 ` Ira Weiny
2023-12-19 17:12 ` Jonathan Cameron
2023-12-20 23:48 ` Ira Weiny
2024-01-03 17:50 ` Jonathan Cameron
2024-01-03 20:40 ` Ira Weiny
2023-11-09 22:07 ` [PATCH RFC v4 6/6] cxl/memdev: Register for and process CPER events Ira Weiny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7ec6d2af-c860-9b05-7eaf-c82f50f8e66e@amd.com \
--to=smita.koralahallichannabasappa@amd.com \
--cc=alison.schofield@intel.com \
--cc=ardb@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shiju.jose@huawei.com \
--cc=vishal.l.verma@intel.com \
--cc=yazen.ghannam@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox