All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/query: Split out query item checks
@ 2019-01-09  7:51 Abdiel Janulgue
  2019-01-09  8:23 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Abdiel Janulgue @ 2019-01-09  7:51 UTC (permalink / raw)
  To: intel-gfx

This simplifies adding new query item objects.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_query.c | 40 ++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
index cbcb957b7141..b4f26605f617 100644
--- a/drivers/gpu/drm/i915/i915_query.c
+++ b/drivers/gpu/drm/i915/i915_query.c
@@ -10,12 +10,33 @@
 #include "i915_query.h"
 #include <uapi/drm/i915_drm.h>
 
+static int init_query_item_check(void* data_ptr, size_t data_sz,
+				 u32 total_length,
+				 struct drm_i915_query_item *query_item)
+{
+	if (query_item->length == 0)
+		return total_length;
+
+	if (query_item->length < total_length)
+		return -EINVAL;
+
+	if (copy_from_user(data_ptr, u64_to_user_ptr(query_item->data_ptr),
+			   data_sz))
+		return -EFAULT;
+
+	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
+		       total_length))
+		return -EFAULT;
+
+	return 0;
+}
+
 static int query_topology_info(struct drm_i915_private *dev_priv,
 			       struct drm_i915_query_item *query_item)
 {
 	const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
 	struct drm_i915_query_topology_info topo;
-	u32 slice_length, subslice_length, eu_length, total_length;
+	u32 ret, slice_length, subslice_length, eu_length, total_length;
 
 	if (query_item->flags != 0)
 		return -EINVAL;
@@ -33,23 +54,14 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
 
 	total_length = sizeof(topo) + slice_length + subslice_length + eu_length;
 
-	if (query_item->length == 0)
-		return total_length;
-
-	if (query_item->length < total_length)
-		return -EINVAL;
-
-	if (copy_from_user(&topo, u64_to_user_ptr(query_item->data_ptr),
-			   sizeof(topo)))
-		return -EFAULT;
+	ret = init_query_item_check(&topo, sizeof(topo), total_length,
+				    query_item);
+	if (ret != 0)
+		return ret;
 
 	if (topo.flags != 0)
 		return -EINVAL;
 
-	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
-		       total_length))
-		return -EFAULT;
-
 	memset(&topo, 0, sizeof(topo));
 	topo.max_slices = sseu->max_slices;
 	topo.max_subslices = sseu->max_subslices;
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/query: Split out query item checks
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
@ 2019-01-09  8:23 ` Patchwork
  2019-01-09  8:52 ` ✗ Fi.CI.BAT: failure " Patchwork
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2019-01-09  8:23 UTC (permalink / raw)
  To: Abdiel Janulgue; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/query: Split out query item checks
