From: Raag Jadav <raag.jadav@intel.com>
To: Badal Nilawar <badal.nilawar@intel.com>
Cc: intel-xe@lists.freedesktop.org, anshuman.gupta@intel.com,
rodrigo.vivi@intel.com, daniele.ceraolospurio@intel.com,
riana.tauro@intel.com, mallesh.koujalagi@intel.com,
aravind.iddamsetty@intel.com, himal.prasad.ghimiray@intel.com,
arvind.yadav@intel.com, syed.abdul.muqthyar.ahmed@intel.com,
nitin.r.gote@intel.com
Subject: Re: [PATCH v6 04/10] drm/xe/cper: Construct CPER record for hardware errors
Date: Wed, 28 Oct 2026 17:52:59 +0100 [thread overview]
Message-ID: <auIoa-LxjETpt0LR@black.igk.intel.com> (raw)
In-Reply-To: <20261028095723.734387-16-badal.nilawar@intel.com>
On Wed, Oct 28, 2026 at 03:27:28PM +0530, Badal Nilawar wrote:
> Assemble the CPER record header, section descriptor and the Intel
> error section for Intel GPU hardware errors.
...
> +static void cper_init_record_hdr(struct xe_device *xe, u8 severity,
> + const guid_t *notification_type,
> + struct cper_record_header *rhdr,
> + u32 total_len)
> +{
> + const guid_t *device_guid;
> + struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
Reverse xmas order please!
> + /* Assemble the CPER record header (UEFI Appendix N.2.1) */
> + memcpy(rhdr->signature, CPER_SIG_RECORD, CPER_SIG_SIZE);
> + rhdr->revision = CPER_RECORD_REV;
> + rhdr->signature_end = CPER_SIG_END;
> + rhdr->section_count = 1;
> + rhdr->error_severity = severity;
> + rhdr->validation_bits = CPER_VALID_TIMESTAMP;
> + rhdr->record_length = total_len;
> + rhdr->timestamp = cper_timestamp_now();
> + rhdr->creator_id = INTEL_CPER_CREATOR_XEKMD;
> + rhdr->notification_type = *notification_type;
> + rhdr->record_id = cper_next_record_id();
Blank line here.
> + device_guid = lookup_device_guid(pdev);
> + if (device_guid) {
> + rhdr->platform_id = *device_guid;
> + rhdr->validation_bits |= CPER_VALID_PLATFORM_ID;
> + } else {
> + xe_printk(xe, warn_once, "CPER: no platform GUID for device %04x\n",
> + pdev->device);
Move this to lookup_device_guid() before returning NULL.
> + }
> +}
> +
> +static void cper_init_section_desc(struct xe_device *xe, u8 severity,
> + struct cper_section_descriptor *sdesc,
> + u32 einfo_len)
> +{
> + sdesc->section_offset = sizeof(struct cper_record_header) +
> + sizeof(struct cper_section_descriptor);
> + sdesc->section_length = sizeof(struct xe_cper_intel_hdr) + einfo_len;
> + sdesc->revision = CPER_SEC_REV;
> + sdesc->validation_bits = 0;
> + sdesc->section_type = INTEL_CPER_SECTION_ACCEL_GENERIC;
> + sdesc->section_severity = severity;
Blank line here.
> + if (xe->info.has_device_uid) {
> + memcpy(&sdesc->fru_id, &xe->device_uid, sizeof(xe->device_uid));
> + sdesc->validation_bits |= CPER_SEC_VALID_FRU_ID;
> + }
> +}
> +
> +static void cper_record_emit(struct xe_device *xe, u8 severity,
> + const guid_t *notification_type,
> + const struct xe_cper_intel_hdr *ihdr,
> + const void *einfo, u32 einfo_len)
> +{
> + struct cper_section_descriptor *sdesc;
> + struct cper_record_header *rhdr;
> + struct xe_cper_nonstd_record *rec;
> + u32 total_len;
Reverse xmas order please!
And with that
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
> + total_len = sizeof(struct xe_cper_nonstd_record) + einfo_len;
> + rec = kzalloc(total_len, GFP_KERNEL);
> + if (!rec)
> + return;
> +
> + rhdr = &rec->record_hdr;
> + sdesc = &rec->section_desc;
> +
> + /* Assemble the CPER record header (UEFI Appendix N.2.1) */
> + cper_init_record_hdr(xe, severity, notification_type, rhdr, total_len);
> +
> + /* Assemble the section descriptor (UEFI Appendix N.2.2) */
> + cper_init_section_desc(xe, severity, sdesc, einfo_len);
> +
> + /* Copy the Intel-specific section header */
> + rec->intel_hdr = *ihdr;
> +
> + /* Append optional variable-length error info */
> + if (einfo && einfo_len)
> + memcpy((u8 *)rec + sizeof(*rec), einfo, einfo_len);
> +
> + /* TODO: Emit trace event */
> +
> + kfree(rec);
> +}
next prev parent reply other threads:[~2026-10-28 16:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 9:57 [PATCH v6 00/10] Add CPER logging support for CRI Badal Nilawar
2026-10-28 9:57 ` [PATCH v6 01/10] drm/xe/cper: Add CPER reporting entry point for xe_log Badal Nilawar
2026-10-28 16:22 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 02/10] drm/xe/cper: Retrieve the error counter record for CPER reporting Badal Nilawar
2026-10-28 16:25 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 03/10] drm/xe/cper: Initialize Intel-specific CPER header Badal Nilawar
2026-10-28 16:34 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 04/10] drm/xe/cper: Construct CPER record for hardware errors Badal Nilawar
2026-10-28 16:52 ` Raag Jadav [this message]
2026-10-28 9:57 ` [PATCH v6 05/10] drm/xe/cper: Log CPER records for aggregate counter retrieval Badal Nilawar
2026-10-28 10:30 ` sashiko-bot
2026-10-28 17:05 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 06/10] drm/xe/cper: Emit cper record to trace buf Badal Nilawar
2026-10-28 17:06 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 07/10] drm/xe/xe_ras: Report device memory errors using SIGID Badal Nilawar
2026-10-28 17:07 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 08/10] drm/xe/xe_ras: Report core compute " Badal Nilawar
2026-10-28 9:57 ` [PATCH v6 09/10] drm/xe/xe_ras: Report soc internal " Badal Nilawar
2026-10-28 17:17 ` Raag Jadav
2026-10-28 9:57 ` [PATCH v6 10/10] drm/xe/xe_ras: Report correctable " Badal Nilawar
2026-10-28 10:05 ` ✗ CI.checkpatch: warning for Add CPER logging support for CRI (rev6) Patchwork
2026-10-28 10:07 ` ✓ CI.KUnit: success " Patchwork
2026-10-28 10:43 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-28 18:37 ` ✓ Xe.CI.FULL: " Patchwork
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=auIoa-LxjETpt0LR@black.igk.intel.com \
--to=raag.jadav@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=aravind.iddamsetty@intel.com \
--cc=arvind.yadav@intel.com \
--cc=badal.nilawar@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=mallesh.koujalagi@intel.com \
--cc=nitin.r.gote@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=syed.abdul.muqthyar.ahmed@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.