[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [LINUX] Replace pagetable walks by simple address calculation.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 129ce4f59b6dc8e2406a13a058ef393894ff355f
# Parent  a75c1bdfe76146ad591574d805be5be0a3098d2a
[LINUX] Replace pagetable walks by simple address calculation.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff -r a75c1bdfe761 -r 129ce4f59b6d 
linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c    Fri Jun 30 10:24:14 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c    Fri Jun 30 10:35:54 
2006 +0100
@@ -271,10 +271,6 @@ int xen_create_contiguous_region(
 int xen_create_contiguous_region(
        unsigned long vstart, unsigned int order, unsigned int address_bits)
 {
-       pgd_t         *pgd; 
-       pud_t         *pud; 
-       pmd_t         *pmd;
-       pte_t         *pte;
        unsigned long *in_frames = discontig_frames, out_frame;
        unsigned long  frame, i, flags;
        long           rc;
@@ -313,11 +309,7 @@ int xen_create_contiguous_region(
 
        /* 1. Zap current PTEs, remembering MFNs. */
        for (i = 0; i < (1UL<<order); i++) {
-               pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
-               pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
-               pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
-               pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
-               in_frames[i] = pte_mfn(*pte);
+               in_frames[i] = pfn_to_mfn((__pa(vstart) >> PAGE_SHIFT) + i);
                if (HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE),
                                                 __pte_ma(0), 0))
                        BUG();
@@ -372,10 +364,6 @@ int xen_create_contiguous_region(
 
 void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order)
 {
-       pgd_t         *pgd; 
-       pud_t         *pud; 
-       pmd_t         *pmd;
-       pte_t         *pte;
        unsigned long *out_frames = discontig_frames, in_frame;
        unsigned long  frame, i, flags;
        long           rc;
@@ -410,11 +398,7 @@ void xen_destroy_contiguous_region(unsig
        contiguous_bitmap_clear(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
 
        /* 1. Find start MFN of contiguous extent. */
-       pgd = pgd_offset_k(vstart);
-       pud = pud_offset(pgd, vstart);
-       pmd = pmd_offset(pud, vstart);
-       pte = pte_offset_kernel(pmd, vstart);
-       in_frame = pte_mfn(*pte);
+       in_frame = pfn_to_mfn(__pa(vstart) >> PAGE_SHIFT);
 
        /* 2. Zap current PTEs. */
        for (i = 0; i < (1UL<<order); i++) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.