* [uml-devel] Page frame access through from kernel thread
@ 2004-04-08 4:22 kuas
0 siblings, 0 replies; only message in thread
From: kuas @ 2004-04-08 4:22 UTC (permalink / raw)
To: user-mode-linux-devel
Hello,
First of all, thanks for the information about UML system call mechanism
previously. It gave me good information about UML. I am actually working
on security project and using UML as the base. Right now, I am doing
experiment with memory (paging mechanism) under UML. I am trying to scan
all the fresh new pages as they are just being brought into the memory
from a file.
I want to be able to handle pages brought in from any FS so that the
solution is architectural independent. I am using guest kernel 2.4.22
(skas mode). I think a good place to patch this is in memory.c since I
can get back the newly brought in page and its pte entry.
static int do_no_page(struct mm_struct * mm, struct vm_area_struct * vma,
unsigned long address, int write_access, pte_t *page_table)
{
struct page * new_page;
pte_t entry;
:
new_page = vma->vm_ops->nopage(vma, address & PAGE_MASK, 0);
:
if (pte_none(*page_table)) {
:
entry = mk_pte(new_page, vma->vm_page_prot);
:
}
:
}
That function calls nopage(), which returns the new_page struct and
later I the pte_t "entry" is derived from that. I am confused of how can
I know where the physical page frame is actually located so I can read
to it from the kernel thread. Should I go deeper closer to the FS mechanism?
In the host linux, intel specification said pte consist of the base
address of the page physical address (20 bits MSB) and page flags (12
bits LSB). Is this the same in UML? I tried to see the "entry" value
using GDB. The value is small, as an example: 0x05d80fb and it's always
the same value as "address" (that passed in). Why? I think in a real
system, address supposed to be offset to table PGD, PMD, and PTE. Is
there any other conversion mechanism to get the "real" physhical address?
If the "entry" address is the physical address of the page frame, does
that means the page frame already being transfered to user space
address. I can't find where it was moved there and how can I access it?
Am I stuck because the kernel space is running on different process from
the client?
Sorry for the long questions. I thought I understood the concept of
Linux MM, however UML might have slightly different mechanism to handle
its page.
Thanks in advance for any info and comments.
Kuas.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-04-08 4:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-08 4:22 [uml-devel] Page frame access through from kernel thread kuas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.