Bug 96603

Summary: [APL / KBL] [BAT] vgem_basic / mmap causes segmentation fault (core dumped)
Product: DRI Reporter: Humberto Israel Perez Rodriguez <humberto.i.perez.rodriguez>
Component: DRM/IntelAssignee: Humberto Israel Perez Rodriguez <humberto.i.perez.rodriguez>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: high CC: intel-gfx-bugs, ricardo.vega
Version: XOrg git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: BXT, KBL i915 features: display/Other
Attachments:
Description Flags
dmesg none

Description Humberto Israel Perez Rodriguez 2016-06-20 22:15:51 UTC
Created attachment 124626 [details]
dmesg

Regresion
==============
no, this is a new test

Bug description
=================

Steps to reproduce
=================
1- run ./vgem_basic --run-subtest mmap --debug


Actual results
=================
the test shows core dumped and dmesg alert/critical/error conditions

Expected results
=================
the test should be pass or skip

Test output
================
IGT-Version: 1.15-gc344044 (x86_64) (Linux: 4.7.0-rc4-drm-intel-nightly-ww26-commit-f586720+ x86_64)
(vgem_basic:1244) drmtest-DEBUG: Test requirement passed: fd >= 0
(vgem_basic:1244) igt-core-DEBUG: Starting subtest: mmap
Segmentation fault (core dumped)


Relevant dmesg information
============================
kern  :alert : [Mon Jun 20 14:02:40 2016] RIP  [<ffffffff811bc43b>] vm_insert_page+0x19b/0x1b0
kern  :crit  : [Mon Jun 20 14:02:40 2016] kernel BUG at mm/memory.c:1529!
kern  :err   : [Mon Jun 20 14:02:27 2016] efi: requested map not found.
kern  :err   : [Mon Jun 20 14:02:27 2016] esrt: ESRT header is not in the memory map.
kern  :err   : [Mon Jun 20 14:02:28 2016] atkbd serio0: Failed to deactivate keyboard on isa0060/serio0
kern  :err   : [Mon Jun 20 14:02:28 2016] atkbd serio0: Failed to enable keyboard on isa0060/serio0
kern  :err   : [Mon Jun 20 14:02:30 2016] i2c_designware i2c_designware.3: i2c_dw_handle_tx_abort: lost arbitration
kern  :err   : [Mon Jun 20 14:02:30 2016] i2c_designware i2c_designware.3: i2c_dw_handle_tx_abort: lost arbitration
kern  :err   : [Mon Jun 20 14:02:30 2016] i2c_designware i2c_designware.3: i2c_dw_handle_tx_abort: lost arbitration
kern  :err   : [Mon Jun 20 14:02:30 2016] i2c_designware i2c_designware.3: i2c_dw_handle_tx_abort: lost arbitration
kern  :err   : [Mon Jun 20 14:02:30 2016] i2c_hid i2c-ELAN221D:00: hid_descr_cmd failed
kern  :err   : [Mon Jun 20 14:02:30 2016] i2c_hid i2c-ALPS0001:00: hid_descr_cmd failed


attachments
================
dmesg



 Software information
============================================
Kernel version                  : 4.7.0-rc4-drm-intel-nightly-ww26-commit-f586720+
Linux distribution              : Ubuntu 16.04 LTS
Architecture                    : 64-bit
Bios revision                   : 138.25
KSC revision                    : 1.12


 --> Component : drm 
	 url : http://cgit.freedesktop.org/mesa/drm 
	 tag : libdrm-2.4.68 
	 commit : fc09c5a 
 --> Component : cairo 
	 url : http://cgit.freedesktop.org/cairo 
	 tag : 1.15.2 
	 commit : db8a7f1 
 --> Component : intel-gpu-tools 
	 url : http://cgit.freedesktop.org/xorg/app/intel-gpu-tools 
	 tag : intel-gpu-tools-1.15-29-gc344044 
	 commit : c344044 


 Hardware information
============================================
Platform                        : BXT-P
Motherboard model               : Broxton P
Motherboard type                : NOTEBOOK Hand Held
Motherboard manufacturer        : Intel Corp.
CPU family                      : B1
CPU information                 : 06/5c
GPU Card                        : Intel Corporation Device 5a84 (rev 0a) (prog-if 00 [VGA controller])
Memory ram                      : 16 GB

 Firmwares information
============================================
DMC fw loaded                   : yes
DMC version                     : 1.7
GUC fw loaded                   : SUCCESS
GUC version wanted              : 8.7
GUC version found               : 8.7
Comment 1 Humberto Israel Perez Rodriguez 2016-06-20 22:21:33 UTC
this was the kernel used 

branch : drm-intel-nightly
commit f586720edd865745aaca6f612615ef14c77e6091
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Jun 20 15:25:16 2016 +0200

    drm-intel-nightly: 2016y-06m-20d-13h-24m-46s UTC integration manifest
