All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 60200] New: radeon_bo with virtual address referencing mismatch
@ 2013-02-02 18:56 bugzilla-daemon
  2013-02-02 18:57 ` [Bug 60200] " bugzilla-daemon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bugzilla-daemon @ 2013-02-02 18:56 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 3602 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=60200

          Priority: medium
            Bug ID: 60200
          Assignee: dri-devel@lists.freedesktop.org
           Summary: radeon_bo with virtual address referencing mismatch
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: g02maran@gmail.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: git
         Component: Drivers/Gallium/r600
           Product: Mesa

Created attachment 74101
  --> https://bugs.freedesktop.org/attachment.cgi?id=74101&action=edit
patch

First a disclaimer, this code is unfamiliar to me so there is probably stuff
that i have misunderstood.

When i try to start weston it immediatly crashes with the following error:
radeon: Failed to allocate a buffer:
radeon:    size      : 1 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 2

and dmesg says:
[   75.092178] radeon 0000:01:00.0: bo ffff8802233f8800 va 0x00000000 conflict
with (bo ffff8802219de400 0x0082C000 0x010F6000)
[   75.092195] radeon 0000:01:00.0: bo ffff8802233f8800 don't has a mapping in
vm ffff88022275ac00

Everything works fine if i disable the virtual address code, so the issue is in
there somewhere.

I tried to analyze it and this is what i came up with:

Consider the following scenario:

radeon_bomgr_create_bo: create gem buffer
kernel: create buffer with handle 1 set ref count to 1
radeon_bomgr_create_bo: create radeon_bo with handle 1 set ref count to 1
radeon_bomgr_create_bo: find virtual address for handle 1
radeon_bomgr_find_va: free list empty use offset 2000
radeon_bomgr_create_bo: map virtual address for handle 1 at offset 2000
kernel: map virtual address for handle 1 at offset 2000

somewhere in userspace: create flink for handle 1
kernel: create flink name 1 for handle 1

radeon_winsys_bo_from_handle: open gem buffer with name 1
kernel: create handle 2 increase ref count to 2
radeon_winsys_bo_from_handle: create radeon_bo with handle 2 set ref count to 1
radeon_winsys_bo_from_handle: find virtual address for handle 2
radeon_bomgr_find_va: free list empty use offset 6000
radeon_winsys_bo_from_handle: map virtual address for handle 2 at offset 6000
kernel: virtual address already mapped for handle 2 use offset 2000

somewhere in userspace: destroy handle 2
somewhere in userspace: decrease handle 2 ref count to 0
radeon_bo_destroy: close gem buffer with handle 2
kernel: decrease ref count to 1
radeon_bo_destroy: free virtual address with offset 2000
radeon_bomgr_free_va: add virtual address with offset 2000 to free list

radeon_bomgr_create_bo: create gem buffer
kernel: create buffer with handle 3 set ref count to 1
radeon_bomgr_create_bo: create radeon_bo with handle 3 set ref count to 1
radeon_bomgr_create_bo: find virtual address for handle 3
radeon_bomgr_find_va: from free list use offset 2000
radeon_bomgr_create_bo: map virtual address for handle 3 at offset 2000
kernel: virtual address conflict offset 2000 already mapped

This is a simplifed scenario what happens in my case. The issue, at least as i
see it, is that the virtual address is freed(added to the free list) even
though it is still mapped in the kernel. This is because the userspace
referencing code does not track the radeon_bo object created in function
radeon_bomgr_create_bo.

The attached patch fixes the issue for me, but is probably not the correct fix.

The issue was found and tested on wayland/weston master, mesa master and kernel
3.8.0-rc6

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 5010 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [Bug 60200] radeon_bo with virtual address referencing mismatch
  2013-02-02 18:56 [Bug 60200] New: radeon_bo with virtual address referencing mismatch bugzilla-daemon
@ 2013-02-02 18:57 ` bugzilla-daemon
  2013-02-02 18:57 ` bugzilla-daemon
  2013-02-12  1:06 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2013-02-02 18:57 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 292 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=60200

--- Comment #1 from Martin Andersson <g02maran@gmail.com> ---
Created attachment 74102
  --> https://bugs.freedesktop.org/attachment.cgi?id=74102&action=edit
dmesg

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1173 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [Bug 60200] radeon_bo with virtual address referencing mismatch
  2013-02-02 18:56 [Bug 60200] New: radeon_bo with virtual address referencing mismatch bugzilla-daemon
  2013-02-02 18:57 ` [Bug 60200] " bugzilla-daemon
@ 2013-02-02 18:57 ` bugzilla-daemon
  2013-02-12  1:06 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2013-02-02 18:57 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 293 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=60200

--- Comment #2 from Martin Andersson <g02maran@gmail.com> ---
Created attachment 74103
  --> https://bugs.freedesktop.org/attachment.cgi?id=74103&action=edit
weston

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1176 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [Bug 60200] radeon_bo with virtual address referencing mismatch
  2013-02-02 18:56 [Bug 60200] New: radeon_bo with virtual address referencing mismatch bugzilla-daemon
  2013-02-02 18:57 ` [Bug 60200] " bugzilla-daemon
  2013-02-02 18:57 ` bugzilla-daemon
@ 2013-02-12  1:06 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2013-02-12  1:06 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=60200

Laurent carlier <lordheavym@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Laurent carlier <lordheavym@gmail.com> ---
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a37835c8eda017f0c955e0927e7418e7f3ba3b73

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2155 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2013-02-12  1:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-02 18:56 [Bug 60200] New: radeon_bo with virtual address referencing mismatch bugzilla-daemon
2013-02-02 18:57 ` [Bug 60200] " bugzilla-daemon
2013-02-02 18:57 ` bugzilla-daemon
2013-02-12  1:06 ` bugzilla-daemon

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.