From: Nathan Lynch <ntl@pobox.com>
To: Steve Best <sfbest@us.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/mm: add devmem_is_allowed() for STRICT_DEVMEM checking
Date: Tue, 14 Jun 2011 12:30:57 -0500 [thread overview]
Message-ID: <1308072658.2452.10.camel@orca.stoopid.dyndns.org> (raw)
In-Reply-To: <20110614165011.23034.66685.sendpatchset@squad5-lp1.lab.bos.redhat.com>
Hi Steve,
On Tue, 2011-06-14 at 12:58 -0400, Steve Best wrote:
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index e72dcf6..e1aab6b 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -283,4 +283,15 @@ config PPC_EARLY_DEBUG_CPM_ADDR
> platform probing is done, all platforms selected must
> share the same address.
>
> +config STRICT_DEVMEM
> + def_bool y
Default new config items to n, please.
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -520,3 +520,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
> hash_preload(vma->vm_mm, address, access, trap);
> #endif /* CONFIG_PPC_STD_MMU */
> }
> +
> +/*
> + * devmem_is_allowed() checks to see if /dev/mem access to a certain address
> + * is valid. The argument is a physical page number.
> + *
> + * On PowerPC, access has to be given to data regions used by X. We have to
> + * disallow access to device-exclusive MMIO regions and system RAM.
> + */
> +int devmem_is_allowed(unsigned long pfn)
> +{
> + if ((pfn >= 57360 || pfn <= 57392))
> + return 1;
That seems... fragile. Where do these numbers come from, and are they
appropriate for all platforms and configurations?
next prev parent reply other threads:[~2011-06-14 17:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 16:58 [PATCH] powerpc/mm: add devmem_is_allowed() for STRICT_DEVMEM checking Steve Best
2011-06-14 17:30 ` Nathan Lynch [this message]
2011-06-14 18:17 ` Steve Best
2011-06-14 19:04 ` Scott Wood
[not found] ` <20110614140431.31ae4357__48367.5367352136$1308078343$gmane$org@schlenkerla.am.freescale.net>
2011-06-29 22:01 ` Sukadev Bhattiprolu
-- strict thread matches above, loose matches on Subject: below --
2011-01-31 19:16 Steve Best
2011-01-31 19:25 ` Josh Boyer
2011-01-31 19:32 ` Josh Boyer
2011-01-31 19:40 ` Scott Wood
2011-02-01 17:21 ` Steve Best
2011-02-01 18:35 ` Scott Wood
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=1308072658.2452.10.camel@orca.stoopid.dyndns.org \
--to=ntl@pobox.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sfbest@us.ibm.com \
/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).