linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* page table entries
@ 2002-05-10  5:30 Sanket Rathi
  2002-05-10  9:55 ` Stephen C. Tweedie
  0 siblings, 1 reply; 3+ messages in thread
From: Sanket Rathi @ 2002-05-10  5:30 UTC (permalink / raw)
  To: linux-mm

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/

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

* Re: page table entries
  2002-05-10  5:30 page table entries Sanket Rathi
@ 2002-05-10  9:55 ` Stephen C. Tweedie
  2002-05-16 11:54   ` Sanket Rathi
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen C. Tweedie @ 2002-05-10  9:55 UTC (permalink / raw)
  To: Sanket Rathi; +Cc: linux-mm

Hi,

On Fri, May 10, 2002 at 11:00:52AM +0530, Sanket Rathi wrote:

> 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.

You're actually looking at a pte value, not just an address.  The low
12 bits in a pte's contents are not used for addressing but for pte
metadata.  In this case, those bits correspond to:

#define _KERNPG_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED |
_PAGE_DIRTY)

from linux/include/asm-i386/pgtable.h.

Cheers,
 Stephen
--
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/

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

* (no subject)
  2002-05-10  9:55 ` Stephen C. Tweedie
@ 2002-05-16 11:54   ` Sanket Rathi
  0 siblings, 0 replies; 3+ messages in thread
From: Sanket Rathi @ 2002-05-16 11:54 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, kernel-doc

I just want to know how can we restrict the maximum virtual memory and
maximum physical memory on ia64 platform.
Is there any settings in kernel so that we can change that and recompile
kernel. Actually we have a device which can only access 44 bits so we cant
have 64 bit address. I mean is it possible to discard some bits which are
not significant.

Tell me something related to this or any link which i can refer 

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/

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

end of thread, other threads:[~2002-05-16 11:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-10  5:30 page table entries Sanket Rathi
2002-05-10  9:55 ` Stephen C. Tweedie
2002-05-16 11:54   ` Sanket Rathi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox