All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available
@ 2018-03-22 16:18 Piotr Piórkowski
  2018-03-22 16:25 ` Michal Wajdeczko
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Piotr Piórkowski @ 2018-03-22 16:18 UTC (permalink / raw)
  To: intel-gfx

If GuC firmware is not available on the system and we load i915 with enable
GuC, then we hit this null pointer dereference issue:

[   71.098873] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
[   71.098947] PGD 0 P4D 0
[   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
[   71.098965] Modules linked in: i915(O+) netconsole x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last unloaded: i915]
[   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O     4.16.0-rc1+ #337
[   71.099018] Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
[   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
[   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
[   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX: ffffffffa03e9357
[   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI: ffff88084cad12f8
[   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09: 0000000000000001
[   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88084cad0000
[   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15: ffff88084cad12b0
[   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000) knlGS:0000000000000000
[   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4: 00000000003606e0
[   71.099182] Call Trace:
[   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
[   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
[   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
[   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
[   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
[   71.099476]  pci_device_probe+0xa1/0x130
[   71.099488]  driver_probe_device+0x302/0x470
[   71.099502]  __driver_attach+0xb9/0xe0
[   71.099513]  ? driver_probe_device+0x470/0x470
[   71.099525]  ? driver_probe_device+0x470/0x470
[   71.099538]  bus_for_each_dev+0x64/0x90
[   71.099550]  bus_add_driver+0x164/0x260
[   71.099561]  ? 0xffffffffa04d6000
[   71.099572]  driver_register+0x57/0xc0
[   71.099582]  ? 0xffffffffa04d6000
[   71.099593]  do_one_initcall+0x3b/0x160
[   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
[   71.099621]  do_init_module+0x5b/0x1f9
[   71.099635]  load_module+0x2467/0x2a70
[   71.099654]  ? SyS_finit_module+0xbd/0xe0
[   71.099668]  SyS_finit_module+0xbd/0xe0
[   71.099682]  do_syscall_64+0x73/0x1c0
[   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
[   71.099706] RIP: 0033:0x7f7f23fb40d9
[   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX: 00007f7f23fb40d9
[   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI: 0000000000000003
[   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09: 00007ffda7d68088
[   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15: 000055f96e2a8260
[   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
[   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP: ffffc90000417aa0
[   71.100020] CR2: 0000000000000008
[   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--

Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and size calculation")

Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jackie Li <yaodong.li@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
---
 drivers/gpu/drm/i915/intel_uc_fw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c b/drivers/gpu/drm/i915/intel_uc_fw.c
index 30c73243f54d..f143c2437c99 100644
--- a/drivers/gpu/drm/i915/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/intel_uc_fw.c
@@ -199,7 +199,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
 		       int (*xfer)(struct intel_uc_fw *uc_fw,
 				   struct i915_vma *vma))
 {
-	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
+	struct intel_guc *guc = container_of(uc_fw, struct intel_guc, fw);
 	struct i915_vma *vma;
 	int err;
 
@@ -224,7 +224,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
 
 	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
 				       PIN_OFFSET_BIAS |
-				       i915->guc.ggtt_pin_bias);
+				       guc->ggtt_pin_bias);
 	if (IS_ERR(vma)) {
 		err = PTR_ERR(vma);
 		DRM_DEBUG_DRIVER("%s fw ggtt-pin err=%d\n",
-- 
2.14.3

_______________________________________________
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] drm/i915/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
@ 2018-03-22 16:25 ` Michal Wajdeczko
  2018-03-22 16:50 ` Yaodong Li
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Michal Wajdeczko @ 2018-03-22 16:25 UTC (permalink / raw)
  To: intel-gfx, Piotr Piórkowski

On Thu, 22 Mar 2018 17:18:55 +0100, Piotr Piórkowski  
<piotr.piorkowski@intel.com> wrote:

> If GuC firmware is not available on the system and we load i915 with  
> enable
> GuC, then we hit this null pointer dereference issue:
>
> [   71.098873] BUG: unable to handle kernel NULL pointer dereference at  
> 0000000000000008
> [   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.098947] PGD 0 P4D 0
> [   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
> [   71.098965] Modules linked in: i915(O+) netconsole  
> x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul  
> crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last  
> unloaded: i915]
> [   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O      
> 4.16.0-rc1+ #337
> [   71.099018] Hardware name: /NUC6i5SYB, BIOS  
> SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
> [   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
> [   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX:  
> ffffffffa03e9357
> [   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI:  
> ffff88084cad12f8
> [   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09:  
> 0000000000000001
> [   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12:  
> ffff88084cad0000
> [   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15:  
> ffff88084cad12b0
> [   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000)  
> knlGS:0000000000000000
> [   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4:  
> 00000000003606e0
> [   71.099182] Call Trace:
> [   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
> [   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
> [   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
> [   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
> [   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
> [   71.099476]  pci_device_probe+0xa1/0x130
> [   71.099488]  driver_probe_device+0x302/0x470
> [   71.099502]  __driver_attach+0xb9/0xe0
> [   71.099513]  ? driver_probe_device+0x470/0x470
> [   71.099525]  ? driver_probe_device+0x470/0x470
> [   71.099538]  bus_for_each_dev+0x64/0x90
> [   71.099550]  bus_add_driver+0x164/0x260
> [   71.099561]  ? 0xffffffffa04d6000
> [   71.099572]  driver_register+0x57/0xc0
> [   71.099582]  ? 0xffffffffa04d6000
> [   71.099593]  do_one_initcall+0x3b/0x160
> [   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
> [   71.099621]  do_init_module+0x5b/0x1f9
> [   71.099635]  load_module+0x2467/0x2a70
> [   71.099654]  ? SyS_finit_module+0xbd/0xe0
> [   71.099668]  SyS_finit_module+0xbd/0xe0
> [   71.099682]  do_syscall_64+0x73/0x1c0
> [   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
> [   71.099706] RIP: 0033:0x7f7f23fb40d9
> [   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX:  
> 0000000000000139
> [   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX:  
> 00007f7f23fb40d9
> [   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI:  
> 0000000000000003
> [   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09:  
> 00007ffda7d68088
> [   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12:  
> 0000000000000000
> [   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15:  
> 000055f96e2a8260
> [   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00  
> 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c  
> 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
> [   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP:  
> ffffc90000417aa0
> [   71.100020] CR2: 0000000000000008
> [   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--
>
> Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and  
> size calculation")
>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Jackie Li <yaodong.li@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uc_fw.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c  
> b/drivers/gpu/drm/i915/intel_uc_fw.c
> index 30c73243f54d..f143c2437c99 100644
> --- a/drivers/gpu/drm/i915/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/intel_uc_fw.c
> @@ -199,7 +199,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>  		       int (*xfer)(struct intel_uc_fw *uc_fw,
>  				   struct i915_vma *vma))
>  {
> -	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
> +	struct intel_guc *guc = container_of(uc_fw, struct intel_guc, fw);

You don't know if this uc_fw is referring to guc->fw or huc->fw

>  	struct i915_vma *vma;
>  	int err;
> @@ -224,7 +224,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
> 	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
>  				       PIN_OFFSET_BIAS |
> -				       i915->guc.ggtt_pin_bias);
> +				       guc->ggtt_pin_bias);

as we need guc only here, maybe just here:

		to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias);

>  	if (IS_ERR(vma)) {
>  		err = PTR_ERR(vma);
>  		DRM_DEBUG_DRIVER("%s fw ggtt-pin err=%d\n",
_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
  2018-03-22 16:25 ` Michal Wajdeczko
