linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cameron Davies <pauld@cse.unsw.EDU.AU>
To: linux-mm@kvack.org
Subject: [PATCH 13/15] PTI: Add files and IA64 part of interface
Date: Sat, 21 May 2005 15:09:56 +1000 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0505211506080.8979@wagner.orchestra.cse.unsw.EDU.AU> (raw)
In-Reply-To: <Pine.LNX.4.61.0505211500180.8979@wagner.orchestra.cse.unsw.EDU.AU>

Patch 13 of 15.

This patch adds the new files required by the IA64 architecture
to achieve a trully independent page table interface.  Architectures
other that IA64 also require an architecture dependent interface
component to achieve a trully indepenent page table interface.

 	*The architecture dependent interface is to go in
 	 include/asm-ia64/mlpt.h  This will be hooked into the general
 	 page table interface.
 	*mlpt specific code in include/asm-ia64/pgtable.h is to be
 	 abstracted to include/asm-ia64/pgtable-mlpt.h.
 	*mlpt specific code for the ia64 architecture is to be shifted
 	 behind the interface into mlpt-ia64.c.

  arch/ia64/mm/Makefile               |    2
  arch/ia64/mm/fixed-mlpt/Makefile    |    5 +
  arch/ia64/mm/fixed-mlpt/mlpt-ia64.c |    1
  include/asm-ia64/mlpt.h             |  108 
++++++++++++++++++++++++++++++++++++
  include/asm-ia64/pgtable-mlpt.h     |    5 +
  include/asm-ia64/pgtable.h          |    7 ++
  6 files changed, 128 insertions(+)

Index: linux-2.6.12-rc4/include/asm-ia64/pgtable.h
===================================================================
--- linux-2.6.12-rc4.orig/include/asm-ia64/pgtable.h	2005-05-19 
17:01:14.000000000 +1000
+++ linux-2.6.12-rc4/include/asm-ia64/pgtable.h	2005-05-19 
18:32:00.000000000 +1000
@@ -20,6 +20,10 @@
  #include <asm/system.h>
  #include <asm/types.h>

+#ifdef CONFIG_MLPT
+#include <asm/pgtable-mlpt.h>
+#endif
+
  #define IA64_MAX_PHYS_BITS	50	/* max. number of physical address 
bits (architected) */

  /*
@@ -561,7 +565,10 @@
  #define __HAVE_ARCH_PGD_OFFSET_GATE
  #define __HAVE_ARCH_LAZY_MMU_PROT_UPDATE

+#ifdef CONFIG_MLPT
  #include <asm-generic/pgtable-nopud.h>
+#endif
+
  #include <asm-generic/pgtable.h>

  #endif /* _ASM_IA64_PGTABLE_H */
Index: linux-2.6.12-rc4/include/asm-ia64/pgtable-mlpt.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.12-rc4/include/asm-ia64/pgtable-mlpt.h	2005-05-19 
18:32:00.000000000 +1000
@@ -0,0 +1,5 @@
+#ifndef ASM_IA64_PGTABLE_MLPT_H
+#define ASM_IA64_PGTABLE_MLPT_H 1
+
+#endif
+
Index: linux-2.6.12-rc4/arch/ia64/mm/fixed-mlpt/mlpt-ia64.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.12-rc4/arch/ia64/mm/fixed-mlpt/mlpt-ia64.c	2005-05-19 
18:32:00.000000000 +1000
@@ -0,0 +1 @@
+
Index: linux-2.6.12-rc4/arch/ia64/mm/fixed-mlpt/Makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.12-rc4/arch/ia64/mm/fixed-mlpt/Makefile	2005-05-19 
18:32:00.000000000 +1000
@@ -0,0 +1,5 @@
+#
+# Makefile
+#
+
+obj-y := mlpt-ia64.o
Index: linux-2.6.12-rc4/arch/ia64/mm/Makefile
===================================================================
--- linux-2.6.12-rc4.orig/arch/ia64/mm/Makefile	2005-05-19 
17:01:14.000000000 +1000
+++ linux-2.6.12-rc4/arch/ia64/mm/Makefile	2005-05-19 
18:32:00.000000000 +1000
@@ -4,6 +4,8 @@

  obj-y := init.o fault.o tlb.o extable.o

+obj-y += fixed-mlpt/
+
  obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
  obj-$(CONFIG_NUMA)	   += numa.o
  obj-$(CONFIG_DISCONTIGMEM) += discontig.o
