From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v2 3/5] drm/i915/guc: Provide debugfs for log relay sub-buf info
Date: Tue, 14 Mar 2023 22:09:32 +0000 [thread overview]
Message-ID: <ad3b70fd2067f53ca512298b2e9f73dcda1fa9fd.camel@intel.com> (raw)
In-Reply-To: <1990314c00a789781b40d4ddff1ee647dcf78fb6.camel@intel.com>
On Thu, 2023-03-09 at 15:29 -0800, Teres Alexis, Alan Previn wrote:
> > >
alan:snip
> > > +static int guc_log_relay_subbuf_size_get(void *data, u64 *val)
> > > +{
> > > + struct intel_guc_log *log = data;
> > > +
> > > + if (!log->vma)
> > > + return -ENODEV;
> >
> > For the record, from the other email thread, the issue here is whether this
> > check is needed.
> >
> > Also, the issue is what happens if the relay is open and we unload the
> > module, what happens?
> >
> I'll retest this - but I clearly remember that if the user space app was stil holding
> onto the debugfs handle, the i915 unload would go through most of the driver unload /
> unregister steps, while the app doesnt get any signals but if the app were to close that
> handle after that, (guc_log_relay_ctl_release gets called), we do get invalid ptr access
> in kernel. Take note the logger tool runs with sudo. That said something "like" above check
> is required but perhaps hanging off a still-valid ptr (like i915->foo - maybe gt-struct validity
> - but needs something that is explicitly cleared on unload, not left around with stale ptrs.
>
An update on this above after some digging / testing : I believe we dont we need to check
for "log->vma" validity as you had suspected. However, I did find other legacy debugfs
functions for relay logging that DID check for it - so I must have been trying to maintain
consistency. That said, i will probably remove the check from other legacy functions as well
so they are all consistently not checking for it since its not required.
However, in the process of testing, i found an issue when connecting relay logger tool
and unloading driver. On one hand this is a debugfs interface and we may be able to fix that
later as the use-case doesnt really expect used to run this tool while unloading the driver.
On the other hand some of my colleagues did stress that crashing in kernel is something we cannot
igore and knowably allow. Considering the fact that relay logging tool is not working at all
upstream today, this patch could "unmask" that error. Finally, i too find myself, as part of testing /
debugging, occasionally forgetting to stop the relay logger tool when unloading and i cant even do
simple soft-reboot because of how bad things get in the i915. Given all considerations, I'm compelled
to fix that properly now. Previously, the majority of the time taken for this series was mostly
tied to the intel_guc_logger side of the effort, not the kernel changes. But for this fix, i think
more time + changes will be required on the kernel side.
next prev parent reply other threads:[~2023-03-14 22:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 9:20 [Intel-gfx] [PATCH v2 0/5] drm/i915/guc: Update GuC relay logging debugfs Alan Previn
2022-12-06 9:20 ` [Intel-gfx] [PATCH v2 1/5] drm/i915/guc: Fix GuC relay log debugfs failing open Alan Previn
2022-12-06 9:20 ` [Intel-gfx] [PATCH v2 2/5] drm/i915/guc: Add unaligned wc memcpy for copying GuC Log Alan Previn
2022-12-06 10:14 ` Tvrtko Ursulin
2022-12-06 21:35 ` Teres Alexis, Alan Previn
2022-12-07 9:20 ` Teres Alexis, Alan Previn
2022-12-07 10:17 ` Tvrtko Ursulin
2022-12-07 18:15 ` Teres Alexis, Alan Previn
2022-12-06 9:20 ` [Intel-gfx] [PATCH v2 3/5] drm/i915/guc: Provide debugfs for log relay sub-buf info Alan Previn
2022-12-07 16:43 ` Dixit, Ashutosh
2023-03-09 23:29 ` Teres Alexis, Alan Previn
2023-03-14 22:09 ` Teres Alexis, Alan Previn [this message]
2022-12-06 9:20 ` [Intel-gfx] [PATCH v2 4/5] drm/i915/guc: Rename GuC log relay debugfs descriptively Alan Previn
2022-12-07 16:50 ` Dixit, Ashutosh
2023-03-09 23:36 ` Teres Alexis, Alan Previn
2023-03-10 5:41 ` Teres Alexis, Alan Previn
2022-12-06 9:21 ` [Intel-gfx] [PATCH v2 5/5] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc Alan Previn
2022-12-07 17:24 ` Dixit, Ashutosh
2023-03-09 23:37 ` Teres Alexis, Alan Previn
2022-12-06 13:42 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/guc: Update GuC relay logging debugfs Patchwork
2022-12-06 17:42 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=ad3b70fd2067f53ca512298b2e9f73dcda1fa9fd.camel@intel.com \
--to=alan.previn.teres.alexis@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).