Re: PRT support for amdgpu v3

2017-02-13 Thread Christian König

Hi Nicolai,

that one should be fixed by "drm/amdgpu: fix PRT cleanup order in the 
VM". Please test and/or review.


Thanks,
Christian.

Am 12.02.2017 um 12:36 schrieb Nicolai Hähnle:

Hi,

Some more testing uncovered a bug in cleanup paths. When the 
application segfaults while PRT mappings exist, I get a WARN_ON (which 
seems fairly straightforward) and occasionally also an RCU error 
warning -- see the attached dmesg logs.


Regular application shutdown works fine, though.

Cheers,
Nicolai

On 08.02.2017 16:04, Christian König wrote:

Hi guys,

ok I finally found time to write an unit test for this and hammered 
out the last few bugs.


Seems to work fine on my Tonga now. Please note that this set is 
based on "fix race in GEM VA map IOCTL v2", without that patch you 
will run into a NULL pointer dereference during PRT mapping.


Going to send out the unit test in a minute.

Regards,
Christian.

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx





___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: PRT support for amdgpu v3

2017-02-12 Thread Nicolai Hähnle

Hi,

Some more testing uncovered a bug in cleanup paths. When the application 
segfaults while PRT mappings exist, I get a WARN_ON (which seems fairly 
straightforward) and occasionally also an RCU error warning -- see the 
attached dmesg logs.


Regular application shutdown works fine, though.

Cheers,
Nicolai

On 08.02.2017 16:04, Christian König wrote:

Hi guys,

ok I finally found time to write an unit test for this and hammered out the 
last few bugs.

Seems to work fine on my Tonga now. Please note that this set is based on "fix race 
in GEM VA map IOCTL v2", without that patch you will run into a NULL pointer 
dereference during PRT mapping.

Going to send out the unit test in a minute.

Regards,
Christian.

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



Feb 12 12:07:46 cassiopeia kernel: [36172.512767] arb_sparse_buff[15881]: 
segfault at 10 ip 7f295fdda14a sp 7ffce6dd2860 error 4 in 
radeonsi_dri.so[7f295f57e000+b54000]
Feb 12 12:07:46 cassiopeia kernel: [36172.688430] [ cut here 
]
Feb 12 12:07:46 cassiopeia kernel: [36172.688689] WARNING: CPU: 3 PID: 15886 at 
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:1000 amdgpu_bo_gpu_offset+0xe0/0x1d0 
[amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.688692] Modules linked in: 
snd_usb_audio snd_usbmidi_lib btrfs xor raid6_pq binfmt_misc edac_mce_amd 
edac_core nls_iso8859_1 dm_crypt kvm_amd kvm irqbypass crct10dif_pclmul 
crc32_pclmul ghash_clmulni_intel input_leds joydev aesni_intel aes_x86_64 
glue_helper lrw gf128mul ablk_helper cryptd snd_hda_codec_realtek 
snd_hda_codec_generic serio_raw snd_hda_codec_hdmi fam15h_power snd_hda_intel 
snd_hda_codec k10temp snd_hda_core snd_hwdep snd_pcm i2c_piix4 snd_seq_midi 
snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device snd_timer snd soundcore 
tpm_infineon eeepc_wmi asus_wmi video mac_hid sparse_keymap mxm_wmi shpchp wmi 
parport_pc ppdev lp parport autofs4 amdkfd amd_iommu_v2 amdgpu i2c_algo_bit 
drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse ttm drm 
ahci r8169 libahci mii fjes
Feb 12 12:07:46 cassiopeia kernel: [36172.688896]  hid_generic usbhid hid
Feb 12 12:07:46 cassiopeia kernel: [36172.688915] CPU: 3 PID: 15886 Comm: 
si_shader:3 Tainted: GB   4.9.0-amd-staging-4.9-prt #133
Feb 12 12:07:46 cassiopeia kernel: [36172.688920] Hardware name: To be filled 
by O.E.M. To be filled by O.E.M./M5A97 LE R2.0, BIOS 2601 03/24/2015
Feb 12 12:07:46 cassiopeia kernel: [36172.688925]  8804d952f3e0 
a06b93a7  
Feb 12 12:07:46 cassiopeia kernel: [36172.688940]  8804d952f428 
a00d25b1 880560a06440 03e8
Feb 12 12:07:46 cassiopeia kernel: [36172.688953]  88065d4dd468 
88065d4dd51c 88065d4dcd28 1fff
Feb 12 12:07:46 cassiopeia kernel: [36172.688966] Call Trace:
Feb 12 12:07:46 cassiopeia kernel: [36172.688980]  [] 
dump_stack+0x86/0xcf
Feb 12 12:07:46 cassiopeia kernel: [36172.688991]  [] 
__warn+0x111/0x130
Feb 12 12:07:46 cassiopeia kernel: [36172.689002]  [] 
warn_slowpath_null+0x1d/0x20
Feb 12 12:07:46 cassiopeia kernel: [36172.689234]  [] 
amdgpu_bo_gpu_offset+0xe0/0x1d0 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.689474]  [] 
amdgpu_vm_update_ptes.isra.9+0x103/0x2c0 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.689484]  [] ? 
kmem_cache_alloc+0x195/0x270
Feb 12 12:07:46 cassiopeia kernel: [36172.689723]  [] 
amdgpu_vm_frag_ptes+0x121/0x140 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.689963]  [] 
amdgpu_vm_bo_split_mapping+0x7d6/0xa00 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.689974]  [] ? 
do_group_exit+0x98/0x160
Feb 12 12:07:46 cassiopeia kernel: [36172.690213]  [] ? 
amdgpu_vm_free_mapping.isra.10+0xb0/0xb0 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.690221]  [] ? 
get_signal+0x3a9/0xb90
Feb 12 12:07:46 cassiopeia kernel: [36172.690230]  [] ? 
trace_hardirqs_on_caller+0x16/0x280
Feb 12 12:07:46 cassiopeia kernel: [36172.690238]  [] ? 
trace_hardirqs_on+0xd/0x10
Feb 12 12:07:46 cassiopeia kernel: [36172.690487]  [] ? 
amdgpu_vm_do_copy_ptes+0x1c0/0x1c0 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.690496]  [] ? 
kfree+0xea/0x2a0
Feb 12 12:07:46 cassiopeia kernel: [36172.690736]  [] 
amdgpu_vm_clear_freed+0x11a/0x200 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.690976]  [] ? 
amdgpu_vm_bo_update+0x750/0x750 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.690986]  [] ? 
kasan_slab_free+0x89/0xc0
Feb 12 12:07:46 cassiopeia kernel: [36172.691225]  [] ? 
amdgpu_vm_fini+0x259/0x430 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.691464]  [] 
amdgpu_vm_fini+0x28c/0x430 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.691716]  [] ? 
amdgpu_vm_init+0x4d0/0x4d0 [amdgpu]
Feb 12 12:07:46 cassiopeia kernel: [36172.691975]  [] 
amdgpu_driver_postclose_kms+0x233/0x3b0 [amdgpu]
Feb 12 12:07:46 cassiopeia 

