From: Paul Cameron Davies <pauld@cse.unsw.EDU.AU>
To: linux-mm@kvack.org
Subject: [PATCH 15/15] PTI: Call IA64 interface
Date: Sat, 21 May 2005 15:27:45 +1000 (EST) [thread overview]
Message-ID: <Pine.LNX.4.61.0505211525500.8979@wagner.orchestra.cse.unsw.EDU.AU> (raw)
In-Reply-To: <Pine.LNX.4.61.0505211513270.8979@wagner.orchestra.cse.unsw.EDU.AU>
Patch 15 of 15.
The final patch in the series. This patch goes through
and calls the functions in the IA64 specific page table
interface. This includes:
*call lookup_kernel_page_table in fault.c
*call build_kernel_page_table in put_kernel_page.
*call build_memory_map in create_mem_map_page_table.
arch/ia64/mm/fault.c | 22 ++++------------------
arch/ia64/mm/init.c | 35 ++++-------------------------------
2 files changed, 8 insertions(+), 49 deletions(-)
Index: linux-2.6.12-rc4/arch/ia64/mm/fault.c
===================================================================
--- linux-2.6.12-rc4.orig/arch/ia64/mm/fault.c 2005-05-19
17:01:14.000000000 +1000
+++ linux-2.6.12-rc4/arch/ia64/mm/fault.c 2005-05-19
18:40:11.000000000 +1000
@@ -9,8 +9,9 @@
#include <linux/mm.h>
#include <linux/smp_lock.h>
#include <linux/interrupt.h>
+#include <linux/page_table.h>
-#include <asm/pgtable.h>
+#include <asm/mlpt.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/uaccess.h>
@@ -50,27 +51,12 @@
static int
mapped_kernel_page_is_present (unsigned long address)
{
- pgd_t *pgd;
- pud_t *pud;
- pmd_t *pmd;
pte_t *ptep, pte;
- pgd = pgd_offset_k(address);
- if (pgd_none(*pgd) || pgd_bad(*pgd))
- return 0;
-
- pud = pud_offset(pgd, address);
- if (pud_none(*pud) || pud_bad(*pud))
- return 0;
-
- pmd = pmd_offset(pud, address);
- if (pmd_none(*pmd) || pmd_bad(*pmd))
- return 0;
-
- ptep = pte_offset_kernel(pmd, address);
+ ptep = lookup_kernel_page_table(address);
if (!ptep)
return 0;
-
+
pte = *ptep;
return pte_present(pte);
}
Index: linux-2.6.12-rc4/arch/ia64/mm/init.c
===================================================================
--- linux-2.6.12-rc4.orig/arch/ia64/mm/init.c 2005-05-19
18:36:14.000000000 +1000
+++ linux-2.6.12-rc4/arch/ia64/mm/init.c 2005-05-19
18:40:11.000000000 +1000
@@ -215,27 +215,15 @@
struct page *
put_kernel_page (struct page *page, unsigned long address, pgprot_t
pgprot)
{
- pgd_t *pgd;
- pud_t *pud;
- pmd_t *pmd;
pte_t *pte;
if (!PageReserved(page))
printk(KERN_ERR "put_kernel_page: page at 0x%p not in
reserved memory\n",
page_address(page));
- pgd = pgd_offset_k(address); /* note: this is NOT
pgd_offset()! */
-
spin_lock(&init_mm.page_table_lock);
{
- pud = pud_alloc(&init_mm, pgd, address);
- if (!pud)
- goto out;
-
- pmd = pmd_alloc(&init_mm, pud, address);
- if (!pmd)
- goto out;
- pte = pte_alloc_map(&init_mm, pmd, address);
+ pte = build_kernel_page_table(address);
if (!pte)
goto out;
if (!pte_none(*pte)) {
@@ -349,9 +337,6 @@
unsigned long address, start_page, end_page;
struct page *map_start, *map_end;
int node;
- pgd_t *pgd;
- pud_t *pud;
- pmd_t *pmd;
pte_t *pte;
map_start = vmem_map + (__pa(start) >> PAGE_SHIFT);
@@ -362,22 +347,10 @@
node = paddr_to_nid(__pa(start));
for (address = start_page; address < end_page; address +=
PAGE_SIZE) {
- 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));
- pte = pte_offset_kernel(pmd, address);
-
+ pte = build_memory_map(address);
if (pte_none(*pte))
- set_pte(pte,
pfn_pte(__pa(alloc_bootmem_pages_node(NODE_DATA(node), PAGE_SIZE)) >>
PAGE_SHIFT,
- PAGE_KERNEL));
+ set_pte(pte,
pfn_pte(__pa(alloc_bootmem_pages_node(NODE_DATA(node),
+ PAGE_SIZE)) >> PAGE_SHIFT, PAGE_KERNEL));
}
return 0;
}
--
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>
next prev parent reply other threads:[~2005-05-21 5:27 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 ` [PATCH 13/15] PTI: Add files and IA64 part of interface Paul Cameron Davies
2005-05-21 5:15 ` [PATCH 14/15] PTI: Move IA64 mlpt code behind interface Paul Cameron Davies
2005-05-21 5:27 ` Paul Cameron Davies [this message]
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.0505211525500.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