linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sanket Rathi <sanket.rathi@cdac.ernet.in>
To: linux-mm@kvack.org
Subject: page table entries
Date: Fri, 10 May 2002 11:00:52 +0530 (IST)	[thread overview]
Message-ID: <Pine.GSO.4.10.10205101049310.14865-100000@mailhub.cdac.ernet.in> (raw)

hi
i have perform a test on page table entries. i allocate a buffer through
vmalloc in kernel module and travers page table through that returned
address. following is kernel module



int init_module(void)
{
    unsigned long address, phyadd, pfnum, ioadd;
    pgd_t *pgdp ;
    pmd_t *pmdp ;
    pte_t *ptep ;
    struct page *page_s ;
    printk("\n---------------Entering init_module.--------------------\n") ;

    address = (unsigned long) vmalloc (10) ;
    printk("\naddress=%lx", address) ;

    pgdp = pgd_offset_k(address) ;
    printk("\n\npgdp=%lx", (unsigned long) pgdp) ;
    printk("\npgd_val=%lx", pgd_val(*pgdp)) ;

    pmdp = pmd_offset(pgdp, address) ;
    printk("\n\npmdp=%lx", (unsigned long) pmdp) ;
    printk("\npmd_val=%lx", pmd_val(*pmdp)) ;

    ptep = pte_offset(pmdp, address) ;
    printk("\n\nptep=%lx", (unsigned long) ptep) ;
    printk("\npte_val=%lx", pte_val(*ptep)) ; 



    page_s = pte_page(*ptep) ;
    printk("\nkernel virtual  address=%lx",(unsigned long)
page_s->virtual) ;

    ioadd = virt_to_bus(page_s->virtual) ;
    printk("\nio address virt_to_bus=%lx", ioadd) ;

    printk("\n\n---------------Exiting init_module.------------------\n") ;

    return 0 ;
}



when i install the above module the output is as following


---------------Entering init_module.---------------------

address=c28d8000

pgdp=c0101c28
pgd_val=10af063

pmdp=c0101c28
pmd_val=10af063

ptep=c10af360
pte_val=1516063

kernel virtual  address=c1516000
io address virt_to_bus=1516000

---------------Exiting init_module.----------------------

The problem is i am not able to understand that why the pgd_val, pmd_val
and pte_val contain 0x63 in last two positions actually they are page
address so their last 3 position(in hex) should be zero like in io
address.
can somebody help me


Thanks in Advance


 --- Sanket Rathi

--------------------------


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

             reply	other threads:[~2002-05-10  5:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-10  5:30 Sanket Rathi [this message]
2002-05-10  9:55 ` Stephen C. Tweedie
2002-05-16 11:54   ` Sanket Rathi

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=Pine.GSO.4.10.10205101049310.14865-100000@mailhub.cdac.ernet.in \
    --to=sanket.rathi@cdac.ernet.in \
    --cc=linux-mm@kvack.org \
    /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