From: Laura Abbott <lauraa@codeaurora.org>
To: Russell King <linux@arm.linux.org.uk>,
Nicolas Pitre <nicolas.pitre@linaro.org>,
Catalin Marinas <catalin.marinas@arm.com>,
linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org, Laura Abbott <lauraa@codeaurora.org>
Subject: [PATCH REPOST] arm: Don't try to print pud/pmd information unless present
Date: Wed, 6 Jun 2012 10:58:36 -0700 [thread overview]
Message-ID: <1339005516-29544-1-git-send-email-lauraa@codeaurora.org> (raw)
Currently in show_pte, there are unconditional checks for
pud_none/pud_bad/pmd_none/pmd_bad. If pud/pmd are not used,
this may incorrectly try to interpret entries as pud/pmd
entries which may print bogus information (e.g. marking a
pgd as bad when the entry is valid). Only check for pud/pmd
information if pud/pmd is actually used.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/mm/fault.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index d7561bb..f69dee0 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -103,27 +103,29 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
}
pud = pud_offset(pgd, addr);
- if (PTRS_PER_PUD != 1)
+ if (PTRS_PER_PUD != 1) {
printk(", *pud=%08lx", pud_val(*pud));
- if (pud_none(*pud))
- break;
+ if (pud_none(*pud))
+ break;
- if (pud_bad(*pud)) {
- printk("(bad)");
- break;
+ if (pud_bad(*pud)) {
+ printk("(bad)");
+ break;
+ }
}
pmd = pmd_offset(pud, addr);
- if (PTRS_PER_PMD != 1)
+ if (PTRS_PER_PMD != 1) {
printk(", *pmd=%08llx", (long long)pmd_val(*pmd));
- if (pmd_none(*pmd))
- break;
+ if (pmd_none(*pmd))
+ break;
- if (pmd_bad(*pmd)) {
- printk("(bad)");
- break;
+ if (pmd_bad(*pmd)) {
+ printk("(bad)");
+ break;
+ }
}
/* We must not map this if we have highmem enabled */
--
1.7.8.3
reply other threads:[~2012-06-06 17:58 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=1339005516-29544-1-git-send-email-lauraa@codeaurora.org \
--to=lauraa@codeaurora.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.pitre@linaro.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).