URL   : https://patchwork.freedesktop.org/series/54917/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
743f34f1ebba drm/i915/query: Split out query item checks
-:19: ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar"
#19: FILE: drivers/gpu/drm/i915/i915_query.c:13:
+static int init_query_item_check(void* data_ptr, size_t data_sz,

total: 1 errors, 0 warnings, 0 checks, 61 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915/query: Split out query item checks
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
  2019-01-09  8:23 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2019-01-09  8:52 ` Patchwork
  2019-01-09  9:25 ` [PATCH] " Tvrtko Ursulin
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2019-01-09  8:52 UTC (permalink / raw)
  To: Abdiel Janulgue; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/query: Split out query item checks
URL   : https://patchwork.freedesktop.org/series/54917/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5380 -> Patchwork_11260
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_11260 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_11260, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/54917/revisions/1/

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_11260:

### IGT changes ###

#### Possible regressions ####

  * igt@pm_rpm@module-reload:
    - fi-skl-6600u:       PASS -> FAIL

  
#### Warnings ####

  * igt@kms_flip@basic-flip-vs-dpms:
    - fi-skl-6770hq:      SKIP -> PASS +36

  * igt@pm_rpm@basic-pci-d3-state:
    - fi-bsw-kefka:       PASS -> SKIP

  
Known issues
------------

  Here are the changes found in Patchwork_11260 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_hangcheck:
    - fi-bwr-2160:        PASS -> DMESG-FAIL [fdo#108735]

  * igt@kms_frontbuffer_tracking@basic:
    - fi-icl-u2:          PASS -> FAIL [fdo#103167]

  * igt@kms_pipe_crc_basic@read-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#107362]

  * igt@pm_rpm@basic-rte:
    - fi-bsw-kefka:       PASS -> FAIL [fdo#108800]

  
#### Possible fixes ####

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
    - fi-byt-clapper:     FAIL [fdo#103191] / [fdo#107362] -> PASS

  
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#108735]: https://bugs.freedesktop.org/show_bug.cgi?id=108735
  [fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800


Participating hosts (49 -> 42)
------------------------------

  Missing    (7): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-snb-2520m fi-kbl-7500u fi-ivb-3770 fi-bdw-samus 


Build changes
-------------

    * Linux: CI_DRM_5380 -> Patchwork_11260

  CI_DRM_5380: f7836843c875734c42d61d755d822635390ab097 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4757: 738f43a54d626f08e250c926a5aeec53458fbd3c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_11260: 743f34f1ebba33b7e34b8fca0f3ae8a507fba901 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

743f34f1ebba drm/i915/query: Split out query item checks

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11260/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] drm/i915/query: Split out query item checks
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
  2019-01-09  8:23 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2019-01-09  8:52 ` ✗ Fi.CI.BAT: failure " Patchwork
@ 2019-01-09  9:25 ` Tvrtko Ursulin
  2019-01-09  9:35   ` Chris Wilson
  2019-01-16  8:59 ` [PATCH v2] " Abdiel Janulgue
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Tvrtko Ursulin @ 2019-01-09  9:25 UTC (permalink / raw)
  To: Abdiel Janulgue, intel-gfx


On 09/01/2019 07:51, Abdiel Janulgue wrote:
> This simplifies adding new query item objects.
> 
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_query.c | 40 ++++++++++++++++++++-----------
>   1 file changed, 26 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
> index cbcb957b7141..b4f26605f617 100644
> --- a/drivers/gpu/drm/i915/i915_query.c
> +++ b/drivers/gpu/drm/i915/i915_query.c
> @@ -10,12 +10,33 @@
>   #include "i915_query.h"
>   #include <uapi/drm/i915_drm.h>
>   
> +static int init_query_item_check(void* data_ptr, size_t data_sz,

void *ptr

data_ prefix is not ideal since this is not the trailing data but the 
query header. Maybe query_ ?

> +				 u32 total_length,
> +				 struct drm_i915_query_item *query_item)
> +{
> +	if (query_item->length == 0)
> +		return total_length;
> +
> +	if (query_item->length < total_length)
> +		return -EINVAL;
> +
> +	if (copy_from_user(data_ptr, u64_to_user_ptr(query_item->data_ptr),
> +			   data_sz))
> +		return -EFAULT;

Is lost type information a concern with copy_from_user.. let me check.. 
I am not sure TBH.. there seems to be type based object size check in 
there but does it work when indirected via void*?

> +
> +	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
> +		       total_length))
> +		return -EFAULT;

Kind of OK, but prevents the code for checking the whole user supplied 
buffer in queries which carry the length field. (Engine discovery is one 
of them.) Argument there was why check more than we will write - to 
catch userspace accidentally passing in a smaller buffer than it thinks 
it is passing in. But it is probably not an important enough concern to 
prevent code consolidation.

So I think for me that leaves the question of type safety on the first 
check.

> +
> +	return 0;
> +}
> +
>   static int query_topology_info(struct drm_i915_private *dev_priv,
>   			       struct drm_i915_query_item *query_item)
>   {
>   	const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
>   	struct drm_i915_query_topology_info topo;
> -	u32 slice_length, subslice_length, eu_length, total_length;
> +	u32 ret, slice_length, subslice_length, eu_length, total_length;

int ret;

>   
>   	if (query_item->flags != 0)
>   		return -EINVAL;
> @@ -33,23 +54,14 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
>   
>   	total_length = sizeof(topo) + slice_length + subslice_length + eu_length;
>   
> -	if (query_item->length == 0)
> -		return total_length;
> -
> -	if (query_item->length < total_length)
> -		return -EINVAL;
> -
> -	if (copy_from_user(&topo, u64_to_user_ptr(query_item->data_ptr),
> -			   sizeof(topo)))
> -		return -EFAULT;
> +	ret = init_query_item_check(&topo, sizeof(topo), total_length,
> +				    query_item);
> +	if (ret != 0)
> +		return ret;
>   
>   	if (topo.flags != 0)
>   		return -EINVAL;
>   
> -	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
> -		       total_length))
> -		return -EFAULT;
> -
>   	memset(&topo, 0, sizeof(topo));
>   	topo.max_slices = sseu->max_slices;
>   	topo.max_subslices = sseu->max_subslices;
> 

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] drm/i915/query: Split out query item checks
  2019-01-09  9:25 ` [PATCH] " Tvrtko Ursulin
@ 2019-01-09  9:35   ` Chris Wilson
  0 siblings, 0 replies; 14+ messages in thread
From: Chris Wilson @ 2019-01-09  9:35 UTC (permalink / raw)
  To: Abdiel Janulgue, Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2019-01-09 09:25:49)
