[PATCH v10 5/5] drm/xe/xe_vm: Implement xe_vm_get_property_ioctl
Cavitt, Jonathan
jonathan.cavitt at intel.com
Mon Mar 24 21:31:27 UTC 2025
-----Original Message-----
From: Jadav, Raag <raag.jadav at intel.com>
Sent: Monday, March 24, 2025 2:26 PM
To: Cavitt, Jonathan <jonathan.cavitt at intel.com>
Cc: intel-xe at lists.freedesktop.org; Gupta, saurabhg <saurabhg.gupta at intel.com>; Zuo, Alex <alex.zuo at intel.com>; joonas.lahtinen at linux.intel.com; Brost, Matthew <matthew.brost at intel.com>; Zhang, Jianxun <jianxun.zhang at intel.com>; Lin, Shuicheng <shuicheng.lin at intel.com>; dri-devel at lists.freedesktop.org; Wajdeczko, Michal <Michal.Wajdeczko at intel.com>; Mrozek, Michal <michal.mrozek at intel.com>
Subject: Re: [PATCH v10 5/5] drm/xe/xe_vm: Implement xe_vm_get_property_ioctl
>
> On Mon, Mar 24, 2025 at 10:27:08PM +0530, Cavitt, Jonathan wrote:
> > From: Jadav, Raag <raag.jadav at intel.com>
> > > On Thu, Mar 20, 2025 at 03:26:15PM +0000, Jonathan Cavitt wrote:
> > > > Add support for userspace to request a list of observed faults
> > > > from a specified VM.
> > >
> > > ...
> > >
> > > > +static int xe_vm_get_property_size(struct xe_vm *vm, u32 property)
> > > > +{
> > > > + int size = -EINVAL;
> > >
> > > Mixing size and error codes is usually received with mixed feelings.
> > >
> > > > +
> > > > + switch (property) {
> > > > + case DRM_XE_VM_GET_PROPERTY_FAULTS:
> > > > + spin_lock(&vm->faults.lock);
> > > > + size = vm->faults.len * sizeof(struct xe_vm_fault);
> > >
> > > size_mul() and,
> > > [1] perhaps fill it up into the pointer passed by the caller here?
> >
> > "The pointer passed by the caller". You mean the args pointer?
> >
> > We'd still need to check that the args->size value is empty here before overwriting
> > it, and we'd also still need to return the size to the ioctl so we can verify it's
> > acceptable later in xe_vm_get_property_verify_size.
> >
> > Unless you want to merge those two processes together into here?
>
> The semantics are a bit fuzzy to me. Why do we have a single ioctl for
> two different processes? Shouldn't they be handled separately?
No. Sorry. Let me clarify.
"two different processes" = getting the size + verifying the size.
-Jonathan Cavitt
>
> Raag
>
More information about the Intel-xe
mailing list