From: kuas <ku4s@users.sourceforge.net>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] Page frame access through from kernel thread
Date: Thu, 08 Apr 2004 00:22:37 -0400 [thread overview]
Message-ID: <4074D38D.10101@users.sourceforge.net> (raw)
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
reply other threads:[~2004-04-08 4:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4074D38D.10101@users.sourceforge.net \
--to=ku4s@users.sourceforge.net \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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 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.