> 
> On 09/01/2019 07:51, Abdiel Janulgue wrote:
> > This simplifies adding new query item objects.
> > 
> > Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_query.c | 40 ++++++++++++++++++++-----------
> >   1 file changed, 26 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
> > index cbcb957b7141..b4f26605f617 100644
> > --- a/drivers/gpu/drm/i915/i915_query.c
> > +++ b/drivers/gpu/drm/i915/i915_query.c
> > @@ -10,12 +10,33 @@
> >   #include "i915_query.h"
> >   #include <uapi/drm/i915_drm.h>
> >   
> > +static int init_query_item_check(void* data_ptr, size_t data_sz,
> 
> void *ptr
> 
> data_ prefix is not ideal since this is not the trailing data but the 
> query header. Maybe query_ ?

Maybe query_hdr, query_pkt?
Or hdr, pkt?

> > +                              u32 total_length,
> > +                              struct drm_i915_query_item *query_item)
> > +{
> > +     if (query_item->length == 0)
> > +             return total_length;
> > +
> > +     if (query_item->length < total_length)
> > +             return -EINVAL;
> > +
> > +     if (copy_from_user(data_ptr, u64_to_user_ptr(query_item->data_ptr),
> > +                        data_sz))
> > +             return -EFAULT;
> 
> Is lost type information a concern with copy_from_user.. let me check.. 
> I am not sure TBH.. there seems to be type based object size check in 
> there but does it work when indirected via void*?

iirc void* is fine, just loss of fancy static checking.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2] drm/i915/query: Split out query item checks
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
                   ` (2 preceding siblings ...)
  2019-01-09  9:25 ` [PATCH] " Tvrtko Ursulin
@ 2019-01-16  8:59 ` Abdiel Janulgue
  2019-01-16  9:23   ` Tvrtko Ursulin
  2019-02-11 17:32   ` [PATCH v3] " Abdiel Janulgue
  2019-01-16 10:31 ` ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev2) Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 14+ messages in thread
From: Abdiel Janulgue @ 2019-01-16  8:59 UTC (permalink / raw)
  To: intel-gfx

This simplifies adding new query item objects.

v2: Use query_hdr (Tvrtko, Chris).
    int instead of u32 in return (Tvrtko)

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_query.c | 39 ++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
index cbcb957b7141..b2449cffda51 100644
--- a/drivers/gpu/drm/i915/i915_query.c
+++ b/drivers/gpu/drm/i915/i915_query.c
@@ -10,12 +10,34 @@
 #include "i915_query.h"
 #include <uapi/drm/i915_drm.h>
 
+static int init_query_item_check(void *query_hdr, size_t data_sz,
+				 u32 total_length,
+				 struct drm_i915_query_item *query_item)
+{
+	if (query_item->length == 0)
+		return total_length;
+
+	if (query_item->length < total_length)
+		return -EINVAL;
+
+	if (copy_from_user(query_hdr, u64_to_user_ptr(query_item->data_ptr),
+			   data_sz))
+		return -EFAULT;
+
+	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
+		       total_length))
+		return -EFAULT;
+
+	return 0;
+}
+
 static int query_topology_info(struct drm_i915_private *dev_priv,
 			       struct drm_i915_query_item *query_item)
 {
 	const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
 	struct drm_i915_query_topology_info topo;
 	u32 slice_length, subslice_length, eu_length, total_length;
+	int ret;
 
 	if (query_item->flags != 0)
 		return -EINVAL;
@@ -33,23 +55,14 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
 
 	total_length = sizeof(topo) + slice_length + subslice_length + eu_length;
 
-	if (query_item->length == 0)
-		return total_length;
-
-	if (query_item->length < total_length)
-		return -EINVAL;
-
-	if (copy_from_user(&topo, u64_to_user_ptr(query_item->data_ptr),
-			   sizeof(topo)))
-		return -EFAULT;
+	ret = init_query_item_check(&topo, sizeof(topo), total_length,
+				    query_item);
+	if (ret != 0)
+		return ret;
 
 	if (topo.flags != 0)
 		return -EINVAL;
 
-	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
-		       total_length))
-		return -EFAULT;
-
 	memset(&topo, 0, sizeof(topo));
 	topo.max_slices = sseu->max_slices;
 	topo.max_subslices = sseu->max_subslices;
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2] drm/i915/query: Split out query item checks
  2019-01-16  8:59 ` [PATCH v2] " Abdiel Janulgue
@ 2019-01-16  9:23   ` Tvrtko Ursulin
  2019-02-11 17:32   ` [PATCH v3] " Abdiel Janulgue
  1 sibling, 0 replies; 14+ messages in thread
From: Tvrtko Ursulin @ 2019-01-16  9:23 UTC (permalink / raw)
  To: Abdiel Janulgue, intel-gfx


On 16/01/2019 08:59, Abdiel Janulgue wrote:
> This simplifies adding new query item objects.
> 
> v2: Use query_hdr (Tvrtko, Chris).
>      int instead of u32 in return (Tvrtko)
> 
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_query.c | 39 ++++++++++++++++++++-----------
>   1 file changed, 26 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
> index cbcb957b7141..b2449cffda51 100644
> --- a/drivers/gpu/drm/i915/i915_query.c
> +++ b/drivers/gpu/drm/i915/i915_query.c
> @@ -10,12 +10,34 @@
>   #include "i915_query.h"
>   #include <uapi/drm/i915_drm.h>
>   
> +static int init_query_item_check(void *query_hdr, size_t data_sz,

AFAIR I think we talked about renaming both header related fields, so 
query_hdr and query_sz, no?

The rest looks good to me.

Although now I am also thinking about how descriptive 
"init_query_item_check" is.. so am tempted to suggest some more obvious 
name for it, maybe even shorter. :) copy_query_item?

Regards,

Tvrtko

> +				 u32 total_length,
> +				 struct drm_i915_query_item *query_item)
> +{
> +	if (query_item->length == 0)
> +		return total_length;
> +
> +	if (query_item->length < total_length)
> +		return -EINVAL;
> +
> +	if (copy_from_user(query_hdr, u64_to_user_ptr(query_item->data_ptr),
> +			   data_sz))
> +		return -EFAULT;
> +
> +	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
> +		       total_length))
> +		return -EFAULT;
> +
> +	return 0;
> +}
> +
>   static int query_topology_info(struct drm_i915_private *dev_priv,
>   			       struct drm_i915_query_item *query_item)
>   {
>   	const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
>   	struct drm_i915_query_topology_info topo;
>   	u32 slice_length, subslice_length, eu_length, total_length;
> +	int ret;
>   
>   	if (query_item->flags != 0)
>   		return -EINVAL;
> @@ -33,23 +55,14 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
>   
>   	total_length = sizeof(topo) + slice_length + subslice_length + eu_length;
>   
> -	if (query_item->length == 0)
> -		return total_length;
> -
> -	if (query_item->length < total_length)
> -		return -EINVAL;
> -
> -	if (copy_from_user(&topo, u64_to_user_ptr(query_item->data_ptr),
> -			   sizeof(topo)))
> -		return -EFAULT;
> +	ret = init_query_item_check(&topo, sizeof(topo), total_length,
> +				    query_item);
> +	if (ret != 0)
> +		return ret;
>   
>   	if (topo.flags != 0)
>   		return -EINVAL;
>   
> -	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
> -		       total_length))
> -		return -EFAULT;
> -
>   	memset(&topo, 0, sizeof(topo));
>   	topo.max_slices = sseu->max_slices;
>   	topo.max_subslices = sseu->max_subslices;
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev2)
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
                   ` (3 preceding siblings ...)
  2019-01-16  8:59 ` [PATCH v2] " Abdiel Janulgue
@ 2019-01-16 10:31 ` Patchwork
  2019-01-16 12:37 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2019-01-16 10:31 UTC (permalink / raw)
  To: Abdiel Janulgue; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/query: Split out query item checks (rev2)