@ 2018-03-22 16:50 ` Yaodong Li
  2018-03-22 17:05 ` [PATCH v2] " Piotr Piórkowski
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Yaodong Li @ 2018-03-22 16:50 UTC (permalink / raw)
  To: Piotr Piórkowski, intel-gfx

On 03/22/2018 09:18 AM, Piotr Piórkowski wrote:
> If GuC firmware is not available on the system and we load i915 with enable
> GuC, then we hit this null pointer dereference issue:
>
> [   71.098873] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
> [   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.098947] PGD 0 P4D 0
> [   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
> [   71.098965] Modules linked in: i915(O+) netconsole x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last unloaded: i915]
> [   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O     4.16.0-rc1+ #337
> [   71.099018] Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
> [   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
> [   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX: ffffffffa03e9357
> [   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI: ffff88084cad12f8
> [   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09: 0000000000000001
> [   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88084cad0000
> [   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15: ffff88084cad12b0
> [   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000) knlGS:0000000000000000
> [   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4: 00000000003606e0
> [   71.099182] Call Trace:
> [   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
> [   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
> [   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
> [   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
> [   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
> [   71.099476]  pci_device_probe+0xa1/0x130
> [   71.099488]  driver_probe_device+0x302/0x470
> [   71.099502]  __driver_attach+0xb9/0xe0
> [   71.099513]  ? driver_probe_device+0x470/0x470
> [   71.099525]  ? driver_probe_device+0x470/0x470
> [   71.099538]  bus_for_each_dev+0x64/0x90
> [   71.099550]  bus_add_driver+0x164/0x260
> [   71.099561]  ? 0xffffffffa04d6000
> [   71.099572]  driver_register+0x57/0xc0
> [   71.099582]  ? 0xffffffffa04d6000
> [   71.099593]  do_one_initcall+0x3b/0x160
> [   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
> [   71.099621]  do_init_module+0x5b/0x1f9
> [   71.099635]  load_module+0x2467/0x2a70
> [   71.099654]  ? SyS_finit_module+0xbd/0xe0
> [   71.099668]  SyS_finit_module+0xbd/0xe0
> [   71.099682]  do_syscall_64+0x73/0x1c0
> [   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
> [   71.099706] RIP: 0033:0x7f7f23fb40d9
> [   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
> [   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX: 00007f7f23fb40d9
> [   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI: 0000000000000003
> [   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09: 00007ffda7d68088
> [   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
> [   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15: 000055f96e2a8260
> [   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
> [   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP: ffffc90000417aa0
> [   71.100020] CR2: 0000000000000008
> [   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--
>
> Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and size calculation")
Hmm:-[. it's due to 3c009e3c468 (drm/i915/guc: Rename guc_ggtt_offset to 
intel_guc_ggtt_offset)
>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Jackie Li <yaodong.li@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uc_fw.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c b/drivers/gpu/drm/i915/intel_uc_fw.c
> index 30c73243f54d..f143c2437c99 100644
> --- a/drivers/gpu/drm/i915/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/intel_uc_fw.c
> @@ -199,7 +199,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>   		       int (*xfer)(struct intel_uc_fw *uc_fw,
>   				   struct i915_vma *vma))
>   {
> -	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
> +	struct intel_guc *guc = container_of(uc_fw, struct intel_guc, fw);
we don't know whether it's guc or huc at this point.
still need use to_i915(uc_fw->obj->base.dev)
but just move it right after:
     if (uc_fw->fetch_status != INTEL_UC_FIRMWARE_SUCCESS)
         return -ENOEXEC;

     GEM_BUG_ON(uc_fw->obj);

     i915 = to_i915(uc_fw->obj->base.dev);

Thanks for fix.

Regards,
-Jackie

_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
  2018-03-22 16:25 ` Michal Wajdeczko
  2018-03-22 16:50 ` Yaodong Li
@ 2018-03-22 17:05 ` Piotr Piórkowski
  2018-03-22 17:15   ` Michal Wajdeczko
  2018-03-22 18:17   ` [PATCH v3] " Piotr Piórkowski
  2018-03-22 17:34 ` ✗ Fi.CI.BAT: failure for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev2) Patchwork
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 14+ messages in thread
From: Piotr Piórkowski @ 2018-03-22 17:05 UTC (permalink / raw)
  To: intel-gfx

If GuC firmware is not available on the system and we load i915 with enable
GuC, then we hit this null pointer dereference issue:

[   71.098873] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
[   71.098947] PGD 0 P4D 0
[   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
[   71.098965] Modules linked in: i915(O+) netconsole x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last unloaded: i915]
[   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O     4.16.0-rc1+ #337
[   71.099018] Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
[   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
[   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
[   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX: ffffffffa03e9357
[   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI: ffff88084cad12f8
[   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09: 0000000000000001
[   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88084cad0000
[   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15: ffff88084cad12b0
[   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000) knlGS:0000000000000000
[   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4: 00000000003606e0
[   71.099182] Call Trace:
[   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
[   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
[   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
[   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
[   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
[   71.099476]  pci_device_probe+0xa1/0x130
[   71.099488]  driver_probe_device+0x302/0x470
[   71.099502]  __driver_attach+0xb9/0xe0
[   71.099513]  ? driver_probe_device+0x470/0x470
[   71.099525]  ? driver_probe_device+0x470/0x470
[   71.099538]  bus_for_each_dev+0x64/0x90
[   71.099550]  bus_add_driver+0x164/0x260
[   71.099561]  ? 0xffffffffa04d6000
[   71.099572]  driver_register+0x57/0xc0
[   71.099582]  ? 0xffffffffa04d6000
[   71.099593]  do_one_initcall+0x3b/0x160
[   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
[   71.099621]  do_init_module+0x5b/0x1f9
[   71.099635]  load_module+0x2467/0x2a70
[   71.099654]  ? SyS_finit_module+0xbd/0xe0
[   71.099668]  SyS_finit_module+0xbd/0xe0
[   71.099682]  do_syscall_64+0x73/0x1c0
[   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
[   71.099706] RIP: 0033:0x7f7f23fb40d9
[   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX: 00007f7f23fb40d9
[   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI: 0000000000000003
[   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09: 00007ffda7d68088
[   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15: 000055f96e2a8260
[   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
[   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP: ffffc90000417aa0
[   71.100020] CR2: 0000000000000008
[   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--

Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and size calculation")

v2: don't assume it is always GuC FW (Michal)

Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Reported-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jackie Li <yaodong.li@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
---
 drivers/gpu/drm/i915/intel_uc_fw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c b/drivers/gpu/drm/i915/intel_uc_fw.c
index 30c73243f54d..c0663857cd43 100644
--- a/drivers/gpu/drm/i915/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/intel_uc_fw.c
@@ -199,7 +199,6 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
 		       int (*xfer)(struct intel_uc_fw *uc_fw,
 				   struct i915_vma *vma))
 {
-	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
 	struct i915_vma *vma;
 	int err;
 
@@ -224,7 +223,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
 
 	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
 				       PIN_OFFSET_BIAS |
-				       i915->guc.ggtt_pin_bias);
+				       to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias);
 	if (IS_ERR(vma)) {
 		err = PTR_ERR(vma);
 		DRM_DEBUG_DRIVER("%s fw ggtt-pin err=%d\n",
-- 
2.14.3

_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 17:05 ` [PATCH v2] " Piotr Piórkowski
@ 2018-03-22 17:15   ` Michal Wajdeczko
  2018-03-22 18:17   ` [PATCH v3] " Piotr Piórkowski
  1 sibling, 0 replies; 14+ messages in thread
From: Michal Wajdeczko @ 2018-03-22 17:15 UTC (permalink / raw)
  To: intel-gfx, Piotr Piórkowski

On Thu, 22 Mar 2018 18:05:51 +0100, Piotr Piórkowski  
<piotr.piorkowski@intel.com> wrote:

> If GuC firmware is not available on the system and we load i915 with  
> enable
> GuC, then we hit this null pointer dereference issue:
>

/snip/

> diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c  
> b/drivers/gpu/drm/i915/intel_uc_fw.c
> index 30c73243f54d..c0663857cd43 100644
> --- a/drivers/gpu/drm/i915/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/intel_uc_fw.c
> @@ -199,7 +199,6 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>  		       int (*xfer)(struct intel_uc_fw *uc_fw,
>  				   struct i915_vma *vma))
>  {
> -	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
>  	struct i915_vma *vma;
>  	int err;
> @@ -224,7 +223,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
> 	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
>  				       PIN_OFFSET_BIAS |
> -				       i915->guc.ggtt_pin_bias);
> +				       to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias);

hmm, sorry, but it looks too ugly and also is over 80

so let's just initialize i915 after checking fetch_status as was suggested
by Jackie (but maybe without GEM_BUG_ON)

/m

_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available (rev2)
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
                   ` (2 preceding siblings ...)
  2018-03-22 17:05 ` [PATCH v2] " Piotr Piórkowski
@ 2018-03-22 17:34 ` Patchwork
  2018-03-22 18:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3) Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-03-22 17:34 UTC (permalink / raw)
  To: Piotr Piórkowski; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev2)
URL   : https://patchwork.freedesktop.org/series/40490/
State : failure

== Summary ==

Series 40490v2 drm/i915/guc: Fix null pointer dereference when GuC FW is not available
https://patchwork.freedesktop.org/api/1.0/series/40490/revisions/2/mbox/

---- Possible new issues:

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> FAIL       (fi-kbl-7567u)

---- Known issues:

Test debugfs_test:
        Subgroup read_all_entries:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                incomplete -> PASS       (fi-cnl-y3) fdo#103191

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:431s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:444s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:384s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:541s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:296s
fi-bxt-dsi       total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:512s
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:512s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:517s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:501s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:413s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:510s
fi-cnl-drrs      total:285  pass:254  dwarn:3   dfail:0   fail:0   skip:28  time:528s
fi-cnl-y3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:581s
fi-elk-e7500     total:285  pass:225  dwarn:1   dfail:0   fail:0   skip:59  time:424s
fi-gdg-551       total:285  pass:176  dwarn:0   dfail:0   fail:1   skip:108 time:321s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:535s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:403s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:416s
fi-ivb-3520m     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:477s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:430s
fi-kbl-7500u     total:285  pass:260  dwarn:1   dfail:0   fail:0   skip:24  time:473s
fi-kbl-7567u     total:285  pass:264  dwarn:0   dfail:0   fail:1   skip:20  time:463s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:514s
fi-pnv-d510      total:285  pass:219  dwarn:1   dfail:0   fail:0   skip:65  time:655s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:437s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:540s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:506s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:486s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:428s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:444s
fi-snb-2520m     total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:556s
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:398s
fi-cfl-s3 failed to connect after reboot

40fcdd23bec787a5913496f2b11c5d26bdff985a drm-tip: 2018y-03m-22d-15h-28m-32s UTC integration manifest
0d9ba65ccc20 drm/i915/guc: Fix null pointer dereference when GuC FW is not available

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8455/issues.html
_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 17:05 ` [PATCH v2] " Piotr Piórkowski
  2018-03-22 17:15   ` Michal Wajdeczko
@ 2018-03-22 18:17   ` Piotr Piórkowski
  2018-03-22 18:21     ` Michal Wajdeczko
  2018-03-22 22:06     ` Yaodong Li
  1 sibling, 2 replies; 14+ messages in thread
From: Piotr Piórkowski @ 2018-03-22 18:17 UTC (permalink / raw)
  To: intel-gfx

If GuC firmware is not available on the system and we load i915 with enable
GuC, then we hit this null pointer dereference issue:

[   71.098873] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
[   71.098947] PGD 0 P4D 0
[   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
[   71.098965] Modules linked in: i915(O+) netconsole x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last unloaded: i915]
[   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O     4.16.0-rc1+ #337
[   71.099018] Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
[   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
[   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
[   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX: ffffffffa03e9357
[   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI: ffff88084cad12f8
[   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09: 0000000000000001
[   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88084cad0000
[   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15: ffff88084cad12b0
[   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000) knlGS:0000000000000000
[   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4: 00000000003606e0
[   71.099182] Call Trace:
[   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
[   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
[   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
[   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
[   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
[   71.099476]  pci_device_probe+0xa1/0x130
[   71.099488]  driver_probe_device+0x302/0x470
[   71.099502]  __driver_attach+0xb9/0xe0
[   71.099513]  ? driver_probe_device+0x470/0x470
[   71.099525]  ? driver_probe_device+0x470/0x470
[   71.099538]  bus_for_each_dev+0x64/0x90
[   71.099550]  bus_add_driver+0x164/0x260
[   71.099561]  ? 0xffffffffa04d6000
[   71.099572]  driver_register+0x57/0xc0
[   71.099582]  ? 0xffffffffa04d6000
[   71.099593]  do_one_initcall+0x3b/0x160
[   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
[   71.099621]  do_init_module+0x5b/0x1f9
[   71.099635]  load_module+0x2467/0x2a70
[   71.099654]  ? SyS_finit_module+0xbd/0xe0
[   71.099668]  SyS_finit_module+0xbd/0xe0
[   71.099682]  do_syscall_64+0x73/0x1c0
[   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
[   71.099706] RIP: 0033:0x7f7f23fb40d9
[   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX: 00007f7f23fb40d9
[   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI: 0000000000000003
[   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09: 00007ffda7d68088
[   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15: 000055f96e2a8260
[   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
[   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP: ffffc90000417aa0
[   71.100020] CR2: 0000000000000008
[   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--

Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and size calculation")

v2: don't assume it is always GuC FW (Michal)
v3: added a new variable to avoid exceeding the number of characters in the
line (Michal)

Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Reported-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jackie Li <yaodong.li@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
---
 drivers/gpu/drm/i915/intel_uc_fw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c b/drivers/gpu/drm/i915/intel_uc_fw.c
index 30c73243f54d..486eb116015b 100644
--- a/drivers/gpu/drm/i915/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/intel_uc_fw.c
@@ -199,9 +199,9 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
 		       int (*xfer)(struct intel_uc_fw *uc_fw,
 				   struct i915_vma *vma))
 {
-	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
 	struct i915_vma *vma;
 	int err;
+	u32 ggtt_pin_bias;
 
 	DRM_DEBUG_DRIVER("%s fw load %s\n",
 			 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path);
@@ -222,9 +222,9 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
 		goto fail;
 	}
 
+	ggtt_pin_bias = to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias; 
 	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
-				       PIN_OFFSET_BIAS |
-				       i915->guc.ggtt_pin_bias);
+				       PIN_OFFSET_BIAS | ggtt_pin_bias);
 	if (IS_ERR(vma)) {
 		err = PTR_ERR(vma);
 		DRM_DEBUG_DRIVER("%s fw ggtt-pin err=%d\n",
-- 
2.14.3

_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 18:17   ` [PATCH v3] " Piotr Piórkowski
@ 2018-03-22 18:21     ` Michal Wajdeczko
  2018-03-23  8:49       ` Joonas Lahtinen
  2018-03-22 22:06     ` Yaodong Li
  1 sibling, 1 reply; 14+ messages in thread
From: Michal Wajdeczko @ 2018-03-22 18:21 UTC (permalink / raw)
  To: intel-gfx, Piotr Piórkowski

On Thu, 22 Mar 2018 19:17:28 +0100, Piotr Piórkowski  
<piotr.piorkowski@intel.com> wrote:

> If GuC firmware is not available on the system and we load i915 with  
> enable
> GuC, then we hit this null pointer dereference issue:
>
> [   71.098873] BUG: unable to handle kernel NULL pointer dereference at  
> 0000000000000008
> [   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.098947] PGD 0 P4D 0
> [   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
> [   71.098965] Modules linked in: i915(O+) netconsole  
> x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul  
> crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last  
> unloaded: i915]
> [   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O      
> 4.16.0-rc1+ #337
> [   71.099018] Hardware name: /NUC6i5SYB, BIOS  
> SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
> [   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
> [   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX:  
> ffffffffa03e9357
> [   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI:  
> ffff88084cad12f8
> [   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09:  
> 0000000000000001
> [   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12:  
> ffff88084cad0000
> [   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15:  
> ffff88084cad12b0
> [   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000)  
> knlGS:0000000000000000
> [   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4:  
> 00000000003606e0
> [   71.099182] Call Trace:
> [   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
> [   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
> [   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
> [   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
> [   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
> [   71.099476]  pci_device_probe+0xa1/0x130
> [   71.099488]  driver_probe_device+0x302/0x470
> [   71.099502]  __driver_attach+0xb9/0xe0
> [   71.099513]  ? driver_probe_device+0x470/0x470
> [   71.099525]  ? driver_probe_device+0x470/0x470
> [   71.099538]  bus_for_each_dev+0x64/0x90
> [   71.099550]  bus_add_driver+0x164/0x260
> [   71.099561]  ? 0xffffffffa04d6000
> [   71.099572]  driver_register+0x57/0xc0
> [   71.099582]  ? 0xffffffffa04d6000
> [   71.099593]  do_one_initcall+0x3b/0x160
> [   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
> [   71.099621]  do_init_module+0x5b/0x1f9
> [   71.099635]  load_module+0x2467/0x2a70
> [   71.099654]  ? SyS_finit_module+0xbd/0xe0
> [   71.099668]  SyS_finit_module+0xbd/0xe0
> [   71.099682]  do_syscall_64+0x73/0x1c0
> [   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
> [   71.099706] RIP: 0033:0x7f7f23fb40d9
> [   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX:  
> 0000000000000139
> [   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX:  
> 00007f7f23fb40d9
> [   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI:  
> 0000000000000003
> [   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09:  
> 00007ffda7d68088
> [   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12:  
> 0000000000000000
> [   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15:  
> 000055f96e2a8260
> [   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00  
> 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c  
> 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
> [   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP:  
> ffffc90000417aa0
> [   71.100020] CR2: 0000000000000008
> [   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--
>
> Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and  
> size calculation")
>
> v2: don't assume it is always GuC FW (Michal)
> v3: added a new variable to avoid exceeding the number of characters in  
> the
> line (Michal)
>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> Reported-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Jackie Li <yaodong.li@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uc_fw.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c  
> b/drivers/gpu/drm/i915/intel_uc_fw.c
> index 30c73243f54d..486eb116015b 100644
> --- a/drivers/gpu/drm/i915/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/intel_uc_fw.c
> @@ -199,9 +199,9 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>  		       int (*xfer)(struct intel_uc_fw *uc_fw,
>  				   struct i915_vma *vma))
>  {
> -	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
>  	struct i915_vma *vma;
>  	int err;
> +	u32 ggtt_pin_bias;
> 	DRM_DEBUG_DRIVER("%s fw load %s\n",
>  			 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path);
> @@ -222,9 +222,9 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>  		goto fail;
>  	}
> +	ggtt_pin_bias = to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias;

this could be even named as simply as "bias", but anyway,

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>

>  	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
> -				       PIN_OFFSET_BIAS |
> -				       i915->guc.ggtt_pin_bias);
> +				       PIN_OFFSET_BIAS | ggtt_pin_bias);
>  	if (IS_ERR(vma)) {
>  		err = PTR_ERR(vma);
>  		DRM_DEBUG_DRIVER("%s fw ggtt-pin err=%d\n",
_______________________________________________
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.CHECKPATCH: warning for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3)
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
                   ` (3 preceding siblings ...)
  2018-03-22 17:34 ` ✗ Fi.CI.BAT: failure for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev2) Patchwork
@ 2018-03-22 18:36 ` Patchwork
  2018-03-22 18:51 ` ✓ Fi.CI.BAT: success " Patchwork
  2018-03-22 20:37 ` ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-03-22 18:36 UTC (permalink / raw)
  To: Piotr Piórkowski; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3)
URL   : https://patchwork.freedesktop.org/series/40490/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
d735ca60e03f drm/i915/guc: Fix null pointer dereference when GuC FW is not available
-:101: ERROR:TRAILING_WHITESPACE: trailing whitespace
#101: FILE: drivers/gpu/drm/i915/intel_uc_fw.c:225:
+^Iggtt_pin_bias = to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias; $

total: 1 errors, 0 warnings, 0 checks, 21 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: success for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3)
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
                   ` (4 preceding siblings ...)
  2018-03-22 18:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3) Patchwork
@ 2018-03-22 18:51 ` Patchwork
  2018-03-22 20:37 ` ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-03-22 18:51 UTC (permalink / raw)
  To: Piotr Piórkowski; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3)
URL   : https://patchwork.freedesktop.org/series/40490/
State : success

== Summary ==

Series 40490v3 drm/i915/guc: Fix null pointer dereference when GuC FW is not available
https://patchwork.freedesktop.org/api/1.0/series/40490/revisions/3/mbox/

---- Known issues:

Test debugfs_test:
        Subgroup read_all_entries:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test kms_chamelium:
        Subgroup dp-crc-fast:
                pass       -> DMESG-FAIL (fi-kbl-7500u) fdo#103841
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                incomplete -> PASS       (fi-cnl-y3) fdo#103191
        Subgroup suspend-read-crc-pipe-c:
                pass       -> INCOMPLETE (fi-bxt-dsi) fdo#103927

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:430s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:440s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:378s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:530s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:297s
fi-bxt-dsi       total:243  pass:216  dwarn:0   dfail:0   fail:0   skip:26 
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:513s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:514s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:505s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:417s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:510s
fi-cnl-drrs      total:285  pass:254  dwarn:3   dfail:0   fail:0   skip:28  time:529s
fi-cnl-y3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:586s
fi-elk-e7500     total:285  pass:225  dwarn:1   dfail:0   fail:0   skip:59  time:424s
fi-gdg-551       total:285  pass:177  dwarn:0   dfail:0   fail:0   skip:108 time:318s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:536s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:400s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:418s
fi-ivb-3520m     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:474s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:433s
fi-kbl-7500u     total:285  pass:259  dwarn:1   dfail:1   fail:0   skip:24  time:479s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:469s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:514s
fi-pnv-d510      total:285  pass:219  dwarn:1   dfail:0   fail:0   skip:65  time:656s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:439s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:533s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:504s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:490s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:426s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:446s
fi-snb-2520m     total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:571s
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:399s
fi-cfl-s3 failed to connect after reboot

40fcdd23bec787a5913496f2b11c5d26bdff985a drm-tip: 2018y-03m-22d-15h-28m-32s UTC integration manifest
d735ca60e03f drm/i915/guc: Fix null pointer dereference when GuC FW is not available

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8458/issues.html
_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available (rev3)
  2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
                   ` (5 preceding siblings ...)
  2018-03-22 18:51 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-03-22 20:37 ` Patchwork
  6 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-03-22 20:37 UTC (permalink / raw)
  To: Piotr Piórkowski; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3)
URL   : https://patchwork.freedesktop.org/series/40490/
State : success

== Summary ==

---- Known issues:

Test kms_flip:
        Subgroup 2x-flip-vs-expired-vblank-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#102887 +1
        Subgroup dpms-vs-vblank-race:
                fail       -> PASS       (shard-hsw) fdo#103060 +1
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                pass       -> FAIL       (shard-hsw) fdo#103481

fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481

shard-apl        total:3484 pass:1820 dwarn:1   dfail:0   fail:7   skip:1655 time:13092s
shard-hsw        total:3484 pass:1771 dwarn:1   dfail:0   fail:4   skip:1707 time:11828s
shard-snb        total:3484 pass:1363 dwarn:1   dfail:0   fail:3   skip:2117 time:7277s
Blacklisted hosts:
shard-kbl        total:3484 pass:1910 dwarn:37  dfail:0   fail:9   skip:1528 time:10081s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8458/shards.html
_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 18:17   ` [PATCH v3] " Piotr Piórkowski
  2018-03-22 18:21     ` Michal Wajdeczko
@ 2018-03-22 22:06     ` Yaodong Li
  1 sibling, 0 replies; 14+ messages in thread
From: Yaodong Li @ 2018-03-22 22:06 UTC (permalink / raw)
  To: Piotr Piórkowski, intel-gfx

On 03/22/2018 11:17 AM, Piotr Piórkowski wrote:
> If GuC firmware is not available on the system and we load i915 with enable
> GuC, then we hit this null pointer dereference issue:
>
> [   71.098873] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
> [   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.098947] PGD 0 P4D 0
> [   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
> [   71.098965] Modules linked in: i915(O+) netconsole x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last unloaded: i915]
> [   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O     4.16.0-rc1+ #337
> [   71.099018] Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
> [   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
> [   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
> [   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX: ffffffffa03e9357
> [   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI: ffff88084cad12f8
> [   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09: 0000000000000001
> [   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88084cad0000
> [   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15: ffff88084cad12b0
> [   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000) knlGS:0000000000000000
> [   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4: 00000000003606e0
> [   71.099182] Call Trace:
> [   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
> [   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
> [   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
> [   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
> [   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
> [   71.099476]  pci_device_probe+0xa1/0x130
> [   71.099488]  driver_probe_device+0x302/0x470
> [   71.099502]  __driver_attach+0xb9/0xe0
> [   71.099513]  ? driver_probe_device+0x470/0x470
> [   71.099525]  ? driver_probe_device+0x470/0x470
> [   71.099538]  bus_for_each_dev+0x64/0x90
> [   71.099550]  bus_add_driver+0x164/0x260
> [   71.099561]  ? 0xffffffffa04d6000
> [   71.099572]  driver_register+0x57/0xc0
> [   71.099582]  ? 0xffffffffa04d6000
> [   71.099593]  do_one_initcall+0x3b/0x160
> [   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
> [   71.099621]  do_init_module+0x5b/0x1f9
> [   71.099635]  load_module+0x2467/0x2a70
> [   71.099654]  ? SyS_finit_module+0xbd/0xe0
> [   71.099668]  SyS_finit_module+0xbd/0xe0
> [   71.099682]  do_syscall_64+0x73/0x1c0
> [   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
> [   71.099706] RIP: 0033:0x7f7f23fb40d9
> [   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
> [   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX: 00007f7f23fb40d9
> [   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI: 0000000000000003
> [   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09: 00007ffda7d68088
> [   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
> [   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15: 000055f96e2a8260
> [   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
> [   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP: ffffc90000417aa0
> [   71.100020] CR2: 0000000000000008
> [   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--
>
> Fixes: 6b0478fb722a ("drm/i915: Implement dynamic GuC WOPCM offset and size calculation")
>
> v2: don't assume it is always GuC FW (Michal)
> v3: added a new variable to avoid exceeding the number of characters in the
> line (Michal)
>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> Reported-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Jackie Li <yaodong.li@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uc_fw.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c b/drivers/gpu/drm/i915/intel_uc_fw.c
> index 30c73243f54d..486eb116015b 100644
> --- a/drivers/gpu/drm/i915/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/intel_uc_fw.c
> @@ -199,9 +199,9 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>   		       int (*xfer)(struct intel_uc_fw *uc_fw,
>   				   struct i915_vma *vma))
>   {
> -	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
>   	struct i915_vma *vma;
>   	int err;
> +	u32 ggtt_pin_bias;
>   
>   	DRM_DEBUG_DRIVER("%s fw load %s\n",
>   			 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path);
> @@ -222,9 +222,9 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>   		goto fail;
>   	}
>   
> +	ggtt_pin_bias = to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias;
>   	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
> -				       PIN_OFFSET_BIAS |
> -				       i915->guc.ggtt_pin_bias);
> +				       PIN_OFFSET_BIAS | ggtt_pin_bias);
>   	if (IS_ERR(vma)) {
>   		err = PTR_ERR(vma);
>   		DRM_DEBUG_DRIVER("%s fw ggtt-pin err=%d\n",
Reviewed-by: Jackie Li <yaodong.li@intel.com>

Regards,
-Jackie
_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-22 18:21     ` Michal Wajdeczko
@ 2018-03-23  8:49       ` Joonas Lahtinen
  2018-03-23 10:09         ` Michal Wajdeczko
  0 siblings, 1 reply; 14+ messages in thread
From: Joonas Lahtinen @ 2018-03-23  8:49 UTC (permalink / raw)
  To: Piotr Piórkowski, Michal Wajdeczko, intel-gfx

Michal,

Can you send this with the enable_guc HAX patch to get a run in the CI
with GuC.

Regards, Joonas
_______________________________________________
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/guc: Fix null pointer dereference when GuC FW is not available
  2018-03-23  8:49       ` Joonas Lahtinen
@ 2018-03-23 10:09         ` Michal Wajdeczko
  0 siblings, 0 replies; 14+ messages in thread
From: Michal Wajdeczko @ 2018-03-23 10:09 UTC (permalink / raw)
  To: Piotr Piórkowski, intel-gfx, Joonas Lahtinen

On Fri, 23 Mar 2018 09:49:45 +0100, Joonas Lahtinen  
<joonas.lahtinen@linux.intel.com> wrote:

> Michal,
>
> Can you send this with the enable_guc HAX patch to get a run in the CI
> with GuC.
>

Piotr will send it with CI prefix very soon.

Thanks,
Michal
_______________________________________________
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:[~2018-03-23 10:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
2018-03-22 16:25 ` Michal Wajdeczko
2018-03-22 16:50 ` Yaodong Li
2018-03-22 17:05 ` [PATCH v2] " Piotr Piórkowski
2018-03-22 17:15   ` Michal Wajdeczko
2018-03-22 18:17   ` [PATCH v3] " Piotr Piórkowski
2018-03-22 18:21     ` Michal Wajdeczko
2018-03-23  8:49       ` Joonas Lahtinen
2018-03-23 10:09         ` Michal Wajdeczko
2018-03-22 22:06     ` Yaodong Li
2018-03-22 17:34 ` ✗ Fi.CI.BAT: failure for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev2) Patchwork
2018-03-22 18:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3) Patchwork
2018-03-22 18:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-22 20:37 ` ✓ 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.