Index: linux-2.6.12-rc4/include/asm-ia64/mlpt.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.12-rc4/include/asm-ia64/mlpt.h	2005-05-19 
18:32:00.000000000 +1000
@@ -0,0 +1,108 @@
+#ifndef MLPT_IA64_H
+#define MLPT_IA64_H 1
+
+#include <linux/bootmem.h>
+
+static inline pte_t *lookup_kernel_page_table(unsigned long address)
+{
+	pgd_t *pgd;
+	pud_t *pud;
+	pmd_t *pmd;
+	pte_t *pte;
+
+	pgd = pgd_offset_k(address);
+	if (pgd_none_or_clear_bad(pgd))
+		return NULL;
+
+	pud = pud_offset(pgd, address);
+	if (pud_none_or_clear_bad(pud)) {
+		return NULL;
+	}
+
+	pmd = pmd_offset(pud, address);
+	if (pmd_none_or_clear_bad(pmd)) {
+		return NULL;
+	}
+
+	pte = pte_offset_kernel(pmd, address);
+
+	return pte;
+}
+
+
+/**
+ * build_kernel_page_table - frees a user process page table.
+ * @mm: the address space that owns the page table.
+ * @address: The virtual address for which we are adding a mapping.
+ *
+ * Returns a pointer to a pte.
+ *
+ * Builds the pud/pmd.pte directorires for a page table if requried.
+ * This function readies the page table for insertion.
+ */
+
+static inline pte_t *build_kernel_page_table(unsigned long address)
+{
+	pgd_t *pgd;
+	pud_t *pud;
+	pmd_t *pmd;
+	pte_t *pte;
+
+	pgd = pgd_offset_k(address);
+
+	if (!pgd) {
+		return NULL;
+	}
+
+	pud = pud_alloc(&init_mm, pgd, address);
+	if (!pud) {
+		return NULL;
+	}
+
+	pmd = pmd_alloc(&init_mm, pud, address);
+	if (!pmd) {
+		return NULL;
+	}
+
+	pte = pte_alloc_map(&init_mm, pmd, address);
+
+	return pte;
+}
+
+
+/**
+ * build_memory_map - builds the kernel page table for the memory map
+ * @address: The virtual address for which we are adding a mapping.
+ *
+ * Returns a pointer to the pte to be mapped.
+ *
+ * This function builds the kernel page table
+ */
+
+static inline pte_t *build_memory_map(unsigned long address)
+{
+	pgd_t *pgd;
+	pud_t *pud;
+	pmd_t *pmd;
+
+	pgd = pgd_offset_k(address);
+	if (pgd_none(*pgd))
+		pgd_populate(&init_mm, pgd,
+			     alloc_bootmem_pages_node(
+				     NODE_DATA(node), PAGE_SIZE));
+	pud = pud_offset(pgd, address);
+
+	if (pud_none(*pud))
+		pud_populate(&init_mm, pud,
+			     alloc_bootmem_pages_node(
+				     NODE_DATA(node), PAGE_SIZE));
+	pmd = pmd_offset(pud, address);
+
+	if (pmd_none(*pmd))
+		pmd_populate_kernel(&init_mm, pmd,
+				    alloc_bootmem_pages_node(
+					    NODE_DATA(node), PAGE_SIZE));
+	return pte_offset_kernel(pmd, address);
+}
+
+#endif

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-05-21  5:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-21  2:43 [PATCH 1/15] PTI: clean page table interface Paul Davies
2005-05-21  2:53 ` [PATCH 2/15] PTI: Add general files and directories Paul Cameron Davies
2005-05-21  3:08   ` [PATCH 3/15] PTI: move mlpt behind interface Paul Cameron Davies
2005-05-21  3:15     ` [PATCH 4/15] PTI: move mlpt behind interface cont Paul Cameron Davies
2005-05-21  3:26       ` [PATCH 5/15] PTI: Finish moving mlpt behind interface Paul Cameron Davies
2005-05-21  3:47         ` [PATCH 6/15] PTI: Start calling the interface Paul Cameron Davies
2005-05-21  3:54           ` [PATCH 7/15] PTI: continue calling interface Paul Cameron Davies
2005-05-21  4:04             ` [PATCH 8/15] PTI: Keep " Paul Cameron Davies
2005-05-21  4:12               ` [PATCH 9/15] PTI: Introduce iterators Paul Cameron Davies
2005-05-21  4:19                 ` [PATCH 10/15] PTI: Call iterators Paul Cameron Davies
2005-05-21  4:58                   ` [PATCH 11/15] PTI: Continue calling iterators Paul Cameron Davies
2005-05-21  5:04                     ` [PATCH 12/15] PTI: Finish " Paul Cameron Davies
2005-05-21  5:09                       ` Paul Cameron Davies [this message]
2005-05-21  5:15                         ` [PATCH 14/15] PTI: Move IA64 mlpt code behind interface Paul Cameron Davies
2005-05-21  5:27                           ` [PATCH 15/15] PTI: Call IA64 interface Paul Cameron Davies
2005-05-21  5:46                             ` PTI: Patch 10/15 URL Paul Cameron Davies
2005-05-21  5:47                               ` PTI: LMbench results Paul Cameron Davies
2005-05-28  8:53 ` [PATCH 1/15] PTI: clean page table interface Christoph Hellwig
2005-05-30  5:16   ` Paul Davies

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=Pine.LNX.4.61.0505211506080.8979@wagner.orchestra.cse.unsw.EDU.AU \
    --to=pauld@cse.unsw.edu.au \
    --cc=linux-mm@kvack.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