mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernhard Walle <bwalle@suse.de>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	crash-utility@redhat.com, Bernhard Walle <bwalle@suse.de>
Subject: [PATCH 1/3] Unify devmem_is_allowed across architectures
Date: Sun, 16 Nov 2008 15:47:46 +0100	[thread overview]
Message-ID: <1226846868-9595-2-git-send-email-bwalle@suse.de> (raw)
In-Reply-To: <1226846868-9595-1-git-send-email-bwalle@suse.de>

This patch unifies devmem_is_allowed() across different architectures.
It removes the devmem_is_allowed 1 defines from m32r and frv and
adds a generic fallback implementation to <asm-generic/page.h>.

Architecutes can define their version and define __HAVE_ARCH_RANGE_IS_ALLOWED.


Signed-off-by: Bernhard Walle <bwalle@suse.de>
---
 arch/x86/include/asm/page.h |    1 +
 include/asm-frv/page.h      |    2 --
 include/asm-generic/page.h  |    4 ++++
 include/asm-m32r/page.h     |    2 --
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index e9873a2..b768401 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -63,6 +63,7 @@ extern void map_devmem(unsigned long pfn, unsigned long size,
 		       pgprot_t vma_prot);
 extern void unmap_devmem(unsigned long pfn, unsigned long size,
 			 pgprot_t vma_prot);
+#define __HAVE_ARCH_RANGE_IS_ALLOWED 1
 
 extern unsigned long max_low_pfn_mapped;
 extern unsigned long max_pfn_mapped;
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h
index bd9c220..bc2c835 100644
--- a/include/asm-frv/page.h
+++ b/include/asm-frv/page.h
@@ -40,8 +40,6 @@ typedef struct page *pgtable_t;
 #define __pgprot(x)	((pgprot_t) { (x) } )
 #define PTE_MASK	PAGE_MASK
 
-#define devmem_is_allowed(pfn)	1
-
 #define __pa(vaddr)		virt_to_phys((void *) (unsigned long) (vaddr))
 #define __va(paddr)		phys_to_virt((unsigned long) (paddr))
 
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index 14db733..cde4ceb 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -19,6 +19,10 @@ static __inline__ __attribute_const__ int get_order(unsigned long size)
 	return order;
 }
 
+#ifndef __HAVE_ARCH_RANGE_IS_ALLOWED
+#define devmem_is_allowed(pfn)	1
+#endif
+
 #endif	/* __ASSEMBLY__ */
 
 #endif	/* _ASM_GENERIC_PAGE_H */
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index c933308..89d6b10 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -79,8 +79,6 @@ typedef struct page *pgtable_t;
 #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC )
 
-#define devmem_is_allowed(x) 1
-
 #include <asm-generic/memory_model.h>
 #include <asm-generic/page.h>
 
-- 
1.6.0.4


  reply	other threads:[~2008-11-16 14:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 14:47 Turn CONFIG_STRICT_DEVMEM in sysctl dev.mem.restricted Bernhard Walle
2008-11-16 14:47 ` Bernhard Walle [this message]
2008-11-16 14:47 ` [PATCH 2/3] Add dev.mem.restricted sysctl Bernhard Walle
2008-11-16 15:07   ` Willy Tarreau
2008-11-16 14:47 ` [PATCH 3/3] Remove CONFIG_STRICT_DEVMEM Bernhard Walle
2008-11-16 15:09   ` Alan Cox
2008-11-16 15:21     ` Bernhard Walle
2008-11-16 15:46       ` Alan Cox
2008-11-17 13:57     ` David Howells
2008-11-16 15:07 ` Turn CONFIG_STRICT_DEVMEM in sysctl dev.mem.restricted Alan Cox
2008-11-16 15:20   ` Bernhard Walle
2008-11-16 15:45     ` Alan Cox
2008-11-16 16:03       ` Arjan van de Ven
2008-11-16 16:09         ` Alan Cox
2008-11-16 16:19         ` Bernhard Walle
2008-11-16 16:11       ` Bernhard Walle
2008-11-16 17:03         ` Alan Cox
2008-11-16 15:39 ` Arjan van de Ven
2008-11-16 15:56   ` Bernhard Walle
2008-11-16 16:06     ` Arjan van de Ven
2008-11-16 20:32   ` H. Peter Anvin

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=1226846868-9595-2-git-send-email-bwalle@suse.de \
    --to=bwalle@suse.de \
    --cc=crash-utility@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®