From: "Ameya Mitragotri" <ameya.mitragotri@wipro.com>
To: linux-ia64@vger.kernel.org
Subject: Problem with accessing page tables
Date: Sat, 08 Nov 2003 04:28:38 +0000 [thread overview]
Message-ID: <marc-linux-ia64-106826502101883@msgid-missing> (raw)
Hi,
I wrote following piece of code to traverse the page table for a
particular
Kernel variable. But the PMD access is always a failure.
I'm using Itanium 2 with linux-2.6.0-test5.
Any pointers will be really helpful.
Thanks and regards,
Ameya
pgd_t *pgd;
pmd_t *pmd;
pte_t *ptep, pte;
unsigned long pfn;
printk(KERN_EMERG "The address is %lx\n\n\n",address);
pgd = pgd_offset_k(address);
if (pgd_none(*pgd) || pgd_bad(*pgd))
goto out;
>> pmd = pmd_offset(pgd, address); <<<
One of the checks below fails because the call pmd_offset gives pmd
With value o.
if (pmd_none(*pmd))
goto out;
if (pmd_bad(*pmd))
goto out;
ptep = pte_offset_kernel(pmd, address);
if (!ptep)
goto out;
pte = *ptep;
pte_unmap(ptep);
if (pte_present(pte)) {
if (!write || (pte_write(pte) && pte_dirty(pte))) {
pfn = pte_pfn(pte);
if (pfn_valid(pfn)) {
struct page *page = pfn_to_page(pfn);
//mark_page_accessed(page);
return page;
}
}
}
else
{
printk(KERN_EMERG "pte entry not present \n");
}
out:
printk(KERN_EMERG "At out \n");
next reply other threads:[~2003-11-08 4:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-08 4:28 Ameya Mitragotri [this message]
2003-11-08 7:10 ` Problem with accessing page tables David Mosberger
2003-11-08 7:58 ` Ameya Mitragotri
2003-11-10 21:45 ` David Mosberger
2003-11-11 5:14 ` Ameya Mitragotri
2003-11-11 7:33 ` David Mosberger
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=marc-linux-ia64-106826502101883@msgid-missing \
--to=ameya.mitragotri@wipro.com \
--cc=linux-ia64@vger.kernel.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 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.