URL   : https://patchwork.freedesktop.org/series/54917/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5432 -> Patchwork_11304
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/54917/revisions/2/mbox/

Known issues
------------

  Here are the changes found in Patchwork_11304 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  * igt@kms_pipe_crc_basic@read-crc-pipe-a:
    - fi-byt-clapper:     PASS -> FAIL [fdo#107362]

  
#### Possible fixes ####

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     FAIL [fdo#103167] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108915]: https://bugs.freedesktop.org/show_bug.cgi?id=108915
  [fdo#109241]: https://bugs.freedesktop.org/show_bug.cgi?id=109241
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271


Participating hosts (46 -> 43)
------------------------------

  Additional (2): fi-icl-y fi-hsw-4770r 
  Missing    (5): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-pnv-d510 


Build changes
-------------

    * Linux: CI_DRM_5432 -> Patchwork_11304

  CI_DRM_5432: e46e3295ab2a45098fd98ed1201d63578f53191b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4773: 951e2b1a016b750544d0f42459b13b9c70631c68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_11304: 5041ac73784814885f4b3c73b9a9a71f2cdbda23 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

5041ac737848 drm/i915/query: Split out query item checks

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11304/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/query: Split out query item checks (rev2)
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
                   ` (4 preceding siblings ...)
  2019-01-16 10:31 ` ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev2) Patchwork
@ 2019-01-16 12:37 ` Patchwork
  2019-02-11 18:52 ` ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev3) Patchwork
  2019-02-11 22:54 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2019-01-16 12:37 UTC (permalink / raw)
  To: Abdiel Janulgue; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/query: Split out query item checks (rev2)
URL   : https://patchwork.freedesktop.org/series/54917/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5432_full -> Patchwork_11304_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_11304_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@runner@aborted}:
    - shard-glk:          FAIL -> ( 2 FAIL )

  
Known issues
------------

  Here are the changes found in Patchwork_11304_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_softpin@noreloc-s3:
    - shard-snb:          PASS -> INCOMPLETE [fdo#105411]

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_ccs@pipe-a-crc-primary-rotation-180:
    - shard-skl:          PASS -> FAIL [fdo#107725]

  * igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
    - shard-glk:          PASS -> FAIL [fdo#108145] +2

  * igt@kms_chv_cursor_fail@pipe-b-64x64-left-edge:
    - shard-skl:          NOTRUN -> FAIL [fdo#104671] +1

  * igt@kms_cursor_crc@cursor-128x128-dpms:
    - shard-apl:          PASS -> FAIL [fdo#103232]

  * igt@kms_cursor_crc@cursor-128x42-sliding:
    - shard-skl:          NOTRUN -> FAIL [fdo#103232] +1

  * igt@kms_cursor_crc@cursor-256x256-suspend:
    - shard-apl:          PASS -> FAIL [fdo#103191] / [fdo#103232]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-skl:          NOTRUN -> FAIL [fdo#103167] +1

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-mmap-gtt:
    - shard-glk:          PASS -> FAIL [fdo#103167] +1

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-mmap-gtt:
    - shard-iclb:         NOTRUN -> FAIL [fdo#109247] / [fdo#109355]

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-rte:
    - shard-iclb:         PASS -> FAIL [fdo#105682] / [fdo#109247] / [fdo#109355]

  * igt@kms_frontbuffer_tracking@fbcpsr-badstride:
    - shard-iclb:         PASS -> DMESG-FAIL [fdo#107724]

  * igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
    - shard-iclb:         PASS -> FAIL [fdo#105683] / [fdo#108040]

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu:
    - shard-iclb:         PASS -> FAIL [fdo#109247] / [fdo#109355] +7

  * igt@kms_panel_fitting@legacy:
    - shard-skl:          NOTRUN -> FAIL [fdo#105456]

  * igt@kms_plane@pixel-format-pipe-b-planes:
    - shard-skl:          NOTRUN -> DMESG-WARN [fdo#106885] +2

  * igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
    - shard-skl:          NOTRUN -> FAIL [fdo#107815] / [fdo#108145] +1

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-skl:          NOTRUN -> FAIL [fdo#108145] +1

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
    - shard-iclb:         PASS -> DMESG-WARN [fdo#107724] / [fdo#108336]

  * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
    - shard-skl:          NOTRUN -> FAIL [fdo#107815]

  * igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
    - shard-iclb:         PASS -> DMESG-WARN [fdo#107724] +1

  * igt@kms_psr@primary_mmap_cpu:
    - shard-iclb:         PASS -> FAIL [fdo#107383] +1

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#105604]

  * igt@kms_setmode@basic:
    - shard-skl:          NOTRUN -> FAIL [fdo#99912]
    - shard-hsw:          PASS -> FAIL [fdo#99912]

  * igt@kms_universal_plane@universal-plane-pipe-c-functional:
    - shard-iclb:         PASS -> DMESG-FAIL [fdo#103166] / [fdo#107724]

  * igt@pm_backlight@fade_with_suspend:
    - shard-skl:          NOTRUN -> FAIL [fdo#107847]

  * igt@pm_rpm@dpms-lpsp:
    - shard-iclb:         PASS -> INCOMPLETE [fdo#108840]

  * igt@pm_rpm@legacy-planes:
    - shard-iclb:         PASS -> DMESG-WARN [fdo#108654]

  
#### Possible fixes ####

  * igt@gem_softpin@noreloc-s3:
    - shard-skl:          INCOMPLETE [fdo#104108] / [fdo#107773] -> PASS

  * igt@kms_atomic@test_only:
    - shard-iclb:         DMESG-WARN [fdo#107724] -> PASS +19

  * igt@kms_atomic_transition@plane-all-transition:
    - shard-iclb:         DMESG-WARN [fdo#107724] / [fdo#109225] -> PASS

  * igt@kms_color@pipe-b-legacy-gamma:
    - shard-apl:          FAIL [fdo#104782] -> PASS

  * igt@kms_cursor_crc@cursor-256x85-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS +1

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
    - shard-iclb:         DMESG-FAIL [fdo#107724] -> PASS +4

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - shard-iclb:         FAIL [fdo#103167] -> PASS +2

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
    - shard-apl:          FAIL [fdo#103167] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
    - shard-glk:          FAIL [fdo#103167] -> PASS +3

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
    - shard-iclb:         INCOMPLETE [fdo#107713] -> PASS

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
    - shard-glk:          INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS

  * igt@kms_plane@plane-position-hole-pipe-b-planes:
    - shard-iclb:         DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +6

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
    - shard-apl:          FAIL [fdo#103166] -> PASS +2

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
    - shard-iclb:         FAIL [fdo#103166] -> PASS

  * igt@kms_universal_plane@universal-plane-pipe-b-functional:
    - shard-glk:          FAIL [fdo#103166] -> PASS

  
#### Warnings ####

  * igt@i915_suspend@shrink:
    - shard-skl:          DMESG-WARN [fdo#107886] / [fdo#109244] -> INCOMPLETE [fdo#106886]

  * igt@kms_cursor_crc@cursor-256x85-random:
    - shard-iclb:         DMESG-WARN [fdo#107724] / [fdo#108336] -> FAIL [fdo#103232]

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-fullscreen:
    - shard-iclb:         DMESG-WARN [fdo#107724] / [fdo#108336] -> FAIL [fdo#109247] / [fdo#109355]

  * igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
    - shard-iclb:         DMESG-WARN [fdo#106885] / [fdo#107724] / [fdo#108336] -> DMESG-FAIL [fdo#106885]

  * igt@kms_psr@cursor_blt:
    - shard-iclb:         DMESG-WARN [fdo#107724] -> FAIL [fdo#107383]

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#104671]: https://bugs.freedesktop.org/show_bug.cgi?id=104671
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105456]: https://bugs.freedesktop.org/show_bug.cgi?id=105456
  [fdo#105604]: https://bugs.freedesktop.org/show_bug.cgi?id=105604
  [fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
  [fdo#105683]: https://bugs.freedesktop.org/show_bug.cgi?id=105683
  [fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
  [fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
  [fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
  [fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
  [fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
  [fdo#107847]: https://bugs.freedesktop.org/show_bug.cgi?id=107847
  [fdo#107886]: https://bugs.freedesktop.org/show_bug.cgi?id=107886
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
  [fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
  [fdo#108756]: https://bugs.freedesktop.org/show_bug.cgi?id=108756
  [fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
  [fdo#109225]: https://bugs.freedesktop.org/show_bug.cgi?id=109225
  [fdo#109244]: https://bugs.freedesktop.org/show_bug.cgi?id=109244
  [fdo#109247]: https://bugs.freedesktop.org/show_bug.cgi?id=109247
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109277]: https://bugs.freedesktop.org/show_bug.cgi?id=109277
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109281]: https://bugs.freedesktop.org/show_bug.cgi?id=109281
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109287]: https://bugs.freedesktop.org/show_bug.cgi?id=109287
  [fdo#109290]: https://bugs.freedesktop.org/show_bug.cgi?id=109290
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109355]: https://bugs.freedesktop.org/show_bug.cgi?id=109355
  [fdo#109358]: https://bugs.freedesktop.org/show_bug.cgi?id=109358
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (7 -> 7)
------------------------------

  No changes in participating hosts


Build changes
-------------

    * Linux: CI_DRM_5432 -> Patchwork_11304

  CI_DRM_5432: e46e3295ab2a45098fd98ed1201d63578f53191b @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4773: 951e2b1a016b750544d0f42459b13b9c70631c68 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_11304: 5041ac73784814885f4b3c73b9a9a71f2cdbda23 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11304/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3] drm/i915/query: Split out query item checks
  2019-01-16  8:59 ` [PATCH v2] " Abdiel Janulgue
  2019-01-16  9:23   ` Tvrtko Ursulin
@ 2019-02-11 17:32   ` Abdiel Janulgue
  2019-02-11 17:49     ` Tvrtko Ursulin
  1 sibling, 1 reply; 14+ messages in thread
From: Abdiel Janulgue @ 2019-02-11 17:32 UTC (permalink / raw)
  To: intel-gfx

This simplifies adding new query item objects.

v2: Use query_hdr (Tvrtko, Chris).
    int instead of u32 in return (Tvrtko)
v3: More naming fixes (Tvrtko)

Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_query.c | 39 ++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
index cbcb957b7141..782183b78f49 100644
--- a/drivers/gpu/drm/i915/i915_query.c
+++ b/drivers/gpu/drm/i915/i915_query.c
@@ -10,12 +10,34 @@
 #include "i915_query.h"
 #include <uapi/drm/i915_drm.h>
 
+static int copy_query_item(void *query_hdr, size_t query_sz,
+			   u32 total_length,
+			   struct drm_i915_query_item *query_item)
+{
+	if (query_item->length == 0)
+		return total_length;
+
+	if (query_item->length < total_length)
+		return -EINVAL;
+
+	if (copy_from_user(query_hdr, u64_to_user_ptr(query_item->data_ptr),
+			   query_sz))
+		return -EFAULT;
+
+	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
+		       total_length))
+		return -EFAULT;
+
+	return 0;
+}
+
 static int query_topology_info(struct drm_i915_private *dev_priv,
 			       struct drm_i915_query_item *query_item)
 {
 	const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
 	struct drm_i915_query_topology_info topo;
 	u32 slice_length, subslice_length, eu_length, total_length;
+	int ret;
 
 	if (query_item->flags != 0)
 		return -EINVAL;
@@ -33,23 +55,14 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
 
 	total_length = sizeof(topo) + slice_length + subslice_length + eu_length;
 
-	if (query_item->length == 0)
-		return total_length;
-
-	if (query_item->length < total_length)
-		return -EINVAL;
-
-	if (copy_from_user(&topo, u64_to_user_ptr(query_item->data_ptr),
-			   sizeof(topo)))
-		return -EFAULT;
+	ret = copy_query_item(&topo, sizeof(topo), total_length,
+			      query_item);
+	if (ret != 0)
+		return ret;
 
 	if (topo.flags != 0)
 		return -EINVAL;
 
-	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
-		       total_length))
-		return -EFAULT;
-
 	memset(&topo, 0, sizeof(topo));
 	topo.max_slices = sseu->max_slices;
 	topo.max_subslices = sseu->max_subslices;
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3] drm/i915/query: Split out query item checks
  2019-02-11 17:32   ` [PATCH v3] " Abdiel Janulgue
@ 2019-02-11 17:49     ` Tvrtko Ursulin
  2019-02-26 10:34       ` Chris Wilson
  0 siblings, 1 reply; 14+ messages in thread
From: Tvrtko Ursulin @ 2019-02-11 17:49 UTC (permalink / raw)
  To: Abdiel Janulgue, intel-gfx


On 11/02/2019 17:32, Abdiel Janulgue wrote:
> This simplifies adding new query item objects.
> 
> v2: Use query_hdr (Tvrtko, Chris).
>      int instead of u32 in return (Tvrtko)
> v3: More naming fixes (Tvrtko)
> 
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_query.c | 39 ++++++++++++++++++++-----------
>   1 file changed, 26 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
> index cbcb957b7141..782183b78f49 100644
> --- a/drivers/gpu/drm/i915/i915_query.c
> +++ b/drivers/gpu/drm/i915/i915_query.c
> @@ -10,12 +10,34 @@
>   #include "i915_query.h"
>   #include <uapi/drm/i915_drm.h>
>   
> +static int copy_query_item(void *query_hdr, size_t query_sz,
> +			   u32 total_length,
> +			   struct drm_i915_query_item *query_item)
> +{
> +	if (query_item->length == 0)
> +		return total_length;
> +
> +	if (query_item->length < total_length)
> +		return -EINVAL;
> +
> +	if (copy_from_user(query_hdr, u64_to_user_ptr(query_item->data_ptr),
> +			   query_sz))
> +		return -EFAULT;
> +
> +	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
> +		       total_length))
> +		return -EFAULT;
> +
> +	return 0;
> +}
> +
>   static int query_topology_info(struct drm_i915_private *dev_priv,
>   			       struct drm_i915_query_item *query_item)
>   {
>   	const struct sseu_dev_info *sseu = &RUNTIME_INFO(dev_priv)->sseu;
>   	struct drm_i915_query_topology_info topo;
>   	u32 slice_length, subslice_length, eu_length, total_length;
> +	int ret;
>   
>   	if (query_item->flags != 0)
>   		return -EINVAL;
> @@ -33,23 +55,14 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
>   
>   	total_length = sizeof(topo) + slice_length + subslice_length + eu_length;
>   
> -	if (query_item->length == 0)
> -		return total_length;
> -
> -	if (query_item->length < total_length)
> -		return -EINVAL;
> -
> -	if (copy_from_user(&topo, u64_to_user_ptr(query_item->data_ptr),
> -			   sizeof(topo)))
> -		return -EFAULT;
> +	ret = copy_query_item(&topo, sizeof(topo), total_length,
> +			      query_item);
> +	if (ret != 0)
> +		return ret;
>   
>   	if (topo.flags != 0)
>   		return -EINVAL;
>   
> -	if (!access_ok(u64_to_user_ptr(query_item->data_ptr),
> -		       total_length))
> -		return -EFAULT;
> -
>   	memset(&topo, 0, sizeof(topo));
>   	topo.max_slices = sseu->max_slices;
>   	topo.max_subslices = sseu->max_subslices;
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev3)
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
                   ` (5 preceding siblings ...)
  2019-01-16 12:37 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-02-11 18:52 ` Patchwork
  2019-02-11 22:54 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2019-02-11 18:52 UTC (permalink / raw)
  To: Abdiel Janulgue; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/query: Split out query item checks (rev3)
URL   : https://patchwork.freedesktop.org/series/54917/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5589 -> Patchwork_12197
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/54917/revisions/3/mbox/

Known issues
------------

  Here are the changes found in Patchwork_12197 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_busy@basic-flip-b:
    - fi-gdg-551:         PASS -> FAIL [fdo#103182]

  * igt@kms_flip@basic-flip-vs-dpms:
    - fi-skl-6700hq:      PASS -> DMESG-WARN [fdo#105998]

  * igt@prime_vgem@basic-fence-flip:
    - fi-gdg-551:         PASS -> DMESG-FAIL [fdo#103182]

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
  [fdo#105998]: https://bugs.freedesktop.org/show_bug.cgi?id=105998
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109226]: https://bugs.freedesktop.org/show_bug.cgi?id=109226
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278


Participating hosts (47 -> 41)
------------------------------

  Additional (2): fi-byt-j1900 fi-pnv-d510 
  Missing    (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-glk-j4005 fi-bdw-samus 


Build changes
-------------

    * Linux: CI_DRM_5589 -> Patchwork_12197

  CI_DRM_5589: 7a1e565f0c6d003c5990380c6e3da8719ac33eec @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4816: f62577c85c9ef0539d468d6fad105b706a15139c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12197: 5b66ad7580875a872e689cbe0326c3bb47727133 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

5b66ad758087 drm/i915/query: Split out query item checks

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12197/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/query: Split out query item checks (rev3)
  2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
                   ` (6 preceding siblings ...)
  2019-02-11 18:52 ` ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev3) Patchwork
@ 2019-02-11 22:54 ` Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2019-02-11 22:54 UTC (permalink / raw)
  To: Abdiel Janulgue; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/query: Split out query item checks (rev3)
URL   : https://patchwork.freedesktop.org/series/54917/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5589_full -> Patchwork_12197_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_12197_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-apl:          NOTRUN -> DMESG-WARN [fdo#107956]

  * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
    - shard-glk:          PASS -> DMESG-WARN [fdo#107956]

  * igt@kms_content_protection@atomic:
    - shard-apl:          NOTRUN -> FAIL [fdo#108597]

  * igt@kms_cursor_crc@cursor-128x42-random:
    - shard-glk:          NOTRUN -> FAIL [fdo#103232] +1

  * igt@kms_cursor_crc@cursor-size-change:
    - shard-apl:          PASS -> FAIL [fdo#103232]

  * igt@kms_flip@flip-vs-dpms-off-vs-modeset:
    - shard-hsw:          PASS -> DMESG-WARN [fdo#102614]

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-apl:          PASS -> FAIL [fdo#102887] / [fdo#105363]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
    - shard-apl:          PASS -> FAIL [fdo#103167] +1

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
    - shard-glk:          PASS -> FAIL [fdo#103167] +5

  * igt@kms_plane@pixel-format-pipe-c-planes:
    - shard-glk:          PASS -> FAIL [fdo#103166] +2

  * igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
    - shard-kbl:          PASS -> DMESG-FAIL [fdo#105763]

  
#### Possible fixes ####

  * igt@gem_pipe_control_store_loop@reused-buffer:
    - shard-apl:          INCOMPLETE [fdo#103927] -> PASS

  * igt@gem_tiled_swapping@non-threaded:
    - shard-apl:          DMESG-WARN [fdo#108686] -> PASS

  * igt@kms_color@pipe-a-ctm-max:
    - shard-apl:          FAIL [fdo#108147] -> PASS

  * igt@kms_cursor_crc@cursor-256x256-random:
    - shard-apl:          FAIL [fdo#103232] -> PASS

  * igt@kms_cursor_crc@cursor-64x64-suspend:
    - shard-apl:          FAIL [fdo#103191] / [fdo#103232] -> PASS

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-glk:          FAIL [fdo#105363] -> PASS

  * {igt@kms_flip@flip-vs-suspend-interruptible}:
    - shard-glk:          INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-apl:          FAIL [fdo#103167] -> PASS +2

  * igt@kms_plane_multiple@atomic-pipe-a-tiling-none:
    - shard-apl:          FAIL [fdo#103166] -> PASS +1

  * igt@kms_universal_plane@universal-plane-pipe-c-functional:
    - shard-glk:          FAIL [fdo#103166] -> PASS +2

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
  [fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#108597]: https://bugs.freedesktop.org/show_bug.cgi?id=108597
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


Build changes
-------------

    * Linux: CI_DRM_5589 -> Patchwork_12197

  CI_DRM_5589: 7a1e565f0c6d003c5990380c6e3da8719ac33eec @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4816: f62577c85c9ef0539d468d6fad105b706a15139c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_12197: 5b66ad7580875a872e689cbe0326c3bb47727133 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12197/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3] drm/i915/query: Split out query item checks
  2019-02-11 17:49     ` Tvrtko Ursulin
@ 2019-02-26 10:34       ` Chris Wilson
  0 siblings, 0 replies; 14+ messages in thread
From: Chris Wilson @ 2019-02-26 10:34 UTC (permalink / raw)
  To: Abdiel Janulgue, Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2019-02-11 17:49:11)
> 
> On 11/02/2019 17:32, Abdiel Janulgue wrote:
> > This simplifies adding new query item objects.
> > 
> > v2: Use query_hdr (Tvrtko, Chris).
> >      int instead of u32 in return (Tvrtko)
> > v3: More naming fixes (Tvrtko)
> > 
> > Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
[snip]
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And pushed. Thanks for the patch and review,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-02-26 10:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09  7:51 [PATCH] drm/i915/query: Split out query item checks Abdiel Janulgue
2019-01-09  8:23 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-01-09  8:52 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-01-09  9:25 ` [PATCH] " Tvrtko Ursulin
2019-01-09  9:35   ` Chris Wilson
2019-01-16  8:59 ` [PATCH v2] " Abdiel Janulgue
2019-01-16  9:23   ` Tvrtko Ursulin
2019-02-11 17:32   ` [PATCH v3] " Abdiel Janulgue
2019-02-11 17:49     ` Tvrtko Ursulin
2019-02-26 10:34       ` Chris Wilson
2019-01-16 10:31 ` ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev2) Patchwork
2019-01-16 12:37 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-11 18:52 ` ✓ Fi.CI.BAT: success for drm/i915/query: Split out query item checks (rev3) Patchwork
2019-02-11 22:54 ` ✓ Fi.CI.IGT: " Patchwork

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.