From: Hollis Blanchard <hollis@austin.ibm.com>
To: devel list <linuxppc-dev@lists.linuxppc.org>
Subject: get_pteptr mystery
Date: 18 Dec 2002 18:06:23 -0600 [thread overview]
Message-ID: <1040256384.30597.70.camel@granite.austin.ibm.com> (raw)
I need to mark the first kernel code page writeable because I need to
write to 0xc00000fc. Can someone tell me why the following code fails?
get_pteptr returns 0.
addr = 0xc00000fc;
if (0 != get_pteptr(&init_mm, addr, &ptep)) {
/* mark it writable */
*ptep = pte_mkwrite(*ptep);
/* flush this page from hw TLB */
flush_tlb_range(&init_mm, addr, addr+1);
} else {
printk(KERN_ERR "couldn't get PTE!\n");
}
I've also tried using pgd_offset_k/pmd_offset/pte_offset by hand, but it
seems that the first time any error checking is done is in pte_offset,
and that fails. Specifically
pmd_offset(pgd_offset_k(0xc00000fc)) = c0158000
but
((pmd *)c0158000)->pmd = 0
My code runs at init time, after mm initialization but before init. Does
that mean I can't use init_mm...?
All I want is the pte pointer for 0xc00000fc. Advice welcome. :)
-Hollis
--
PowerPC Linux
IBM Linux Technology Center
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2002-12-19 0:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-19 0:06 Hollis Blanchard [this message]
2002-12-19 0:23 ` get_pteptr mystery Paul Mackerras
2002-12-19 0:41 ` Hollis Blanchard
2003-01-06 23:35 ` Hollis Blanchard
2003-01-07 23:05 ` David Gibson
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=1040256384.30597.70.camel@granite.austin.ibm.com \
--to=hollis@austin.ibm.com \
--cc=linuxppc-dev@lists.linuxppc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).