Re: PRT support for amdgpu v3

2017-02-09 Thread Bas Nieuwenhuizen
Tested on amd-staging-4.9 + these patches, and it works for me too.

Thanks,
Bas Nieuwenhuizen

On Wed, Feb 8, 2017, at 16:04, Christian König wrote:
> Hi guys,
> 
> ok I finally found time to write an unit test for this and hammered out
> the last few bugs.
> 
> Seems to work fine on my Tonga now. Please note that this set is based on
> "fix race in GEM VA map IOCTL v2", without that patch you will run into a
> NULL pointer dereference during PRT mapping.
> 
> Going to send out the unit test in a minute.
> 
> Regards,
> Christian.
> 
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: PRT support for amdgpu v3

2017-02-09 Thread Christian König

Am 09.02.2017 um 11:11 schrieb Nicolai Hähnle:

On 08.02.2017 16:04, Christian König wrote:

Hi guys,

ok I finally found time to write an unit test for this and hammered 
out the last few bugs.


Seems to work fine on my Tonga now. Please note that this set is 
based on "fix race in GEM VA map IOCTL v2", without that patch you 
will run into a NULL pointer dereference during PRT mapping.


I can confirm that it works with my Mesa series as well: I get the 
"Disabling VM faults" warning message, and indeed accessing outside 
the committed region does not cause VM faults.


Great! Anybody who wants to give me some RBs on the patches?

I would like to commit those to the internal branches.

Regards,
Christian.



Cheers,
Nicolai



Going to send out the unit test in a minute.

Regards,
Christian.

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx





___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: PRT support for amdgpu v3

2017-02-09 Thread Nicolai Hähnle

On 08.02.2017 16:04, Christian König wrote:

Hi guys,

ok I finally found time to write an unit test for this and hammered out the 
last few bugs.

Seems to work fine on my Tonga now. Please note that this set is based on "fix race 
in GEM VA map IOCTL v2", without that patch you will run into a NULL pointer 
dereference during PRT mapping.


I can confirm that it works with my Mesa series as well: I get the 
"Disabling VM faults" warning message, and indeed accessing outside the 
committed region does not cause VM faults.


Cheers,
Nicolai



Going to send out the unit test in a minute.

Regards,
Christian.

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


PRT support for amdgpu v3

2017-02-08 Thread Christian König
Hi guys,

ok I finally found time to write an unit test for this and hammered out the 
last few bugs.

Seems to work fine on my Tonga now. Please note that this set is based on "fix 
race in GEM VA map IOCTL v2", without that patch you will run into a NULL 
pointer dereference during PRT mapping.

Going to send out the unit test in a minute.

Regards,
Christian.

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx