xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Arvind R <arvino55@gmail.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Nouveau on dom0
Date: Sat, 6 Mar 2010 13:46:18 +0530	[thread overview]
Message-ID: <d799c4761003060016o292a5874s91d729893db465c6@mail.gmail.com> (raw)
In-Reply-To: <20100305202309.GA15454@phenom.dumpdata.com>

On Sat, Mar 6, 2010 at 1:53 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Fri, Mar 05, 2010 at 01:16:13PM +0530, Arvind R wrote:
>> On Thu, Mar 4, 2010 at 11:55 PM, Konrad Rzeszutek Wilk
>> <konrad.wilk@oracle.com> wrote:
>> > On Thu, Mar 04, 2010 at 02:47:58PM +0530, Arvind R wrote:
>> >> On Wed, Mar 3, 2010 at 11:43 PM, Konrad Rzeszutek Wilk
>> >> <konrad.wilk@oracle.com> wrote:
> Yeah... Can you also instrument the code to print the PFN? The code goes
> through insert_pfn->pfn_pte, which calls xen_make_pte, which ends up
> doing pte_pfn_to_mfn. That routine does a pfn_to_mfn which does a
> get_phys_to_machine(pfn). The last routine looks up the PFN->MFN lookup
> table and finds a MFN that corresponds to this PFN. Since the memory
> was allocated from ... well this is the big question.
>
> Is the memory allocated from normal kernel space or is really backed by
> the video card. In your previous e-mails you mentioned that is_iomem is
> set to zero, which implies that the memory for these functions is NOT
> memory backed.
>
> the VM_IO is OK if the memory that is being referenced is the video
> driver memory. _BUT_ if the memory is being allocated through the
> alloc_page (ttm_tt_alloc_page) , or kmalloc, then this will cause us
> headaches. You might want to check in  ttm_bo_vm_fault what the
> vma->vm_flags are and if VM_IO is set.
>
> (FYI, look at
> http://git.kernel.org/?p=linux/kernel/git/konrad/xen.git;a=commit;h=e84db8b7136d1b4a393dbd982201d0c5a3794333)
How do you remember these refs?!

>
> Thought I am not sure if the ttm_bo_mmap is used by the nvidia driver.
U mean nouveau? Only for accelerated graphics.

> Attached is a re-write of the debug patch I sent earlier. I compile
> tested it but haven't yet run it (just doing that now).
>
Output: (snipped/cut/pasted for easier association)

Trace of Pushbuf Memory Access, Bare-BOOT:
X: OUT_RING: Enter: chan=0x8170a0, id=2, data=0x48000, chan->cur=0x7f0aa3594054
kernel: [TTM] FAULTing-in address=0x7f0aa3594000, bo->buffer_start=0x0
kernel: [ BEFORE]PFN: 0x7513f PTE: 0x750001e3 (val:750001e3): [    RW
       PSE GLB x  ] [2M]
kernel: [    AFTER]PFN: 0x7513f PTE: 0x750001e3 (val:750001e3): [
RW         PSE GLB x  ] [2M]
kernel: [BEFORE]PFN: 0x75144 PTE: 0x750001e3 (val:750001e3): [    RW
      PSE GLB x  ][2M]
kernel: [   AFTER]PFN: 0x75144 PTE: 0x750001e3 (val:750001e3): [    RW
        PSE GLB x  ] [2M]
< --- and so on for 14 more pages --->
X: OUT_RING: updated data
X: OUT_RING: Exit

Trace of Pushbuf Memory Access, Xen-BOOT:
X: OUT_RING: Enter: chan=0x8170a0, id=2, data=0x44000, chan->cur=0x7f98838df000
kernel: [TTM] FAULTing-in address=0x7f98838df000, bo->buffer_start=0x0
kernel: [BEFORE]PFN: 0x16042 PTE: 0x10000068042067
(val:10000068042067): [mfn:426050->ffff880016042000USR RW
   x  ] [4K]
kernel: [   AFTER]PFN: 0x16042 PTE: 0x10000068042067
(val:10000068042067): [mfn:426050->ffff880016042000USR RW
   x  ] [4K]
kernel: [BEFORE]PFN: 0x16043 PTE: 0x10000068043067
(val:10000068043067): [mfn:426051->ffff880016043000USR RW
   x  ] [4K]
kernel: [   AFTER]PFN: 0x16043 PTE: 0x10000068043067
(val:10000068043067): [mfn:426051->ffff880016043000USR RW
   x  ] [4K]
< --- and so on for 14 more pages --->
< --- and repeat fault --->
kernel: [TTM] FAULTing-in address=0x7f98838df000, bo->buffer_start=0x0

Do you know what is happening? Is a solution feasible?

Sequence of nouveau operation as I understand it:
1. prepare for user pushbuf write by grabbing memory access rights
(exclude GPU access)
2. Do the write
3. finish and release grab

The memory may/maynot be on the video card. There is a vram_pushbuf
module option which would probably complicate things more. GPU is
informed about the address, I suppose,
in the prepare and finish pre/postamble to RING access.

and, THANKS hugely for your help.

  reply	other threads:[~2010-03-06  8:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25  8:46 Nouveau on dom0 Arvind R
2010-02-25 12:55 ` Konrad Rzeszutek Wilk
2010-02-25 17:01   ` Arvind R
2010-02-25 17:44     ` Konrad Rzeszutek Wilk
2010-02-26 15:34       ` Arvind R
2010-03-01 16:01         ` Konrad Rzeszutek Wilk
2010-03-02 21:34           ` Arvind R
2010-03-03 17:11             ` Arvind R
2010-03-03 18:13               ` Konrad Rzeszutek Wilk
2010-03-04  9:17                 ` Arvind R
2010-03-04 18:25                   ` Konrad Rzeszutek Wilk
2010-03-05  7:46                     ` Arvind R
2010-03-05 20:23                       ` Konrad Rzeszutek Wilk
2010-03-06  8:16                         ` Arvind R [this message]
2010-03-06 20:59                           ` Arvind R
2010-03-06 23:56                             ` Arvind R
2010-03-08 17:51                               ` Konrad Rzeszutek Wilk
2010-03-10 12:50                                 ` [Solved] " Arvind R
2010-03-10 14:00                                   ` Pasi Kärkkäinen
2010-03-10 19:37                                   ` Jeremy Fitzhardinge
     [not found]                                   ` <20100311201536.GA22182@phenom.dumpdata.com>
2010-03-12  6:12                                     ` Arvind R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d799c4761003060016o292a5874s91d729893db465c6@mail.gmail.com \
    --to=arvino55@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).