[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kernelnewbies
Subject:    Re: "Unable to handle kernel paging request" - what does that mean?
From:       Timur Tabi <timur.tabi () ammasso ! com>
Date:       2004-06-28 16:01:34
Message-ID: 40E040DE.3040003 () ammasso ! com
[Download RAW message or body]

Ok, I have some more information.  I added some printk calls to the 
function below, and this is what I got (all numbers in hex):

address = 42133008
pgd = c36f1420
pmd = c36f1420 (the pgd and pmd have the same value?????)
pte = f95894cc

And the error message is:

Unable to handle kernel page request at address f95894cc.

So it looks like the function is dying in the pte_val() call.  That 
means that it's the PTE array (??) that needs to be paged in, not the 
page I'm trying to get the physical address for.  Is that even possible?

What exactly does 'pte' in my function below point to?  Is it an entry 
in a array of pte_t structures?  If so, shouldn't that array ALWAYS be 
present in memory?

I have a suspcion that 0x42133008 is a bogus user-space virtual address.

Timur Tabi wrote:

> The following function is causing this error:
> 
> unsigned long user_virt_to_phys(unsigned long address)
> {
>         pgd_t *pgd = pgd_offset(current->mm, address);
>         pmd_t *pmd = pmd_offset(pgd, address);
> #ifdef pte_offset_kernel
>         pte_t *pte = pte_offset_kernel(pmd, address);
> #else
>         pte_t *pte = pte_offset(pmd, address);
> #endif
> 
>         return pte_val(*pte) & PTE_MASK;
> }
> 
> I'm assuming that the error message is displayed when I try to obtain 
> the physical address for a page that isn't in memory (and therefore, has 
> no physical address).  Is that correct?
> 


-- 
Timur Tabi
Staff Software Engineer
timur.tabi@ammasso.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic