Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
To: "Yu, Effie" <effie.yu@intel.com>,
	"Brost, Matthew" <matthew.brost@intel.com>,
	"Nerlige Ramappa, Umesh" <umesh.nerlige.ramappa@intel.com>,
	"Zhang, Carl" <carl.zhang@intel.com>,
	"Hazubski, Filip" <filip.hazubski@intel.com>,
	"Souza, Jose" <jose.souza@intel.com>,
	"Konieczny, Kamil" <kamil.konieczny@intel.com>
Cc: "lionel.g.landwerlin@linux.intel.com"
	<lionel.g.landwerlin@linux.intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [Intel-xe] [PATCH v2 3/4] fixup! drm/xe: Introduce a new DRM driver for Intel GPUs
Date: Wed, 16 Aug 2023 22:16:32 +0000	[thread overview]
Message-ID: <c5182c38944d33bc2d379116c55c10d8bff2db55.camel@intel.com> (raw)
In-Reply-To: <ZNvGn7kpYmtDMrH6@orsosgc001.jf.intel.com>



On Tue, 2023-08-15 at 11:40 -0700, Umesh Nerlige Ramappa wrote:
> Hi Matt, Rodrigo,
> 
> I have a uAPI change here that breaks UMDs. How do I land this and
> what 
> UMDs should I inform for updating xe_drm.h?

We need to ensure that we are in sync with all the UMD contacts
(as listed in our internal gfx-linux page)

Cc: Jose Souza <jose.souza@intel.com>
Cc: Filip Hazubski <filip.hazubski@intel.com>
Cc: Carl Zhang <carl.zhang@intel.com>
Cc: Effie Yu <effie.yu@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@intel.com>

Also, ensure that all the components have their implementation
ready to be able to push all simultaneously in the least disruptive
way.

Needless to say, but maybe worth, that we are only doing this
because we are out of tree yet. We won't be able to break it
again soon when we are in tree.

