From: John Harrison <john.c.harrison@intel.com>
To: "Cavitt, Jonathan" <jonathan.cavitt@intel.com>,
"Intel-Xe@Lists.FreeDesktop.Org" <Intel-Xe@Lists.FreeDesktop.Org>
Subject: Re: [PATCH 2/2] drm/xe/guc: Add support for NPK as a GuC log target
Date: Wed, 11 Jun 2025 16:57:00 -0700 [thread overview]
Message-ID: <a47f94c7-7677-4945-ba4e-cba894428472@intel.com> (raw)
In-Reply-To: <CH0PR11MB5444BB01251782688FECD0E6E575A@CH0PR11MB5444.namprd11.prod.outlook.com>
On 6/11/2025 3:04 PM, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of John.C.Harrison@Intel.com
> Sent: Wednesday, June 11, 2025 2:06 PM
> To: Intel-Xe@Lists.FreeDesktop.Org
> Cc: Harrison, John C <john.c.harrison@intel.com>
> Subject: [PATCH 2/2] drm/xe/guc: Add support for NPK as a GuC log target
>> From: John Harrison <John.C.Harrison@Intel.com>
>>
>> The GuC has an option to write log data via NPK. This is basically a
>> magic IO address that GuC writes arbitrary data to and which can be
>> logged by a suitable hardware logger. This can allow retrieval of the
>> GuC log in hardware debug environments even when the system as a whole
>> dies horribly.
>>
>> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
> So, this is basically a new modparam value that redirects GuC logs to
> a specific IO address? I take it guc_log_target = 2 is the default value, and
> guc_log_target = 1 would print the logs to stdout, then? I'd ask why we
> use 0 as a default value and not just default to 2 all the time, but I think I
> already know why (we need to guard against guc_log_target = 0 anyways
> to prevent printing to stdin).
Um, read the patch - "(0=memory [default], 1 = NPK, 2 = memory + NPK)".
The default is zero. And no, nothing prints to stdout. This is about
hardware level debugging. It has nothing to do with stdin/stdout/stderr.
Those concepts do not exist in hardware nor in the KMD. If you send the
GuC log to the NPK target then you need a hardware debugger (JTAG, etc.)
to read it, as described in the commit message.
>
> I also take it this is modified on boot by, for example, writing
> "xe.guc_log_target=1" to CMDLINE_LINUX_DEFAULT as a part of the grub file.
That is generally how module parameters work. You can also set via
modprobe.conf files as long as the Xe driver is a module and not
compiled in.
John.
>
> Yeah, seems good.
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> -Jonathan Cavitt
>
>> ---
>> drivers/gpu/drm/xe/xe_guc.c | 4 ++++
>> drivers/gpu/drm/xe/xe_module.c | 4 ++++
>> drivers/gpu/drm/xe/xe_module.h | 1 +
>> 3 files changed, 9 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
>> index e16d19b44bcc..9c0e3113f7d5 100644
>> --- a/drivers/gpu/drm/xe/xe_guc.c
>> +++ b/drivers/gpu/drm/xe/xe_guc.c
>> @@ -35,6 +35,7 @@
>> #include "xe_guc_submit.h"
>> #include "xe_memirq.h"
>> #include "xe_mmio.h"
>> +#include "xe_module.h"
>> #include "xe_platform_types.h"
>> #include "xe_sriov.h"
>> #include "xe_uc.h"
>> @@ -74,6 +75,9 @@ static u32 guc_ctl_debug_flags(struct xe_guc *guc)
>> else
>> flags |= FIELD_PREP(GUC_LOG_VERBOSITY, GUC_LOG_LEVEL_TO_VERBOSITY(level));
>>
>> + if (xe_modparam.guc_log_target)
>> + flags |= FIELD_PREP(GUC_LOG_DESTINATION, xe_modparam.guc_log_target);
>> +
>> return flags;
>> }
>>
>> diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
>> index 1c4dfafbcd0b..fc8c681819b9 100644
>> --- a/drivers/gpu/drm/xe/xe_module.c
>> +++ b/drivers/gpu/drm/xe/xe_module.c
>> @@ -21,6 +21,7 @@
>> struct xe_modparam xe_modparam = {
>> .probe_display = true,
>> .guc_log_level = 3,
>> + .guc_log_target = 0,
>> .force_probe = CONFIG_DRM_XE_FORCE_PROBE,
>> #ifdef CONFIG_PCI_IOV
>> .max_vfs = IS_ENABLED(CONFIG_DRM_XE_DEBUG) ? ~0 : 0,
>> @@ -45,6 +46,9 @@ MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size (in MiB) - <0=disable-res
>> module_param_named(guc_log_level, xe_modparam.guc_log_level, int, 0600);
>> MODULE_PARM_DESC(guc_log_level, "GuC firmware logging level (0=disable, 1..5=enable with verbosity min..max)");
>>
>> +module_param_named(guc_log_target, xe_modparam.guc_log_target, int, 0600);
>> +MODULE_PARM_DESC(guc_log_target, "GuC firmware logging target (0=memory [default], 1 = NPK, 2 = memory + NPK)");
>> +
>> module_param_named_unsafe(guc_firmware_path, xe_modparam.guc_firmware_path, charp, 0400);
>> MODULE_PARM_DESC(guc_firmware_path,
>> "GuC firmware path to use instead of the default one");
>> diff --git a/drivers/gpu/drm/xe/xe_module.h b/drivers/gpu/drm/xe/xe_module.h
>> index 5a3bfea8b7b4..4d978f6f26b6 100644
>> --- a/drivers/gpu/drm/xe/xe_module.h
>> +++ b/drivers/gpu/drm/xe/xe_module.h
>> @@ -14,6 +14,7 @@ struct xe_modparam {
>> bool probe_display;
>> u32 force_vram_bar_size;
>> int guc_log_level;
>> + int guc_log_target;
>> char *guc_firmware_path;
>> char *huc_firmware_path;
>> char *gsc_firmware_path;
>> --
>> 2.49.0
>>
>>
next prev parent reply other threads:[~2025-06-11 23:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 21:05 [PATCH 0/2] Clean up of GuC init data macros John.C.Harrison
2025-06-11 21:05 ` [PATCH 1/2] drm/xe/guc: Clean up of GuC 'CTL' defines John.C.Harrison
2025-06-11 22:04 ` Cavitt, Jonathan
2025-06-12 22:01 ` Lucas De Marchi
2025-06-11 21:05 ` [PATCH 2/2] drm/xe/guc: Add support for NPK as a GuC log target John.C.Harrison
2025-06-11 21:49 ` Lucas De Marchi
2025-06-11 23:51 ` John Harrison
2025-06-12 22:05 ` Lucas De Marchi
2025-06-12 23:43 ` John Harrison
2025-06-11 22:04 ` Cavitt, Jonathan
2025-06-11 23:57 ` John Harrison [this message]
2025-06-12 14:32 ` Cavitt, Jonathan
2025-06-12 17:49 ` John Harrison
2025-06-12 18:27 ` Cavitt, Jonathan
2025-06-12 18:47 ` John Harrison
2025-06-12 19:52 ` Cavitt, Jonathan
2025-06-12 19:30 ` Summers, Stuart
2025-06-11 21:11 ` ✓ CI.checkpatch: success for Clean up of GuC init data macros Patchwork
2025-06-11 21:12 ` ✓ CI.KUnit: " Patchwork
2025-06-11 21:23 ` ✓ CI.Build: " Patchwork
2025-06-11 21:25 ` ✓ CI.Hooks: " Patchwork
2025-06-11 21:27 ` ✓ CI.checksparse: " Patchwork
2025-06-11 22:19 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-12 8:01 ` ✗ Xe.CI.Full: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-07-23 21:20 [PATCH 0/2] Clean up of GuC init data macros & add extra log option John.C.Harrison
2025-07-23 21:20 ` [PATCH 2/2] drm/xe/guc: Add support for NPK as a GuC log target John.C.Harrison
2025-07-24 16:01 ` Lucas De Marchi
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=a47f94c7-7677-4945-ba4e-cba894428472@intel.com \
--to=john.c.harrison@intel.com \
--cc=Intel-Xe@Lists.FreeDesktop.Org \
--cc=jonathan.cavitt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox