Subject: Re: [Dev] virtual to physical address

From: "John F Davis" <[email-masked]>
Date: Mon, 16 Sep 2002 11:39:44 -0400

Hello

Well, I don't know which processor you are using, but in PPC you can get
this info from the TLB registers.

JD

Dave Wu/Raleigh/IBM@[email-masked] on 09/16/2002 11:13:12 AM

Please respond to [email-masked]

Sent by:    [email-masked]

To:    [email-masked]
cc:
Subject:    [Dev] virtual to physical address

I'm trying to understand the address mapping between a virtual address to
physical address w/ PAE  for kernel 2.4.19.

I need to write a syscall which, given a virtual address will returns a
physical address.  The physical address may be at high memory (above 4G) so
should return a 64 bits address.

I TRIED

VirtualAddress  = virtual address at user space

page_dir = pgd_offset(current->mm, VirtualAddress );
page_middle = pmd_offset(page_dir, VirtualAddress );
pte = *pte_offset(page_middle, VirtualAddress );

 physaddress = __pa(page_address(pte_page(pte)) + (VirtualAddress &
~PAGE_MASK));

but I got some invalid address

Any pointers of how to do this is greatly appreciated.

David

_______________________________________________
Dev mailing list
[email-masked]
http://www.trilug.org/mailman/listinfo/dev

---

From: Mike Mueller <[email-masked]>
Date: Thu, 19 Sep 2002 21:44:07 -0400

http://groups.google.com/groups?selm=am5cb0%24pkh%241%40panix2.panix.com

I thought of Lucy's filing system for Mr. Mooney after reading this.
-- 
mueller, mike

The larger purpose of the economic order, including Wall Street, is to 
support the material conditions for human existence, not to undermine and 
destabilize them.

-Editorial, The Nation, August 19, 2002