From: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>
Cc: linux-kernel@vger.kernel.org, Steven.Hand@cl.cam.ac.uk,
Christian.Limpach@cl.cam.ac.uk, Keir.Fraser@cl.cam.ac.uk,
akpm@osdl.org, Ian.Pratt@cl.cam.ac.uk
Subject: [1/6] Xen VMM #4: add ptep_establish_new to make va available
Date: Wed, 08 Dec 2004 07:29:01 +0000 [thread overview]
Message-ID: <E1CbwFx-0006QL-00@mta1.cl.cam.ac.uk> (raw)
In-Reply-To: Your message of "Wed, 08 Dec 2004 07:28:16 GMT." <E1CbwFE-0006PZ-00@mta1.cl.cam.ac.uk>
This patch adds 'ptep_establish_new', in keeping with the
existing 'ptep_establish', but for use where a mapping is being
established where there was previously none present. This
function is useful (rather than just using set_pte) because
having the virtual address available enables a very important
optimisation for arch-xen. We introduce
HAVE_ARCH_PTEP_ESTABLISH_NEW and define a generic implementation
in asm-generic/pgtable.h, following the pattern of the existing
ptep_establish.
Signed-off-by: ian.pratt@cl.cam.ac.uk
---
diff -Nurp pristine-linux-2.6.10-rc3/include/asm-generic/pgtable.h tmp-linux-2.6.10-rc3-xen.patch/include/asm-generic/pgtable.h
--- pristine-linux-2.6.10-rc3/include/asm-generic/pgtable.h 2004-12-03 21:53:20.000000000 +0000
+++ tmp-linux-2.6.10-rc3-xen.patch/include/asm-generic/pgtable.h 2004-12-08 00:52:40.000000000 +0000
@@ -42,6 +42,16 @@ do { \
} while (0)
#endif
+#ifndef __HAVE_ARCH_PTEP_ESTABLISH_NEW
+/*
+ * Establish a mapping where none previously existed
+ */
+#define ptep_establish_new(__vma, __address, __ptep, __entry) \
+do { \
+ set_pte(__ptep, __entry); \
+} while (0)
+#endif
+
#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
static inline int ptep_test_and_clear_young(pte_t *ptep)
{
diff -Nurp pristine-linux-2.6.10-rc3/mm/memory.c tmp-linux-2.6.10-rc3-xen.patch/mm/memory.c
--- pristine-linux-2.6.10-rc3/mm/memory.c 2004-12-03 21:53:46.000000000 +0000
+++ tmp-linux-2.6.10-rc3-xen.patch/mm/memory.c 2004-12-08 00:56:47.000000000 +0000
@@ -1468,7 +1468,7 @@ do_anonymous_page(struct mm_struct *mm,
page_add_anon_rmap(page, vma, addr);
}
- set_pte(page_table, entry);
+ ptep_establish_new(vma, addr, page_table, entry);
pte_unmap(page_table);
/* No need to invalidate - it was non-present before */
@@ -1573,7 +1573,7 @@ retry:
entry = mk_pte(new_page, vma->vm_page_prot);
if (write_access)
entry = maybe_mkwrite(pte_mkdirty(entry), vma);
- set_pte(page_table, entry);
+ ptep_establish_new(vma, address, page_table, entry);
if (anon) {
lru_cache_add_active(new_page);
page_add_anon_rmap(new_page, vma, address);
next prev parent reply other threads:[~2004-12-08 7:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-08 7:28 Xen VMM patch set - take 4 Ian Pratt
2004-12-08 7:29 ` Ian Pratt [this message]
2004-12-08 10:42 ` [1/6] Xen VMM #4: add ptep_establish_new to make va available Christoph Hellwig
2004-12-08 7:29 ` [2/6] Xen VMM #4: return code for arch_free_page Ian Pratt
2004-12-08 7:30 ` [3/6] Xen VMM #4: runtime disable of VT console Ian Pratt
2004-12-08 12:41 ` David Woodhouse
2004-12-08 7:30 ` [4/6] Xen VMM #4: HAS_ARCH_DEV_MEM Ian Pratt
2004-12-08 10:44 ` Christoph Hellwig
2004-12-08 7:31 ` [5/6] Xen VMM #4: split free_irq into teardown_irq Ian Pratt
2004-12-08 7:31 ` [6/6] Xen VMM #4: alloc_skb_from_cache Ian Pratt
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=E1CbwFx-0006QL-00@mta1.cl.cam.ac.uk \
--to=ian.pratt@cl.cam.ac.uk \
--cc=Christian.Limpach@cl.cam.ac.uk \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=Steven.Hand@cl.cam.ac.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.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®