aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/lguest/page_tables.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index fb665611ccc2..c4b8eafda308 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -84,7 +84,7 @@ static pgd_t *spgd_addr(struct lguest *lg, u32 i, unsigned long vaddr)
84/* This routine then takes the page directory entry returned above, which 84/* This routine then takes the page directory entry returned above, which
85 * contains the address of the page table entry (PTE) page. It then returns a 85 * contains the address of the page table entry (PTE) page. It then returns a
86 * pointer to the PTE entry for the given address. */ 86 * pointer to the PTE entry for the given address. */
87static pte_t *spte_addr(struct lguest *lg, pgd_t spgd, unsigned long vaddr) 87static pte_t *spte_addr(pgd_t spgd, unsigned long vaddr)
88{ 88{
89 pte_t *page = __va(pgd_pfn(spgd) << PAGE_SHIFT); 89 pte_t *page = __va(pgd_pfn(spgd) << PAGE_SHIFT);
90 /* You should never call this if the PGD entry wasn't valid */ 90 /* You should never call this if the PGD entry wasn't valid */
@@ -261,7 +261,7 @@ int demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode)
261 gpte = pte_mkdirty(gpte); 261 gpte = pte_mkdirty(gpte);
262 262
263 /* Get the pointer to the shadow PTE entry we're going to set. */ 263 /* Get the pointer to the shadow PTE entry we're going to set. */
264 spte = spte_addr(lg, *spgd, vaddr); 264 spte = spte_addr(*spgd, vaddr);
265 /* If there was a valid shadow PTE entry here before, we release it. 265 /* If there was a valid shadow PTE entry here before, we release it.
266 * This can happen with a write to a previously read-only entry. */ 266 * This can happen with a write to a previously read-only entry. */
267 release_pte(*spte); 267 release_pte(*spte);
@@ -310,7 +310,7 @@ static int page_writable(struct lg_cpu *cpu, unsigned long vaddr)
310 310
311 /* Check the flags on the pte entry itself: it must be present and 311 /* Check the flags on the pte entry itself: it must be present and
312 * writable. */ 312 * writable. */
313 flags = pte_flags(*(spte_addr(cpu->lg, *spgd, vaddr))); 313 flags = pte_flags(*(spte_addr(*spgd, vaddr)));
314 314
315 return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW); 315 return (flags & (_PAGE_PRESENT|_PAGE_RW)) == (_PAGE_PRESENT|_PAGE_RW);
316} 316}
@@ -509,7 +509,7 @@ static void do_set_pte(struct lguest *lg, int idx,
509 /* If the top level isn't present, there's no entry to update. */ 509 /* If the top level isn't present, there's no entry to update. */
510 if (pgd_flags(*spgd) & _PAGE_PRESENT) { 510 if (pgd_flags(*spgd) & _PAGE_PRESENT) {
511 /* Otherwise, we start by releasing the existing entry. */ 511 /* Otherwise, we start by releasing the existing entry. */
512 pte_t *spte = spte_addr(lg, *spgd, vaddr); 512 pte_t *spte = spte_addr(*spgd, vaddr);
513 release_pte(*spte); 513 release_pte(*spte);
514 514
515 /* If they're setting this entry as dirty or accessed, we might 515 /* If they're setting this entry as dirty or accessed, we might