Comment 2 Luis Botello 2016-06-20 22:39:32 UTC
Same issue observed on KBL with the same config:

Hardware information
=====================
Platform		KBL
Motherboard model	RVP 7
Motherboard manufacturer	Intel Corp.
GPU Card	Intel Corporation Device 5a84 (rev 03) (prog-if 00 [VGA controller])
Comment 3 yann 2016-06-21 06:06:51 UTC
Relevant piece of dmesg is linked to subtest mmap in vgem_basic test:

[   13.881137] vgem_basic: starting subtest mmap
[   13.881721] [drm:vgem_gem_dumb_create] Created object of size 4194304
[   13.881744] ------------[ cut here ]------------
[   13.882281] kernel BUG at mm/memory.c:1529!
[   13.882826] invalid opcode: 0000 [#1] SMP
[   13.883377] Modules linked in: vgem snd_hda_codec_hdmi bnep asix usbnet mii spi_pxa2xx_platform 8250_dw i2c_designware_platform x86_pkg_temp_thermal i2c_designware_core intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd snd_hda_codec_realtek snd_hda_codec_generic serio_raw binfmt_misc arc4 nls_iso8859_1 snd_hda_intel iwlmvm input_leds mac80211 intel_lpss_pci btusb intel_lpss btrtl btbcm btintel snd_hda_codec snd_hda_core snd_hwdep bluetooth snd_pcm iwlwifi snd_seq_midi snd_seq_midi_event snd_rawmidi cfg80211 snd_seq snd_seq_device shpchp snd_timer mei_me snd mei soundcore rfkill_gpio soc_button_array tpm_crb intel_pmc_ipc mac_hid parport_pc ppdev lp parport autofs4 hid_generic usbhid
[   13.885582]  mmc_block i915 igb drm_kms_helper dca syscopyarea sysfillrect ptp sysimgblt sdhci_pci fb_sys_fops pps_core sdhci i2c_algo_bit ahci drm libahci i2c_hid hid video
[   13.887183] CPU: 1 PID: 1244 Comm: vgem_basic Tainted: G     U          4.7.0-rc4-drm-intel-nightly-ww26-commit-f586720+ #1
[   13.888027] Hardware name: Intel Corp. Broxton P/NOTEBOOK, BIOS APLKRVPA.X64.0138.B25.1605230512 05/23/2016
[   13.888908] task: ffff880466bdcc40 ti: ffff88046bdbc000 task.ti: ffff88046bdbc000
[   13.889794] RIP: 0010:[<ffffffff811bc43b>]  [<ffffffff811bc43b>] vm_insert_page+0x19b/0x1b0
[   13.890705] RSP: 0000:ffff88046bdbfd38  EFLAGS: 00010202
[   13.891627] RAX: 0000000000000001 RBX: ffff880466947da8 RCX: 0000000000000000
[   13.892569] RDX: 0000000000000002 RSI: 00007f15cc0b9000 RDI: ffff880467a01c68
[   13.893509] RBP: ffff88046bdbfd68 R08: ffff88046d37f100 R09: ffff88046bdbfe58
[   13.894470] R10: 00003fffffe00000 R11: 0000000000000000 R12: ffffea001176eb40
[   13.895450] R13: 00007f15cc0b9000 R14: ffff880466947da8 R15: 0000000000000002
[   13.896436] FS:  00007f15ce7ca740(0000) GS:ffff88047f880000(0000) knlGS:0000000000000000
[   13.897434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   13.898444] CR2: 00007f15cc0b9000 CR3: 000000046bd21000 CR4: 00000000003406e0
[   13.899480] Stack:
[   13.900517]  0000000000000000 00007f15cc0b9000 ffff88046bdbfe58 0000000000100000
[   13.901579]  ffff880466947da8 0000000000000002 ffff88046bdbfd78 ffffffffc052d12b
[   13.902663]  ffff88046bdbfde0 ffffffff811b8976 024200ca00000055 0000000000100000
[   13.903766] Call Trace:
[   13.904861]  [<ffffffffc052d12b>] vgem_gem_fault+0x4b/0x90 [vgem]
[   13.905974]  [<ffffffff811b8976>] __do_fault+0x66/0x130
[   13.907095]  [<ffffffff811b9bc8>] ? __pte_alloc+0xb8/0x110
[   13.908183]  [<ffffffff811bd33d>] handle_mm_fault+0x35d/0x1c90
[   13.909231]  [<ffffffff811c4c00>] ? do_mmap+0x440/0x540
[   13.910260]  [<ffffffff81374018>] ? common_mmap+0x48/0x50
[   13.911290]  [<ffffffff81374066>] ? apparmor_mmap_file+0x16/0x20
[   13.912321]  [<ffffffff81067022>] __do_page_fault+0x1e2/0x4d0
[   13.913331]  [<ffffffff81067332>] do_page_fault+0x22/0x30
[   13.914353]  [<ffffffff81800438>] page_fault+0x28/0x30
[   13.915370] Code: 83 c4 08 31 c0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 b8 f2 ff ff ff c3 48 8b 7d d0 c6 07 00 0f 1f 40 00 b8 f0 ff ff ff e9 06 ff ff ff <0f> 0b 0f 0b b8 ea ff ff ff c3 66 66 2e 0f 1f 84 00 00 00 00 00 
[   13.916560] RIP  [<ffffffff811bc43b>] vm_insert_page+0x19b/0x1b0
[   13.917639]  RSP <ffff88046bdbfd38>
[   13.918754] ---[ end trace 22452399a79e67b6 ]---
Comment 4 Chris Wilson 2016-06-21 06:33:36 UTC
https://patchwork.freedesktop.org/patch/94090/
Comment 5 yann 2016-06-21 06:44:03 UTC
Humberto, please re-test with Chris patch
Comment 6 Chris Wilson 2016-06-21 10:51:13 UTC
If we can get a tested-by that would be a good accelerator for getting this upstream.
Comment 7 Humberto Israel Perez Rodriguez 2016-06-21 20:53:21 UTC
after test with the path from Chris Wilson the test is pass


test output: 
=================
IGT-Version: 1.15-gc344044 (x86_64) (Linux: 4.7.0-rc4drm-intel-nightly-12ce3ee-patch-bug-96603+ x86_64)
(vgem_basic:1579) drmtest-DEBUG: Test requirement passed: fd >= 0
(vgem_basic:1579) igt-core-DEBUG: Starting subtest: mmap
Subtest mmap: SUCCESS (0.000s)
Test requirement not met in function __real_main153, file vgem_basic.c:169:
Test requirement: has_prime_export(fd)
(vgem_basic:1579) igt-core-DEBUG: Exiting with status code 0


kernel used: 
====================
commit 12ce3eec546cb7d91c6ff546ffa11abcc547365e
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Tue Jun 21 15:44:04 2016 +0100

    drm-intel-nightly: 2016y-06m-21d-14h-43m-47s UTC integration manifest
Comment 8 Chris Wilson 2016-06-22 15:00:37 UTC
The fix is not upstream yet.
Comment 9 Kimmo Nikkanen 2016-06-23 16:58:20 UTC
(In reply to Chris Wilson from comment #8)
> The fix is not upstream yet.

The patch now has r-b on it.
Comment 10 yann 2016-07-01 18:54:48 UTC
Changing priority to high because patch is on the way and was already qualified and this is not milestone blocker now
Comment 11 yann 2016-07-15 09:17:34 UTC
Humberto, please re-test with latest nightly, patch is merged.
Comment 12 Chris Wilson 2016-07-15 19:50:23 UTC
commit 5ba6c9ff961a79809ec0daf2713e8d39e3f77199
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jun 23 15:35:32 2016 +0100

    drm/vgem: Fix mmaping
Comment 13 Humberto Israel Perez Rodriguez 2016-07-15 21:05:12 UTC
(In reply to yann from comment #11)
> Humberto, please re-test with latest nightly, patch is merged.


Hi Yaan: 

with the latest nightly kernel i confirm that this test is pass 

test output
======================
IGT-Version: 1.15-gee5d5c4 (x86_64) (Linux: 4.7.0-rc7drm-intel-nightly-30eabca-bug96608+ x86_64)
(vgem_basic:1372) drmtest-DEBUG: Test requirement passed: fd >= 0
(vgem_basic:1372) igt-core-DEBUG: Starting subtest: mmap
Subtest mmap: SUCCESS (0.000s)
(vgem_basic:1372) DEBUG: Test requirement passed: has_prime_export(fd)
Test requirement not met in function __real_main297, file vgem_basic.c:327:
Test requirement: vgem_has_fences(fd)
(vgem_basic:1372) igt-core-DEBUG: Exiting with status code 0



Gfx stack
=======================
Component         : drm
	tag       : libdrm-2.4.68-14-g8c8d5dd
	commit    : 8c8d5dd
Component         : cairo
	tag       : 1.15.2-44-g1a380ef
	commit    : 1a380ef
Component         : intel-gpu-tools
	tag       : intel-gpu-tools-1.15-127-gee5d5c4
	commit    : ee5d5c4


kernel used 
==============================
commit 30eabcaa6dcea5ca21f7e6c00da7ab4b1910396c
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Jul 15 16:53:45 2016 +0200

    drm-intel-nightly: 2016y-07m-15d-14h-53m-25s UTC integration manifest

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.