aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/page_tables.c
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-17 16:18:08 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-01-30 06:50:18 -0500
commit934faab464c6a26ed1a226b6cf7111b35405dde1 (patch)
treeca920090f0fba7d99865ea865c6746882400dbc4 /drivers/lguest/page_tables.c
parentae3749dcd8c31dcfbab14ea28c68a944c93f418f (diff)
lguest: change gpte_addr header
gpte_addr() does not depend on any guest information. So we wipe out the lg parameter from it completely. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/page_tables.c')
-rw-r--r--drivers/lguest/page_tables.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index c4b8eafda308..c9acafcab2aa 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -100,8 +100,7 @@ static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr)
100 return cpu->lg->pgdirs[cpu->cpu_pgd].gpgdir + index * sizeof(pgd_t); 100 return cpu->lg->pgdirs[cpu->cpu_pgd].gpgdir + index * sizeof(pgd_t);
101} 101}
102 102
103static unsigned long gpte_addr(struct lguest *lg, 103static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr)
104 pgd_t gpgd, unsigned long vaddr)
105{ 104{
106 unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; 105 unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT;
107 BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); 106 BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT));
@@ -235,7 +234,7 @@ int demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
235 234
236 /* OK, now we look at the lower level in the Guest page table: keep its 235 /* OK, now we look at the lower level in the Guest page table: keep its
237 * address, because we might update it later. */ 236 * address, because we might update it later. */
238 gpte_ptr = gpte_addr(lg, gpgd, vaddr); 237 gpte_ptr = gpte_addr(gpgd, vaddr);
239 gpte = lgread(lg, gpte_ptr, pte_t); 238 gpte = lgread(lg, gpte_ptr, pte_t);
240 239
241 /* If this page isn't in the Guest page tables, we can't page it in. */ 240 /* If this page isn't in the Guest page tables, we can't page it in. */
@@ -378,7 +377,7 @@ unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr)
378 if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) 377 if (!(pgd_flags(gpgd) & _PAGE_PRESENT))
379 kill_guest(cpu->lg, "Bad address %#lx", vaddr); 378 kill_guest(cpu->lg, "Bad address %#lx", vaddr);
380 379
381 gpte = lgread(cpu->lg, gpte_addr(cpu->lg, gpgd, vaddr), pte_t); 380 gpte = lgread(cpu->lg, gpte_addr(gpgd, vaddr), pte_t);
382 if (!(pte_flags(gpte) & _PAGE_PRESENT)) 381 if (!(pte_flags(gpte) & _PAGE_PRESENT))
383 kill_guest(cpu->lg, "Bad address %#lx", vaddr); 382 kill_guest(cpu->lg, "Bad address %#lx", vaddr);
384 383