> 
> Thanks,
> Umesh
> 
> On Tue, Aug 15, 2023 at 07:03:42AM -0700, Souza, Jose wrote:
> > On Mon, 2023-08-14 at 15:37 -0700, Umesh Nerlige Ramappa wrote:
> > > struct drm_xe_engine_class_instance might get padded for 64-bit
> > > alignment based on compiler used. Since engine information is
> > > kmalloced
> > > in the query and drm_xe_engine_class_instance may be padded, it
> > > could
> > > potentially leak some kernel memory to user.
> > > 
> > > Add a rsvd field to struct drm_xe_engine_class_instance to make
> > > it
> > > 64-bit aligned and zero out the field before returning to user.
> > > 
> > > Signed-off-by: Umesh Nerlige Ramappa
> > > <umesh.nerlige.ramappa@intel.com>
> > > ---
> > >  drivers/gpu/drm/xe/xe_query.c | 7 +++++--
> > >  include/uapi/drm/xe_drm.h     | 1 +
> > >  2 files changed, 6 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/xe/xe_query.c
> > > b/drivers/gpu/drm/xe/xe_query.c
> > > index 99a4800c7c53..b9d565264ceb 100644
> > > --- a/drivers/gpu/drm/xe/xe_query.c
> > > +++ b/drivers/gpu/drm/xe/xe_query.c
> > > @@ -65,7 +65,7 @@ static int query_engines(struct xe_device *xe,
> > >                 return -EINVAL;
> > >         }
> > > 
> > > -       hw_engine_info = kmalloc(size, GFP_KERNEL);
> > > +       hw_engine_info = kzalloc(size, GFP_KERNEL);
> > >         if (!hw_engine_info)
> > >                 return -ENOMEM;
> > > 
> > > @@ -78,7 +78,10 @@ static int query_engines(struct xe_device *xe,
> > >                                 xe_to_user_engine_class[hwe-
> > > >class];
> > >                         hw_engine_info[i].engine_instance =
> > >                                 hwe->logical_instance;
> > > -                       hw_engine_info[i++].gt_id = gt->info.id;
> > > +                       hw_engine_info[i].gt_id = gt->info.id;
> > > +                       hw_engine_info[i].rsvd = 0;
> > > +
> > > +                       i++;
> > >                 }
> > > 
> > >         if (copy_to_user(query_ptr, hw_engine_info, size)) {
> > > diff --git a/include/uapi/drm/xe_drm.h
> > > b/include/uapi/drm/xe_drm.h
> > > index 86f16d50e9cc..53cd57342620 100644
> > > --- a/include/uapi/drm/xe_drm.h
> > > +++ b/include/uapi/drm/xe_drm.h
> > > @@ -753,6 +753,7 @@ struct drm_xe_engine_class_instance {
> > > 
> > >         __u16 engine_instance;
> > >         __u16 gt_id;
> > > +       __u16 rsvd;
> > 
> > I don't think this change should be fixup, as this breaks the uAPI.
> > Please ping the Rodrigo, Matt Brost... about what we should do
> > here.
> > But at least you need to sync with other UMD contacts about landing
> > this change at the same time UMDs update their xe_drm.h.
> > 
> > >  };
> > > 
> > >  struct drm_xe_exec_queue_create {
> > 


  reply	other threads:[~2023-08-16 22:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 22:37 [Intel-xe] [PATCH v2 0/4] Port CPU-GPU timestamp correlation to XE KMD Umesh Nerlige Ramappa
2023-08-14 22:37 ` [Intel-xe] [PATCH v2 1/4] fixup! drm/xe: Introduce a new DRM driver for Intel GPUs Umesh Nerlige Ramappa
2023-08-14 22:37 ` [Intel-xe] [PATCH v2 2/4] " Umesh Nerlige Ramappa
2023-08-14 22:37 ` [Intel-xe] [PATCH v2 3/4] " Umesh Nerlige Ramappa
2023-08-14 22:51   ` Umesh Nerlige Ramappa
2023-08-15 14:03   ` Souza, Jose
2023-08-15 16:42     ` Niranjana Vishwanathapura
2023-08-15 18:40     ` Umesh Nerlige Ramappa
2023-08-16 22:16       ` Vivi, Rodrigo [this message]
2023-09-14 19:32       ` Rodrigo Vivi
2023-08-14 22:37 ` [Intel-xe] [PATCH v2 4/4] drm/xe: Correlate engine and cpu timestamps with better accuracy Umesh Nerlige Ramappa
2023-08-15 14:07   ` Souza, Jose
2023-08-15 16:41   ` Niranjana Vishwanathapura
2023-08-15 16:43     ` Souza, Jose
2023-08-15 18:32     ` Umesh Nerlige Ramappa
2023-09-01 17:58   ` Souza, Jose
2023-09-14 20:01   ` Rodrigo Vivi
2023-08-14 22:40 ` [Intel-xe] ✓ CI.Patch_applied: success for Port CPU-GPU timestamp correlation to XE KMD Patchwork
2023-08-14 22:40 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-14 22:41 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-14 22:45 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-14 22:46 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-14 22:46 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-14 23:34 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-08-15  1:51   ` Umesh Nerlige Ramappa
  -- strict thread matches above, loose matches on Subject: below --
2023-09-21 11:14 [Intel-xe] [PATCH v2 0/4] Xe runtime pm refactoring Jouni Högander
2023-09-21 11:14 ` [Intel-xe] [PATCH v2 3/4] fixup! drm/xe: Introduce a new DRM driver for Intel GPUs Jouni Högander
2023-09-21 16:28   ` Rodrigo Vivi

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=c5182c38944d33bc2d379116c55c10d8bff2db55.camel@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=carl.zhang@intel.com \
    --cc=effie.yu@intel.com \
    --cc=filip.hazubski@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=kamil.konieczny@intel.com \
    --cc=lionel.g.landwerlin@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=umesh.nerlige.ramappa@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