diff options
Diffstat (limited to 'drivers/lguest/page_tables.c')
-rw-r--r-- | drivers/lguest/page_tables.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c index fe3c7575647b..2a45f0691c9b 100644 --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c | |||
@@ -209,7 +209,7 @@ int demand_page(struct lguest *lg, unsigned long vaddr, int errcode) | |||
209 | pte_t *spte; | 209 | pte_t *spte; |
210 | 210 | ||
211 | /* First step: get the top-level Guest page table entry. */ | 211 | /* First step: get the top-level Guest page table entry. */ |
212 | gpgd = __pgd(lgread_u32(lg, gpgd_addr(lg, vaddr))); | 212 | gpgd = lgread(lg, gpgd_addr(lg, vaddr), pgd_t); |
213 | /* Toplevel not present? We can't map it in. */ | 213 | /* Toplevel not present? We can't map it in. */ |
214 | if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) | 214 | if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) |
215 | return 0; | 215 | return 0; |
@@ -235,7 +235,7 @@ int demand_page(struct lguest *lg, unsigned long vaddr, int errcode) | |||
235 | /* 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 |
236 | * address, because we might update it later. */ | 236 | * address, because we might update it later. */ |
237 | gpte_ptr = gpte_addr(lg, gpgd, vaddr); | 237 | gpte_ptr = gpte_addr(lg, gpgd, vaddr); |
238 | gpte = __pte(lgread_u32(lg, gpte_ptr)); | 238 | gpte = lgread(lg, gpte_ptr, pte_t); |
239 | 239 | ||
240 | /* 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. */ |
241 | if (!(pte_flags(gpte) & _PAGE_PRESENT)) | 241 | if (!(pte_flags(gpte) & _PAGE_PRESENT)) |
@@ -278,7 +278,7 @@ int demand_page(struct lguest *lg, unsigned long vaddr, int errcode) | |||
278 | 278 | ||
279 | /* Finally, we write the Guest PTE entry back: we've set the | 279 | /* Finally, we write the Guest PTE entry back: we've set the |
280 | * _PAGE_ACCESSED and maybe the _PAGE_DIRTY flags. */ | 280 | * _PAGE_ACCESSED and maybe the _PAGE_DIRTY flags. */ |
281 | lgwrite_u32(lg, gpte_ptr, pte_val(gpte)); | 281 | lgwrite(lg, gpte_ptr, pte_t, gpte); |
282 | 282 | ||
283 | /* We succeeded in mapping the page! */ | 283 | /* We succeeded in mapping the page! */ |
284 | return 1; | 284 | return 1; |
@@ -366,12 +366,12 @@ unsigned long guest_pa(struct lguest *lg, unsigned long vaddr) | |||
366 | pte_t gpte; | 366 | pte_t gpte; |
367 | 367 | ||
368 | /* First step: get the top-level Guest page table entry. */ | 368 | /* First step: get the top-level Guest page table entry. */ |
369 | gpgd = __pgd(lgread_u32(lg, gpgd_addr(lg, vaddr))); | 369 | gpgd = lgread(lg, gpgd_addr(lg, vaddr), pgd_t); |
370 | /* Toplevel not present? We can't map it in. */ | 370 | /* Toplevel not present? We can't map it in. */ |
371 | if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) | 371 | if (!(pgd_flags(gpgd) & _PAGE_PRESENT)) |
372 | kill_guest(lg, "Bad address %#lx", vaddr); | 372 | kill_guest(lg, "Bad address %#lx", vaddr); |
373 | 373 | ||
374 | gpte = __pte(lgread_u32(lg, gpte_addr(lg, gpgd, vaddr))); | 374 | gpte = lgread(lg, gpte_addr(lg, gpgd, vaddr), pte_t); |
375 | if (!(pte_flags(gpte) & _PAGE_PRESENT)) | 375 | if (!(pte_flags(gpte) & _PAGE_PRESENT)) |
376 | kill_guest(lg, "Bad address %#lx", vaddr); | 376 | kill_guest(lg, "Bad address %#lx", vaddr); |
377 | 377 | ||